W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2011

[whatwg] Specification of window.find()

From: Tim Down <timdown@gmail.com>
Date: Wed, 20 Jul 2011 11:14:18 +0100
Message-ID: <CAOYSAj0+2BcDaOKPO577uMx7NO7YchLFSzoLi-=g+9UHzG=ZdA@mail.gmail.com>
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

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:34 UTC