New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 18 users

Issue metadata

Status: Fixed
Owner:
Email to this user bounced
Closed: May 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature

Blocked on:
issue 462916

Blocking:
issue 632273



Sign in to add a comment
link

Issue 255482: DOM4: prepend, append, before, after & replace

Reported by stepien....@gmail.com, Jun 28 2013

Issue description

What steps will reproduce the problem?
1. Use DOM4 methods prepend, append, before, after & replace.

What is the expected result?
They're implemented.

What happens instead?
They're not.

Please provide any additional information below. Attach a screenshot if
possible.
See https://bugs.webkit.org/show_bug.cgi?id=74648
This bug wasn't imported from the webkit tracker when Blink happened.
This is OWP-related, right?

http://www.w3.org/TR/dom/#mutation-methods

Sort of related: the "remove" method on <select> elements gets in the way of the "remove" DOM4 mutation method, has it been discussed by the whatwg/w3/anyone?
http://www.w3.org/TR/html5/forms.html#the-select-element
 

Comment 1 Deleted

Comment 2 Deleted

Comment 3 by arv@chromium.org, Jan 27 2014

Status: Available
We are waiting for ES6 @@unscopables before implementing these since adding these will for sure break the web without it.

Comment 4 Deleted

Comment 5 by stepien....@gmail.com, Mar 21 2015

I guess this should be blocked on  Issue 462916 .

`replace` has been renamed to `replaceWith` since then.
The DOM spec for reference:
https://dom.spec.whatwg.org/#childnode
https://dom.spec.whatwg.org/#parentnode

Comment 6 by phil...@opera.com, Apr 14 2015

Blockedon: chromium:462916
Any idea why these things need to be [Unscopeable]?

Comment 7 by stepien....@gmail.com, Apr 14 2015

I believe this is to not break existing websites.

Comment 8 by j...@opera.com, Apr 21 2015

@@unscopables and [Unscopable] are now supported.

Comment 9 by phil...@opera.com, Jun 12 2015

Before shipping this spec bug needs to be fixed:
https://github.com/whatwg/dom/issues/44

Comment 10 by paritosh...@samsung.com, Jun 25 2015

Owner: paritosh...@samsung.com
Status: Assigned

Comment 11 by bugdroid1@chromium.org, Jul 9 2015

Project Member
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=198629

------------------------------------------------------------------
r198629 | paritosh.in@samsung.com | 2015-07-09T20:23:14.569523Z

Changed paths:
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/ParentNode/prepend-on-document.html?r1=198629&r2=198628&pathrev=198629
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/ChildNode?r1=198629&r2=198628&pathrev=198629
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/webexposed/element-instance-property-listing-expected.txt?r1=198629&r2=198628&pathrev=198629
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/ChildNode.idl?r1=198629&r2=198628&pathrev=198629
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/ChildNode/after.html?r1=198629&r2=198628&pathrev=198629
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/ChildNode/before.html?r1=198629&r2=198628&pathrev=198629
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/ParentNode?r1=198629&r2=198628&pathrev=198629
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/ParentNode/append-on-document.html?r1=198629&r2=198628&pathrev=198629
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/ParentNode/prepend.html?r1=198629&r2=198628&pathrev=198629
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/ParentNode.idl?r1=198629&r2=198628&pathrev=198629
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/Node.cpp?r1=198629&r2=198628&pathrev=198629
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/Node.h?r1=198629&r2=198628&pathrev=198629
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/ParentNode/append.html?r1=198629&r2=198628&pathrev=198629
   M http://src.chromium.org/viewvc/blink/trunk/Source/platform/RuntimeEnabledFeatures.in?r1=198629&r2=198628&pathrev=198629
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/ChildNode.h?r1=198629&r2=198628&pathrev=198629
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/webexposed/global-interface-listing-expected.txt?r1=198629&r2=198628&pathrev=198629
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/ParentNode.h?r1=198629&r2=198628&pathrev=198629
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/ChildNode/replace-with.html?r1=198629&r2=198628&pathrev=198629

Implement DOM: prepend, append, before, after & replaceWith

As per https://dom.spec.whatwg.org/#childnode ChildNode interface
should contain before(), after() and replaceWith() API.

As per https://dom.spec.whatwg.org/#parentnode ParentNode interface
should contain prepend(), append() API.

Intent to Implement and ship link: https://groups.google.com/a/chromium.org/forum/#!searchin/blink-dev/paritosh/blink-dev/efUPtYm1PP8/MGoTi17AYpcJ
 
BUG= 255482 

Review URL: https://codereview.chromium.org/1085843002
-----------------------------------------------------------------

Comment 12 by stepien....@gmail.com, Jul 9 2015

So good, thanks.

Comment 13 by bugdroid1@chromium.org, Jul 13 2015

Project Member
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=198750

