[Bug 28330] New: replace a child with node gets mutation record wrong when node is a DocumentFragment

https://www.w3.org/Bugs/Public/show_bug.cgi?id=28330

            Bug ID: 28330
           Summary: replace a child with node gets mutation record wrong
                    when node is a DocumentFragment
           Product: WebAppsWG
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DOM
          Assignee: annevk@annevk.nl
          Reporter: cap@chrisparis.org
        QA Contact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, www-dom@w3.org

https://dom.spec.whatwg.org/#concept-node-replace

[[
Insert node into parent before reference child with the suppress observers flag
set.

Let nodes be node's children if node is a DocumentFragment node, and a list
containing solely node otherwise.

Queue a mutation record of "childList" for target parent with addedNodes nodes,
removedNodes a list solely containing child, nextSibling reference child, and
previousSibling child's previous sibling. 
]]

In the case that the new node is a DocumentFragment, the Insert step removes
node's children (per https://dom.spec.whatwg.org/#concept-node-insert, Step 5).
Then "let nodes be" is always the empty list, and then the addedNodes in the
mutation record is empty.

Perhaps "let nodes be" should come before "insert node into parent."

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Wednesday, 25 March 2015 03:36:14 UTC