W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2005

[WA1] GUI Selections (was Re: [whatwg] Web Forms 2.0)

From: Olav Junker Kjær <olav@olav.dk>
Date: Thu, 24 Feb 2005 16:36:43 +0100
Message-ID: <421DF48B.10103@olav.dk>
Matthew Raymond wrote:
> | var myRange = document.getSelection();
>    The above gets the current selection within the document. If the 
> document doesn't have a selection, it returns document.createRange(). 
> Similarly, there will be a setSelection method:

You assume that the selection is a property of the document. This is 
like IE, while in Mozilla its a propery of the window (if I understand 
the API correctly).

I think it makes most sense to have the selection be a property of the 
viewport i.e. the window object. If we consider two frames containing 
two different views of the same document (this is theoretically possible 
according to the dom spec), it would seem natural to allow different 
focus and selections in each view. (If e.g. an HTML editor allowed two 
different wiews on the same page while editing, this would matter.)

Btw. the DocumentFocus interface in WA1 (section 11.3) also seem to 
assume that focus is a propery of the document rather than the viewport. 
Again I think its more correct to have it a property of the viewport.

Olav Junker Kj?r
Received on Thursday, 24 February 2005 07:36:43 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:39 UTC