Re: The new and improved findbar… and the future?

Mike de Boer mdeboer at
Mon Aug 12 16:42:14 UTC 2013

Please see my answer inline:

On Aug 12, 2013, at 5:53 PM, Jared Wein <jwein at> wrote:

> ----- Original Message -----
> Yes, I think this would be greatly appreciated on all platforms (including Highlight All by default as well). We will probably have to disable Highlight All if there are more than 50 occurances to limit possible performance issues, but in the general case this should not be encountered.

Well, as Gavin mentioned to me before, we could try to be a bit smarter about Highlight All and do the processing in chunks divided by setTimeouts to keep things responsive. On top of that we can just highlight the matches that are visible and draw more when the user scrolls (virtual viewport). We can't defer things to workers, unfortunately.

> I am curious though, how are you doing the styling for the selected text? ::-moz-selection doesn't allow box-shadows, background-images, or padding changes. I don't think we'll be able to ship anything that modifies the DOM of the page due to the perf issues that can come with it.

I was happy to see that the browser element is inside a stack (devtools uses this feature too)! This way I could simply insert a new stack next to the browser element, not worry about z-indices, make that one transparent black and insert boxes that can be styled using CSS in any way I like. I make sure that the current match box (the yellow one) is inserted as the last child of the stack.
I determine the position and dimensions of the boxes by 1) keeping the found ranges in a WeakMap and 2) extract this information from those ranges.

> Looks great!

Good to hear!

> Jared
> _______________________________________________
> firefox-dev mailing list
> firefox-dev at

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4139 bytes
Desc: not available
URL: <>

More information about the firefox-dev mailing list