W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2011

[Bug 15238] New: "To split a Text node" steps logical error

From: <bugzilla@jessica.w3.org>
Date: Fri, 16 Dec 2011 23:41:43 +0000
To: www-dom@w3.org
Message-ID: <bug-15238-4009@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=15238

           Summary: "To split a Text node" steps logical error
           Product: WebAppsWG
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DOM Core
        AssignedTo: annevk@opera.com
        ReportedBy: brandonyoyoslade@gmail.com
         QAContact: member-webapi-cvs@w3.org
                CC: mike@w3.org, www-dom@w3.org


In the steps given in the "To split a Text node [...] run these steps" section
(see
http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-text-split)
there are a few logical errors that I'd like to point out.

For step 8, substeps 1 and 2:

"1. For each range whose start node is node, start offset is greater than or
equal to offset, and end offset is greater than offset, set both its start node
and end node to new node and decrease its start offset and end offset by
offset.

2. For each range whose end node is node and end offset is greater than offset,
set its end offset is offset."

and for steps 9 and 10:

"9. For each range whose start node is node and start offset is greater than
offset, set its start node to new node and decrease its start offset by offset.

10. For each range whose end node is node and end offset is greater than
offset, set its end node to new node and decrease its end offset by offset."

As a reminder, each range's boundary point's offset must be a value from 0
(inclusive) to the node length (exclusive). So, these steps should be changed
to read ...

"1. For each range whose start node is node, start offset is greater than or
equal to offset, and end offset is greater than OR EQUAL TO offset, set both
its start node and end node to new node and decrease its start offset and end
offset by offset.

2. For each range whose end node is node and end offset is greater than OR
EQUAL TO offset, set its end offset is offset."

... and ...

"9. For each range whose start node is node and start offset is greater than OR
EQUAL TO offset, set its start node to new node and decrease its start offset
by offset.

10. For each range whose end node is node and end offset is greater than OR
EQUAL TO offset, set its end node to new node and decrease its end offset by
offset."

These modifications prevent a range boundary's offset from being set to the
node's length.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Received on Friday, 16 December 2011 23:41:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:08 GMT