How does Highlight all feature in "Find In Page" work?
I wish to know how the 'highlight all' in the "Find in Page" (Ctrl +
F) of firefox works. The investigation that I have done till now is as
1) Find in Page uses a firefox API called fastFind to search for text
on the page.
2) Once the user clicks on "highlight all", the matches that are found
are applied a style as in CSS for that particular matching string.
If suppose on google home page, we say Ctrl +F, type 'google', click
highlight all, what happens is, before each occurrence of the word
'google' a Code is inserted which is
<span id="__firefox-findbar-search-id" style="padding: 0pt; background-
color: yellow; color: black; display: inline; font-size: inherit;">
This code can be seen only when you select the highlighted text and
choose "View Selection Source" by right-clicking on it.
NOTE THAT, if you view the view the page source by using Ctrl + U, the
above mentioned code is not visible before the highlighted word.
This could mean that, there are 2 different pages. The one with he
highlighting and the CSS code attached to the matching word and the
other which does not have a CSS code.
Does anyone know how exactly this highlighting works?