[whatwg] Specification of window.find()

Tim Down timdown at gmail.com
Wed Jul 20 03:14:18 PDT 2011

On 6 January 2011 21:53, Ian Hickson <ian at hixie.ch> wrote:
> On Wed, 27 Oct 2010, benjamin.poulain at nokia.com wrote:
>> I would like to suggest a change for the main HTML 5 specification:
>> http://www.whatwg.org/specs/web-apps/current-work/
>> The problem I have is with the Window object specification
>> (http://www.whatwg.org/specs/web-apps/current-work/#the-window-object ).
>> It does not mention the method find() which can be found on most engines
>> (e.g.: https://developer.mozilla.org/en/DOM/window.find ).
> It looks like IE doesn't implement this, so it's probably not strictly
> required for compat with the Web.
> What are the use cases for this feature?

It's useful for custom search features. I've recommended it a few
times on Stack Overflow for people wanting to highlight or somehow
style all occurrences of a piece of text that may span nodes (it's
this part that is the compelling feature). You can achieve the same
using TextRange in IE. For example:


I think this is a valid use case. On a related note, I would like to
see equivalents of some of the text-based methods in IE's TextRange
make their way into Range, but that's a separate issue.


More information about the whatwg mailing list