W3C home > Mailing lists > Public > www-style@w3.org > April 2014

Styling of search/find-in-page results

From: Mitar <mmitar@gmail.com>
Date: Wed, 2 Apr 2014 23:20:31 -0700
Message-ID: <CAKLmikMQtKzFSRNVz57Pso+2waobJ0gjtBXdmpXBZSwTfmPy9A@mail.gmail.com>
To: www-style@w3.org

Currently it is not really possible to style search/find-in-page
results. Some browsers reuse selection style (Firefox), some browsers
have special style you cannot style with CSS (Chrome). I think a
pseudo-element selector should be provided to change background-color
and color properties.

Additionally, some browsers support highlighting all search results
(for example, in Chrome, when user selects to "highlight all"
matches). This might be another pseudo element?

The use case for this is in Mozilla pdf.js HTML5 PDF library and
viewer. It uses HTML5 canvas to render PDF5 content. But for the user
to be able to search and select text content of the PDF, a transparent
text layer is created above. If you search on the page, you get
results, but because text layer is transparent, instead of the result
only an empty colorful box is shown. See here:


(Use browser search and not interface which overrides ctrl-f keyboard
shortcut, this is the topic of another my post to whatwg mailing list:


Received on Thursday, 3 April 2014 06:20:58 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:41 UTC