Bug 160746 - Optimization in Node.insertBefore() is not spec-compliant
Summary: Optimization in Node.insertBefore() is not spec-compliant
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
Keywords: InRadar, WebExposed
Depends on:
Reported: 2016-08-10 13:39 PDT by Chris Dumez
Modified: 2017-01-20 20:38 PST (History)
6 users (show)

See Also:

Patch (14.78 KB, patch)
2016-08-10 15:06 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
Comment 2 WebKit Commit Bot 2016-08-10 19:23:11 PDT
Comment on attachment 285768 [details]

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