[whatwg] Specification of window.find()

Hallvord R M Steen hallvors at gmail.com
Thu May 5 05:46:43 PDT 2011


2011/5/3 Benjamin Poulain <benjamin.poulain at nokia.com>:

> I don't really have an interest in defending the feature.
>
> I was just hoping to get a specification for the API to get a bit more
> consistency between engines.
>
> Since you do not seem interested in the feature, I guess we can keep it as a
> WebKit/Gecko extension.

Opera is regularly nagged by rich text editor authors who would like
us to support window.find(). Since it seems to be a requested feature,
it would be nice to have a proper spec ;-)

I guess that one of the main use cases indeed is to be able to
highlight search hits inside a single frame (using the browser's
built-in search might highlight hits both in a rich text editor's UI
and the document you're editing, which would be confusing)..

Yes, it is a counter-argument that authors could write their own
implementation. However, it's non-trivial to write a good text find
implementation in JS - it needs to handle text wrapping, text that is
split across different text nodes or tags, HTML entities, soft
hyphens, BiDi and probably a lot of issues I'm not aware of. It's a
lot simpler to let the JS author hook into the UA's presumably
superior and better tested algorithm.

-- 
Hallvord R. M. Steen



More information about the whatwg mailing list