Intent to Implement and Ship: ParentNode#replaceChildren API

91 views
Skip to first unread message

Yu Han

unread,
Jul 6, 2020, 9:03:04 PM7/6/20
to blink-dev

yuzh...@chromium.org https://github.com/whatwg/dom/issues/478 Specification: https://dom.spec.whatwg.org/#dom-parentnode-replacechildren TAG review is not needed; this is a new API that mainly uses existing APIs, node.removeChild and node.appendChild, to implement its behavior. This API, when invoked, replaces all children of the ParentNode with argument nodes passed-in.


Risks

There's no interoperability and compatibility risk as both Safari and Firefox have shipped their implementation.
Firefox: Shipped (https://bugzilla.mozilla.org/show_bug.cgi?id=1626015)
Edge: No public signals Safari: Shipped (https://bugs.webkit.org/show_bug.cgi?id=198578) Web developers: No signals This API makes web developers more efficient. They can replace a node's children with other nodes via one API. N/A N/A

This should be fully debuggable. Yes Yes https://wpt.fyi/results/dom?label=master&label=experimental&aligned&q=parentnode-replacechildren.html https://chromestatus.com/feature/6143552666992640

Manuel Rego Casasnovas

unread,
Jul 7, 2020, 3:06:04 AM7/7/20
to blin...@chromium.org
LGTM1, it's good to catch up with other browsers on this to avoid
interop issues.

Bye,
Rego

On 07/07/2020 03:02, Yu Han wrote:
> Contact emailsy...@chromium.org
> <mailto:yuzh...@chromium.org>Explainerhttps://github.com/whatwg/dom/issues/478Design
> docs/specSpecification:
> https://dom.spec.whatwg.org/#dom-parentnode-replacechildrenTAG reviewTAG
> review is not needed; this is a new API that mainly uses existing APIs,
> node.removeChild and node.appendChild, to implement its behavior.
> SummaryThis API, when invoked, replaces all children of the ParentNode
> with argument nodes passed-in.
>
>
> Risks
>
> Interoperability and Compatibility There's no interoperability and
> compatibility risk as both Safari and Firefox have shipped their
> implementation.
> /Firefox/: Shipped (https://bugzilla.mozilla.org/show_bug.cgi?id=1626015)
> /Edge/: No public signals /Safari/: Shipped
> (https://bugs.webkit.org/show_bug.cgi?id=198578) /Web developers/: No
> signals Ergonomics This API makes web developers more efficient. They
> can replace a node's children with other nodes via one API. Activation
> N/A Security N/A
>
> DebuggabilityThis should be fully debuggable. Will this feature be
> supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS,
> Android, and Android WebView)?Yes Is this feature fully tested by
> web-platform-tests
> <https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md>?Yes
> https://wpt.fyi/results/dom?label=master&label=experimental&aligned&q=parentnode-replacechildren.html
> <https://wpt.fyi/results/dom?label=master&label=experimental&aligned=&q=parentnode-replacechildren.html>Link
> to entry on the Chrome Platform
> Statushttps://chromestatus.com/feature/6143552666992640
>
> --
> 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
> <mailto:blink-dev+...@chromium.org>.
> To view this discussion on the web visit
> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABgHHk6ANixYo_Ee-JotHqmngKpS%3DkxPQo8yuk11BKSvzDko_w%40mail.gmail.com
> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABgHHk6ANixYo_Ee-JotHqmngKpS%3DkxPQo8yuk11BKSvzDko_w%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Yoav Weiss

unread,
Jul 7, 2020, 4:50:50 AM7/7/20
to Yu Han, blink-dev
On Tue, Jul 7, 2020 at 3:03 AM Yu Han <yuzh...@chromium.org> wrote:

That's not an explainer. It would be good to outline what is planned to ship here, what use cases it covers, how developers are supposed to use it, etc.

Specification: https://dom.spec.whatwg.org/#dom-parentnode-replacechildren TAG review is not needed; this is a new API that mainly uses existing APIs, node.removeChild and node.appendChild, to implement its behavior.


The internal implementation details don't seem highly relevant here. What matters is the API shape. If it's a simple API, then the review should be brief.
 

This API, when invoked, replaces all children of the ParentNode with argument nodes passed-in.


Risks

There's no interoperability and compatibility risk as both Safari and Firefox have shipped their implementation.

What are web developers expected to do? Polyfill this API for browsers which don't support it?
 
Edge: No public signals Safari: Shipped (https://bugs.webkit.org/show_bug.cgi?id=198578) Web developers: No signals This API makes web developers more efficient. They can replace a node's children with other nodes via one API. N/A N/A

This should be fully debuggable. Yes Yes https://wpt.fyi/results/dom?label=master&label=experimental&aligned&q=parentnode-replacechildren.html https://chromestatus.com/feature/6143552666992640

--
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.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABgHHk6ANixYo_Ee-JotHqmngKpS%3DkxPQo8yuk11BKSvzDko_w%40mail.gmail.com.

TAMURA, Kent

unread,
Jul 7, 2020, 7:13:15 PM7/7/20
to Yu Han, blink-dev
On Tue, Jul 7, 2020 at 10:03 AM Yu Han <yuzh...@chromium.org> wrote:

yuzh...@chromium.org https://github.com/whatwg/dom/issues/478 Specification: https://dom.spec.whatwg.org/#dom-parentnode-replacechildren TAG review is not needed; this is a new API that mainly uses existing APIs, node.removeChild and node.appendChild, to implement its behavior. This API, when invoked, replaces all children of the ParentNode with argument nodes passed-in.


Risks

There's no interoperability and compatibility risk as both Safari and Firefox have shipped their implementation.

It's a strong signal.   LGTM2.
 
Edge: No public signals Safari: Shipped (https://bugs.webkit.org/show_bug.cgi?id=198578) Web developers: No signals This API makes web developers more efficient. They can replace a node's children with other nodes via one API. N/A N/A

This should be fully debuggable. Yes Yes https://wpt.fyi/results/dom?label=master&label=experimental&aligned&q=parentnode-replacechildren.html https://chromestatus.com/feature/6143552666992640

--
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.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABgHHk6ANixYo_Ee-JotHqmngKpS%3DkxPQo8yuk11BKSvzDko_w%40mail.gmail.com.


--
TAMURA Kent
Software Engineer, Google


Chris Harrelson

unread,
Jul 8, 2020, 11:17:23 AM7/8/20
to TAMURA, Kent, Yu Han, blink-dev

Yoav Weiss

unread,
Jul 8, 2020, 5:13:36 PM7/8/20
to Yu Han, Chris Harrelson, TAMURA, Kent, Yu Han, blink-dev


On Wed, Jul 8, 2020 at 8:30 PM Yu Han <yuzh...@google.com> wrote:
Thanks everyone for reviewing.

Yoav,
  >>> That's not an explainer. It would be good to outline what is planned to ship here, what use cases it covers, how developers are supposed to use it, etc.

  I've added a quick explainer, https://github.com/yuzhe-han/ParentNode-replaceChildren, which goes more in details on the API being shipped, its usage with example, and a polyfill for unsupported browsers.

Thanks for writing that!
 
  I've updated the chromestatus page accordingly.

  >>> The internal implementation details don't seem highly relevant here. What matters is the API shape. If it's a simple API, then the review should be brief.
   
   I think a TAG review doesn't seem necessary. It's a minor feature and Firefox and Safari already shipped it. However, if you feel strongly about it, I'll create a TAG review.

Since it's already shipped elsewhere and the API surface is small, I tend to agree that a TAG review is not necessary. (as it's potentially too late to modify the API, even if we wanted to)


>>> What are web developers expected to do? Polyfill this API for browsers which don't support it?

  I provided an example, along with a polyfill, in the explainer.  

Thank you! :)
 

Thanks,
Han


Yu Han

unread,
Jul 10, 2020, 3:03:00 AM7/10/20
to Chris Harrelson, yo...@yoav.ws, TAMURA, Kent, Yu Han, blink-dev
Thanks everyone for reviewing.

Yoav,
  >>> That's not an explainer. It would be good to outline what is planned to ship here, what use cases it covers, how developers are supposed to use it, etc.

  I've added a quick explainer, https://github.com/yuzhe-han/ParentNode-replaceChildren, which goes more in details on the API being shipped, its usage with example, and a polyfill for unsupported browsers.
  I've updated the chromestatus page accordingly.

  >>> The internal implementation details don't seem highly relevant here. What matters is the API shape. If it's a simple API, then the review should be brief.
   
   I think a TAG review doesn't seem necessary. It's a minor feature and Firefox and Safari already shipped it. However, if you feel strongly about it, I'll create a TAG review.

>>> What are web developers expected to do? Polyfill this API for browsers which don't support it?

  I provided an example, along with a polyfill, in the explainer.  

Thanks,
Han



On Wed, Jul 8, 2020 at 8:17 AM Chris Harrelson <chri...@chromium.org> wrote:
Reply all
Reply to author
Forward
0 new messages