Intent to Ship: DOM ParentNode + ChildNode method extras

66 views
Skip to first unread message

Sigbjorn Finne

unread,
Jul 28, 2016, 3:50:56 AM7/28/16
to blink-dev
Implemented behind a flag in M52, I propose we ship these in M54 (
https://codereview.chromium.org/2184223004/ )

Contact emails
sigb...@opera.com

Spec
https://dom.spec.whatwg.org/#childnode
https://dom.spec.whatwg.org/#parentnode

(No TAG review needed.)

Summary
Make Blink support a set of DOM standard convenience methods for working
with Nodes:

ParentNode.prepend()
ParentNode.append()
ChildNode.before()
ChildNode.after()
ChildNode.replaceWith()

(Node implements both the ParentNode and ChildNode interfaces.)

Link to “Intent to Implement” blink-dev discussion
https://groups.google.com/a/chromium.org/forum/#!searchin/blink-dev/paritosh/blink-dev/efUPtYm1PP8/MGoTi17AYpcJ

Is this feature supported on all six Blink platforms (Windows, Mac,
Linux, Chrome OS, Android, and Android WebView)?
Yes

Demo link
https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/before


Interoperability and Compatibility Risk
Moving these to stable makes Blink align with the DOM Standard + other
browser implementations (Safari, Mozilla) which have shipped these
already, thereby improving interop.

While extending something central like DOM’s Node has inherent risks,
these have been mitigated by the spec and the implementation (unscopeables.)

OWP launch tracking bug
crbug.com/632273

Entry on the feature dashboard
https://www.chromestatus.com/feature/5723067795898368

TAMURA, Kent

unread,
Jul 28, 2016, 3:57:47 AM7/28/16
to Sigbjorn Finne, blink-dev
LGTM1

--
TAMURA Kent
Software Engineer, Google


Chris Harrelson

unread,
Jul 28, 2016, 11:00:28 AM7/28/16
to TAMURA, Kent, Sigbjorn Finne, blink-dev
LGTM2

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

PhistucK

unread,
Jul 28, 2016, 11:46:48 AM7/28/16
to Sigbjorn Finne, blink-dev

On Thu, Jul 28, 2016 at 10:50 AM, Sigbjorn Finne <sigb...@opera.com> wrote:
(Node implements both the ParentNode and ChildNode interfaces.)

According to the specification, ​Node does not implement those interfaces... Some interfaces that inherit from Node do, but not Node itself. Unless I am missing something?



PhistucK

Sigbjorn Finne

unread,
Jul 28, 2016, 2:09:37 PM7/28/16
to PhistucK, blink-dev
s/Node/Element/ in the above.

--sigbjorn

Philip Jägenstedt

unread,
Jul 28, 2016, 9:21:32 PM7/28/16
to Sigbjorn Finne, PhistucK, blink-dev
LGTM3, yay!
Reply all
Reply to author
Forward
0 new messages