Re: Selection of a document that doesn't have a window

On Thu, 12 Jan 2012 16:58:58 +0100, Aryeh Gregor <ayg@aryeh.name> wrote:

> What does document.implementation.createHTMLDocument("").getSelection()  
> return?
>
> * IE9 returns a Selection object unique to that document.
> * Firefox 12.0a1 and Opera Next 12.00 alpha return the same thing as
> document.getSelection().
> * Chrome 17 dev returns null.
>
> I prefer IE's behavior just for the sake of simplicity.  If we go with
> Gecko/WebKit/Opera, we have to decide how to identify which documents
> get their own selections and which don't.  The definition should
> probably be something like "documents that are returned by the
> .document property of some window", but I have no idea if that's a
> sane way to phrase it.

HTML uses this concept in lots of places, e.g.
http://www.whatwg.org/specs/web-apps/current-work/#cookie-free-document-object

"A Document that has no browsing context."

> So should the spec follow IE?  If not, what definition should we use
> to determine which documents get selections?


-- 
Simon Pieters
Opera Software

Received on Friday, 13 January 2012 07:41:06 UTC