WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
147304
Web Inspector: Start using Node.prototype.remove
https://bugs.webkit.org/show_bug.cgi?id=147304
Summary
Web Inspector: Start using Node.prototype.remove
Nikita Vasilyev
Reported
2015-07-25 22:10:49 PDT
Convert the following code: refElem.parendNode.removeChild(refElem) to refElem.remove() Note that when refElem.parendNode is null, refElem.remove() is no-op, it doesn't throw any errors.
Attachments
Patch
(5.29 KB, patch)
2015-07-25 22:18 PDT
,
Nikita Vasilyev
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2015-07-25 22:10:59 PDT
<
rdar://problem/22000479
>
Nikita Vasilyev
Comment 2
2015-07-25 22:18:15 PDT
Created
attachment 257529
[details]
Patch
WebKit Commit Bot
Comment 3
2015-07-25 23:32:01 PDT
Comment on
attachment 257529
[details]
Patch Clearing flags on attachment: 257529 Committed
r187405
: <
http://trac.webkit.org/changeset/187405
>
WebKit Commit Bot
Comment 4
2015-07-25 23:32:05 PDT
All reviewed patches have been landed. Closing bug.
Joseph Pecoraro
Comment 5
2015-07-27 15:11:54 PDT
Comment on
attachment 257529
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=257529&action=review
> Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js:1269 > - parentElement.removeChild(self); > + self.remove();
Is this valid? Isn't "self" here a WebInspector.TreeElement, not a DOM Element?
Joseph Pecoraro
Comment 6
2015-07-27 15:46:06 PDT
(In reply to
comment #5
)
> Comment on
attachment 257529
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=257529&action=review
> > > Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js:1269 > > - parentElement.removeChild(self); > > + self.remove(); > > Is this valid? Isn't "self" here a WebInspector.TreeElement, not a DOM > Element?
Yes, although this still works, it works in lucky / poor way. This is inside of remove(), so it calls remove() again asynchronously, and only stops this loop because eventually the actual RemoveChild DOM event would remove this tree element from the parent. Lets fix this.
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