W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2012

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

From: Ojan Vafai <ojan@chromium.org>
Date: Thu, 12 Jan 2012 12:07:59 -0800
Message-ID: <CANMdWTsW1NWVCwazsQdtD4R+Qq_aQi0nny638iif5io2od+Lnw@mail.gmail.com>
To: Aryeh Gregor <ayg@aryeh.name>
Cc: Ryosuke Niwa <rniwa@webkit.org>, Ehsan Akhgari <ehsan@mozilla.com>, Simon Pieters <simonp@opera.com>, W3C WebApps WG <public-webapps@w3.org>
Can you do anything useful with a selection on a document that doesn't have
a window? If so, the IE9 behavior makes sense. If not, I prefer the WebKit

For phrasing it, could you define it in terms of document.defaultView? In
other words that document.getSelection is just "return document.defaultView
? document.defaultView.getSelection() : null".

On Thu, Jan 12, 2012 at 7:58 AM, 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.
> So should the spec follow IE?  If not, what definition should we use
> to determine which documents get selections?
Received on Friday, 13 January 2012 00:13:37 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:30 UTC