[whatwg] Specification of window.find()

Ian Hickson ian at hixie.ch
Tue Jul 19 12:42:45 PDT 2011

On Tue, 3 May 2011, Benjamin Poulain wrote:
> On 05/03/2011 01:42 AM, ext Ian Hickson wrote:
> > > I do not know the original use case but I can think of a few: -on 
> > > mobile devices which have a find dialog but no user interface to 
> > > access it, make the find dialog appear
> > 
> > Are there pages that do this today? Or indeed any UAs that have a find 
> > dialog but no UI to access it? [...]
> 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.

What would be even better is if WebKit and Gecko could just drop support 
for the feature altogether, if there are no compelling use cases for it, 
no compat need, and nobody is interested in defending the feature.

But if there is a need, that's a different matter:

On Thu, 5 May 2011, Hallvord R M Steen wrote:
> 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.

In investigating this further, I've found that window.find() is not 
especially interoperably implemented. I've filed bugs on the two browsers 
that implement it to investigate what we can do about it:


I've also added a placeholder to the spec for this feature.

Depending on how these bugs go, I'll either fill in the spec to one extent 
or another, or remove the section altogether.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list