WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
149073
ChildNode.replaceWith() without argument should replace the node with an empty DocumentFragment
https://bugs.webkit.org/show_bug.cgi?id=149073
Summary
ChildNode.replaceWith() without argument should replace the node with an empt...
Chris Dumez
Reported
2015-09-11 14:22:11 PDT
ChildNode.replaceWith() without argument should replace the node with an empty DocumentFragment, as per the specification:
https://dom.spec.whatwg.org/#dom-childnode-replacewith
https://dom.spec.whatwg.org/#converting-nodes-into-a-node
Currently, WebKit does not do anything in this case (no-op).
Attachments
Patch
(7.76 KB, patch)
2015-09-11 14:30 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2015-09-11 14:22:25 PDT
rdar://problem/22547801
Chris Dumez
Comment 2
2015-09-11 14:30:25 PDT
Created
attachment 261016
[details]
Patch
Ryosuke Niwa
Comment 3
2015-09-11 14:52:25 PDT
Comment on
attachment 261016
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=261016&action=review
> Source/WebCore/ChangeLog:17 > + No new tests, already covered by existing test.
Does this match behaviors of other browsers?
Chris Dumez
Comment 4
2015-09-11 14:58:56 PDT
(In reply to
comment #3
)
> Comment on
attachment 261016
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=261016&action=review
> > > Source/WebCore/ChangeLog:17 > > + No new tests, already covered by existing test. > > Does this match behaviors of other browsers?
Other browsers don't seem to implement replaceChild() yet. This is fairly recent I believe.
Chris Dumez
Comment 5
2015-09-11 14:59:36 PDT
(In reply to
comment #4
)
> (In reply to
comment #3
) > > Comment on
attachment 261016
[details]
> > Patch > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=261016&action=review
> > > > > Source/WebCore/ChangeLog:17 > > > + No new tests, already covered by existing test. > > > > Does this match behaviors of other browsers? > > Other browsers don't seem to implement replaceChild() yet. This is fairly > recent I believe.
replaceWith
WebKit Commit Bot
Comment 6
2015-09-12 10:34:05 PDT
Comment on
attachment 261016
[details]
Patch Clearing flags on attachment: 261016 Committed
r189653
: <
http://trac.webkit.org/changeset/189653
>
WebKit Commit Bot
Comment 7
2015-09-12 10:34:10 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 8
2015-09-16 10:32:20 PDT
Comment on
attachment 261016
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=261016&action=review
> Source/WebCore/dom/Node.cpp:564 > + if (ec) > return;
Not new, but this code is wrong. It’s not the caller’s responsibility to set ec to zero. The caller might not set it at all if it doesn’t plan to look at it. That means that ec might be non-zero when this function is called, and convertNodesOrStringsIntoNode might not touch it, so checking it is not right. Someone has to set ec to 0 if they are going to be checking it after the fact. So either Node::replaceWith or convertNodesOrStringsIntoNode needs to set ec to zero. This error seems to be repeated in multiple functions in this file.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug