- From: Olav Junker Kjær <olav@olav.dk>
- Date: Thu, 24 Feb 2005 16:36:43 +0100
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. regards Olav Junker Kj?r
Received on Thursday, 24 February 2005 07:36:43 UTC