Bug 160746

Summary: Optimization in Node.insertBefore() is not spec-compliant
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, ddkilzer, esprehn+autocc, kangil.han, rniwa
Priority: P2 Keywords: InRadar, WebExposed
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Chris Dumez 2016-08-10 13:39:02 PDT
We have an optimization in Node.insertBefore(newNode, refChild) to avoid doing any work when newNode == refChild or newNode.nextSibling == refChild. This optimization is not in the specification:
- https://dom.spec.whatwg.org/#concept-node-replace

The issue is that this optimization is observable with DOM mutation observers / listeners or DOM ranges.
Comment 1 Chris Dumez 2016-08-10 15:06:40 PDT
Created attachment 285768 [details]
Patch
Comment 2 WebKit Commit Bot 2016-08-10 19:23:11 PDT
Comment on attachment 285768 [details]
Patch

Clearing flags on attachment: 285768

Committed r204368: <http://trac.webkit.org/changeset/204368>
Comment 3 WebKit Commit Bot 2016-08-10 19:23:20 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 David Kilzer (:ddkilzer) 2017-01-20 20:38:46 PST
<rdar://problem/29393697>