Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Intent to ship: ParentNode.prepend(), ParentNode.append(), ChildNode.before(), ChildNode.after(), ChildNode.replaceWith()

64 views
Skip to first unread message

Jocelyn Liu

unread,
Apr 18, 2016, 1:11:56 PM4/18/16
to dev-pl...@lists.mozilla.org
As of Firefox 48 I intend to ship ParentNode.prepend(),
ParentNode.append(), ChildNode.before(), ChildNode.after(), and
ChildNode.replaceWith() on all platforms.
These methods would enable web developers to insert a set of nodes or
strings into a parent node's children list or before/after a child node, or
replace a node with them.

Implementation bug: https://bugzilla.mozilla.org/show_bug.cgi?id=911477
Link to standard:
https://dom.spec.whatwg.org/#parentnode
https://dom.spec.whatwg.org/#childnode

Enabled in WebKit nightly, except for Safari.
Blink issue: https://bugs.chromium.org/p/chromium/issues/detail?id=255482,
changesets were backed out, haven't been relanded yet.

Regards,
Jocelyn

smaug

unread,
Apr 18, 2016, 1:29:50 PM4/18/16
to Jocelyn Liu
OK from me.


Need to still carefully look for any possible regressions.


-Olli

Florin Mezei

unread,
Apr 19, 2016, 3:54:14 AM4/19/16
to dev-pl...@lists.mozilla.org
Sounds like this may cause WebCompatibility issues? How worried are we about
this? Can we mitigate this through testing?

Regards,
Florin.
_______________________________________________
dev-platform mailing list
dev-pl...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Boris Zbarsky

unread,
Apr 19, 2016, 10:13:55 AM4/19/16
to
On 4/19/16 3:53 AM, Florin Mezei wrote:
> Sounds like this may cause WebCompatibility issues?

In theory, yes. We've tried to mitigate to some extent by making these
[Unscopable], which should prevent issues from bareword usage in event
handler attributes, at least.

But if some library defines methods with these names on nodes, there
could be problems.

> How worried are we about this?

Mildly but not desperately.

> Can we mitigate this through testing?

Hard to say.

We could try to mitigate through searching web content for the relevant
method names, but I believe that was already done when writing the spec.
I could be wrong, of course....

Past that, I'm not sure how to design a test plan that would catch
issues, if any, here. :(

-Boris

Aryeh Gregor

unread,
Apr 19, 2016, 10:18:24 AM4/19/16
to Boris Zbarsky, dev-pl...@lists.mozilla.org
On Tue, Apr 19, 2016 at 5:13 PM, Boris Zbarsky <bzba...@mit.edu> wrote:
> We could try to mitigate through searching web content for the relevant
> method names, but I believe that was already done when writing the spec. I
> could be wrong, of course....
>
> Past that, I'm not sure how to design a test plan that would catch issues,
> if any, here. :(

Couldn't we add telemetry probes to alert when they hit circumstances
that would cause a problem?

Boris Zbarsky

unread,
Apr 19, 2016, 10:21:27 AM4/19/16
to
On 4/19/16 10:17 AM, Aryeh Gregor wrote:
> Couldn't we add telemetry probes to alert when they hit circumstances
> that would cause a problem?

I have no idea until we come up with a possible list of such
circumstances...

But the most obvious failure mode is a library that does something like:

if (!("append" in document)) {
// define its own append
}

adding a telemetry probe for this would be fairly hard, since it would
need to hook into an operation deep in the JS engine, and one that we
have multiple codepaths for, some of which are not trivial to change
(interp and jits). :(

-Boris

Mike Taylor

unread,
Apr 19, 2016, 1:43:25 PM4/19/16
to dev-pl...@lists.mozilla.org, Boris Zbarsky, jo...@mozilla.com
On 4/19/16 9:13 AM, Boris Zbarsky wrote:
> On 4/19/16 3:53 AM, Florin Mezei wrote:
>> Sounds like this may cause WebCompatibility issues?
>> How worried are we about this?
>
> Mildly but not desperately.

Given that 48 moves to Dev Edition in ~1 week, is there any reason to
not wait for the 49 cycle to let it bake a full Nightly cycle (and
potentially let us find compat bustage)?

>> Can we mitigate this through testing?
>
> Hard to say.
>
> We could try to mitigate through searching web content for the relevant
> method names, but I believe that was already done when writing the spec.
> I could be wrong, of course....
>
> Past that, I'm not sure how to design a test plan that would catch
> issues, if any, here. :(

Stuff like this is easy to test for once we know what breaks. It's
really hard to predict what weird usage in the wild might break this
though...

--
Mike Taylor
Web Compat, Mozilla

Boris Zbarsky

unread,
Apr 19, 2016, 2:59:24 PM4/19/16
to
On 4/19/16 1:43 PM, Mike Taylor wrote:
> Given that 48 moves to Dev Edition in ~1 week, is there any reason to
> not wait for the 49 cycle to let it bake a full Nightly cycle (and
> potentially let us find compat bustage)?

That doesn't seem unreasonable to me.

-Boris
0 new messages