Skip to content
  • Drew Willcoxon's avatar
    Bug 1665292 - Clear the view's selected result and... · 08b6f031
    Drew Willcoxon authored
    Bug 1665292 - Clear the view's selected result and UrlbarInput._resultForCurrentValue when the view is cleared. r=harry
    
    First, `UrlbarView.clear` needs to null the selected element. Second, setting
    the selected element to null needs to also null
    `UrlbarInput._resultForCurrentValue`. `UrlbarView._selectElement` does call
    `input.setValueFromResult`, which sets `_resultForCurrentValue` -- but not if
    the `updateInput` arg is false. So I added a new
    `UrlbarInput.setResultForCurrentValue` method so `_selectElement` can set it. At
    first I tried unconditionally calling `input.setValueFromResult`, but a bunch of
    tests failed. I looked into it, but it's complicated, so I gave up and added
    this new method.
    
    This also makes some other changes that I'll comment on inline.
    
    Differential Revision: https://phabricator.services.mozilla.com/D90360
    08b6f031