Skip to content
  • Drew Willcoxon's avatar
    Bug 1678765 - Fix broken "Search with" action text for heuristic results that... · 14225c10
    Drew Willcoxon authored
    Bug 1678765 - Fix broken "Search with" action text for heuristic results that are restyled to look like search results. r=harry
    
    This was a little harder than it seemed like it should be because we show/hide
    the title separator in two places, in `UrlbarView.updateRow` and in the CSS.
    This patch gets rid of the show/hide in `updateRow`, so now we show/hide only in
    the CSS. The decision to show/hide in `updateRow` was based on whether the
    result has action text (`actionSetter`) or is a URL (`setURL`). We already had a
    `has-url` attribute that corresponds directly to `setURL`, so adding a similar
    `has-action` attribute that corresponds to `actionSetter` lets us show/hide only
    in the CSS.
    
    The second part of this patch is to actually fix the bug. For that, the existing
    `show-action-text` attribute does part of what we want in the CSS: It forces the
    action to be shown when a one-off is selected and there's no selected row. In
    addition to that, we need to show the action when both a restyled search and a
    one-off are selected, so this adds a new `restyled-search` attribute. We need
    both attributes because we do not want to show the action for a restyled search
    when some other row plus a one-off are selected (to match the current behavior).
    
    Depends on D97843
    
    Differential Revision: https://phabricator.services.mozilla.com/D98429
    14225c10