------------------------------------------------------------------
r198750 | dominicc@chromium.org | 2015-07-13T05:38:58.060327Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/webexposed/element-instance-property-listing-expected.txt?r1=198750&r2=198749&pathrev=198750
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/ChildNode.idl?r1=198750&r2=198749&pathrev=198750
   D http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/ChildNode/after.html?r1=198750&r2=198749&pathrev=198750
   D http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/ChildNode/before.html?r1=198750&r2=198749&pathrev=198750
   D http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/ParentNode/append-on-document.html?r1=198750&r2=198749&pathrev=198750
   D http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/ParentNode/prepend.html?r1=198750&r2=198749&pathrev=198750
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/Node.cpp?r1=198750&r2=198749&pathrev=198750
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/ParentNode.idl?r1=198750&r2=198749&pathrev=198750
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/Node.h?r1=198750&r2=198749&pathrev=198750
   D http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/ParentNode/append.html?r1=198750&r2=198749&pathrev=198750
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/ChildNode.h?r1=198750&r2=198749&pathrev=198750
   M http://src.chromium.org/viewvc/blink/trunk/Source/platform/RuntimeEnabledFeatures.in?r1=198750&r2=198749&pathrev=198750
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/webexposed/global-interface-listing-expected.txt?r1=198750&r2=198749&pathrev=198750
   D http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/ChildNode/replace-with.html?r1=198750&r2=198749&pathrev=198750
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/dom/ParentNode.h?r1=198750&r2=198749&pathrev=198750
   D http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/ParentNode/prepend-on-document.html?r1=198750&r2=198749&pathrev=198750

