Closed Bug 1548933 Opened 7 months ago Closed 5 months ago

Preview should ignore the search results


(DevTools :: Debugger, defect, P3)



(firefox69 fixed)

Firefox 69
Tracking Status
firefox69 --- fixed


(Reporter: jlast, Assigned: janelledement)


(Blocks 1 open bug)


(Keywords: good-first-bug)


(2 files)

Search results breakup the yellow highlight token.


  1. search for part of a token
  2. pause
  3. hover on the search result
Attached image search-preview.gif
Priority: -- → P3
Keywords: good-first-bug

@jlast My first impulse is to deal with this problem at the moment addHighlight is called. This function adds the ‘preview-selection’ class to a target element which creates the yellow highlight. The preview object is available in props, one could check the target element's innerHTML against the preview.expression and see if there’s a complete match. If not, recursively compare the previous and next elements. If they’re innerHTML is found in the preview.expression, then add the highlight as well, and if not, stop searching. Would also have to make sure those extra elements had ‘preview-selection’ class removed as well when removeHighlight was called. What are your thoughts on this approach?

Janel, sounds good.

@jlast Ok, thanks. I'd like to claim this bug.

Assignee: nobody → janelledement

This patch addresses bug 1548933. It adds the preview highlight to related tokens (if necessary) as well as the target token. This happens when one token is broken into pieces due to a search query that only covers part of the token.

Pushed by
Preview should ignore search results. r=davidwalsh
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 69
Blocks: 1565711
Blocks: 1565713
No longer blocks: 1565711
No longer blocks: 1565713
You need to log in before you can comment on or make changes to this bug.