[whatwg] Specification of window.find()

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:

http://stackoverflow.com/questions/5886858/full-text-search-in-html-ignoring-tags

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.

Tim

Received on Wednesday, 20 July 2011 03:14:18 UTC