W3C home > Mailing lists > Public > public-html-bugzilla@w3.org > September 2010

[Bug 10624] New: Selection anchorNode/anchorOffset/focusNode/focusOffset do not match existing browser behaviour

From: <bugzilla@jessica.w3.org>
Date: Mon, 13 Sep 2010 11:22:37 +0000
To: public-html-bugzilla@w3.org
Message-ID: <bug-10624-2486@http.www.w3.org/Bugs/Public/>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=10624

           Summary: Selection
                    anchorNode/anchorOffset/focusNode/focusOffset do not
                    match existing browser behaviour
           Product: HTML WG
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: timdown@gmail.com
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html@w3.org


The anchorNode, anchorOffset, focusNode and focusOffset properties of a
Selection object lack the subtlety of current browser implementations.
Specifically, they make no provision for a selection to be "backwards"; that
is, for a selection to have been made by starting at a point in the document
and stopping at a point earlier in the document. In Mozilla, WebKit and Opera
the point at which the user started creating the selection is reflected in
anchorNode and anchorOffset and the finish point of the selection in focusNode
and focusOffset, which crucially may be earlier in the document than anchorNode
and anchorOffset. This feature is lost in HTML 5's Range-obsessed Selection
specification, which guarantees that focusNode and focusOffset cannot be a
point earlier in the document than that specified by anchorNode and
anchorOffset. This is a serious loss of the richness of current browser
implementations. The relevant section of the spec that needs to be revised is
the following:

"The anchorNode  attribute must return the value returned by the startContainer
attribute of the last Range object in the list, or null if the list is empty.

The anchorOffset attribute must return the value returned by the startOffset
attribute of the last Range object in the list, or 0 if the list is empty.

The focusNode attribute must return the value returned by the endContainer
attribute of the last Range object in the list, or null if the list is empty.

The focusOffset attribute must return the value returned by the endOffset
attribute of the last Range object in the list, or 0 if the list is empty."

I would suggest that you can still specify these properties in terms of the
final Range within the selection but make provision for backwards selections.
Something like the following for anchorNode, coupled with a definition of the
direction of the selection:

"The anchorNode attribute must return the value returned by either the
startContainer or endContainer attribute of the last Range object in the list
depending on the direction of the selection, or null if the list is empty."

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Monday, 13 September 2010 11:22:39 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:01:24 UTC