Revert of Implement DOM: prepend, append, before, after & replaceWith (patchset #23 id:500001 of https://codereview.chromium.org/1085843002/)

Reason for revert:
I suspect that this caused  Issue 509461 .

Original issue's description:
> Implement DOM: prepend, append, before, after & replaceWith
> 
> As per https://dom.spec.whatwg.org/#childnode ChildNode interface
> should contain before(), after() and replaceWith() API.
> 
> As per https://dom.spec.whatwg.org/#parentnode ParentNode interface
> should contain prepend(), append() API.
> 
> Intent to Implement and ship link: https://groups.google.com/a/chromium.org/forum/#!searchin/blink-dev/paritosh/blink-dev/efUPtYm1PP8/MGoTi17AYpcJ
>  
> BUG= 255482 
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=198629

TBR=haraken@chromium.org,tkent@chromium.org,philipj@opera.com,paritosh.in@samsung.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 255482 

Review URL: https://codereview.chromium.org/1234813003
-----------------------------------------------------------------

Comment 14 by stepien....@gmail.com, Jul 30 2015

Any news on this getting implemented back again?

Comment 15 by dominicc@chromium.org, Jul 31 2015

Cc: phil...@opera.com
Status: Available
Paritosh, are you still working on this?

Comment 16 by paritosh...@samsung.com, Aug 10 2015

Apologize for too delay in response.
Till now, I'm unable to reproduce that issue on my linux build.

One more thing, Test cases given in https://code.google.com/p/chromium/issues/detail?id=509461 are not using any of these 5 APIs.

Comment 17 by eor...@gmail.com, Aug 20 2015

How come `before` and `after` don't accept HTML Strings? So that I can do:

document.body.firstElementChild.after('<p>Hello World</p>');

and have a paragraph element be appended?

Comment 18 by stepien....@gmail.com, Aug 20 2015

Strings are turned into text nodes.
Try this instead: https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentHTML

Comment 19 by eor...@gmail.com, Aug 20 2015

I'm aware of that method, but still'd be nice to have it parse the HTML strings. The methods are much better than a string argument determining where to insert the HTML

Comment 20 by phistuck@gmail.com, Aug 20 2015

@eor -
You should really move this question and discussion to the standards body, as this issue is about implementing the standard.
http://lists.w3.org/Archives/Public/public-whatwg-archive/
http://discourse.wicg.io/

Comment 21 by phil...@opera.com, Aug 20 2015

More specifically, the place to file DOM spec bugs is https://github.com/whatwg/dom/issues/new

Comment 22 by stepien....@gmail.com, Oct 2 2015

Could any dev try and land this once again?

Comment 23 by phil...@opera.com, Oct 2 2015

Paritosh, even if you haven't been able to reproduce the problem I'm pretty sure I know where the problem was, if you upload a new review I can point it out so this can land again.

Comment 24 by paritosh...@samsung.com, Oct 5 2015

Thanks Philip for looking into this, sorry I'm unable to reproduce this issue till now.
I have uploaded the same change here, https://codereview.chromium.org/1375153006/.

Comment 25 by tkent@chromium.org, Oct 13 2015

Status: Started

Comment 26 by stepien....@gmail.com, Oct 21 2015

Has the work on this stalled? No update in the review for two weeks now.
I'd love to help but I'm crap at C++.

Comment 27 by sigbjo...@opera.com, Feb 19 2016

Cc: paritosh...@samsung.com
Owner: ----
Status: Available (was: Started)
No activity, moving this back to Available.

Comment 28 by tkent@chromium.org, Apr 27 2016

Labels: -Pri-2 Hotlist-Interop Pri-3

Comment 29 by jaffathe...@gmail.com, Apr 29 2016

To clarify the interop - this is in Safari & Firefox nightlifes.

Comment 31 by bugdroid1@chromium.org, May 3 2016

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a

commit c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a
Author: sigbjornf <sigbjornf@opera.com>
Date: Tue May 03 11:07:28 2016

Implement DOM methods: prepend, append, after, before and replaceWith.

As per https://dom.spec.whatwg.org/#childnode ChildNode interface
should contain after(), before() and replaceWith() API.

As per https://dom.spec.whatwg.org/#parentnode ParentNode interface
should contain append(), prepend() API.

Intent to Implement and ship link: https://groups.google.com/a/chromium.org/forum/#!searchin/blink-dev/paritosh/blink-dev/efUPtYm1PP8/MGoTi17AYpcJ

( From paritosh.in@samsung.com's original CL https://codereview.chromium.org/1085843002 )

R=mkwst
BUG= 255482 

Review-Url: https://codereview.chromium.org/1934123002
Cr-Commit-Position: refs/heads/master@{#391196}

[add] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/LayoutTests/fast/dom/ChildNode/after.html
[add] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/LayoutTests/fast/dom/ChildNode/before.html
[add] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/LayoutTests/fast/dom/ChildNode/replace-with.html
[add] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/LayoutTests/fast/dom/ParentNode/append-on-document.html
[add] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/LayoutTests/fast/dom/ParentNode/append.html
[add] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/LayoutTests/fast/dom/ParentNode/prepend-on-document.html
[add] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/LayoutTests/fast/dom/ParentNode/prepend.html
[modify] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/interfaces-expected.txt
[delete] https://crrev.com/b117aeb58feecd7f1ba5953afb257e256eb84bb0/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/ChildNode-after-expected.txt
[delete] https://crrev.com/b117aeb58feecd7f1ba5953afb257e256eb84bb0/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/ChildNode-before-expected.txt
[delete] https://crrev.com/b117aeb58feecd7f1ba5953afb257e256eb84bb0/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/ChildNode-replaceWith-expected.txt
[delete] https://crrev.com/b117aeb58feecd7f1ba5953afb257e256eb84bb0/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/ParentNode-append-expected.txt
[delete] https://crrev.com/b117aeb58feecd7f1ba5953afb257e256eb84bb0/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/ParentNode-prepend-expected.txt
[delete] https://crrev.com/b117aeb58feecd7f1ba5953afb257e256eb84bb0/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/append-on-Document-expected.txt
[delete] https://crrev.com/b117aeb58feecd7f1ba5953afb257e256eb84bb0/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/prepend-on-Document-expected.txt
[delete] https://crrev.com/b117aeb58feecd7f1ba5953afb257e256eb84bb0/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/nodes/remove-unscopable-expected.txt
[modify] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt
[modify] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/Source/core/dom/ChildNode.h
[modify] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/Source/core/dom/ChildNode.idl
[modify] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/Source/core/dom/Node.h
[modify] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/Source/core/dom/ParentNode.h
[modify] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/Source/core/dom/ParentNode.idl
[modify] https://crrev.com/c5fb1b6a7e7fc6eccd8355211c43cb6396f86d9a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in

Comment 32 by paritosh@chromium.org, May 6 2016

Cc: -paritosh...@samsung.com paritosh@chromium.org

Comment 33 by tkent@chromium.org, May 16 2016

Labels: M-52
Owner: sigbjo...@opera.com
Status: Fixed (was: Available)

Comment 34 by sigbjo...@opera.com, Jul 28 2016

Blocking: 632273

Comment 36 by bugdroid1@chromium.org, Sep 15 2017

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1b9f15ae514d8b073002d9b3e1d4060d627a2d29

commit 1b9f15ae514d8b073002d9b3e1d4060d627a2d29
Author: ericwilligers <ericwilligers@chromium.org>
Date: Fri Sep 15 03:13:04 2017

DOM: Retire runtime flag DOMConvenienceAPI

The ParentNode methods (prepend, append) and the ChildNode methods
(before, after, replaceWith) shipped in Chrome 52 or 54
https://www.chromestatus.com/feature/5723067795898368
https://bugs.chromium.org/p/chromium/issues/detail?id=632273

The runtime flag is no longer needed.

BUG= 255482 

Change-Id: I4f0d555e0a8e402966f25a2d188a387593083fd3
Reviewed-on: https://chromium-review.googlesource.com/663109
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Ojan Vafai <ojan@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502148}
[modify] https://crrev.com/1b9f15ae514d8b073002d9b3e1d4060d627a2d29/third_party/WebKit/Source/core/dom/ChildNode.idl
[modify] https://crrev.com/1b9f15ae514d8b073002d9b3e1d4060d627a2d29/third_party/WebKit/Source/core/dom/ParentNode.idl
[modify] https://crrev.com/1b9f15ae514d8b073002d9b3e1d4060d627a2d29/third_party/WebKit/Source/platform/runtime_enabled_features.json5

Sign in to add a comment