Bug 147302
Summary: | Web Inspector: Start using Node.prototype.before | ||
---|---|---|---|
Product: | WebKit | Reporter: | Nikita Vasilyev <nvasilyev> |
Component: | Web Inspector | Assignee: | Nikita Vasilyev <nvasilyev> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=147301 |
Nikita Vasilyev
https://bugs.webkit.org/show_bug.cgi?id=74648 introduced Node.prototype.append, among a few other DOM methods.
Convert the following code:
refElem.parendNode.insertBefore(newElem, refElem)
to
refElem.before(newElem)
However, we can't safely convert all occurrences of "insertBefore" to "before".
baseElem.insertBefore(newElem, refElem)
refElem could be a null here. refElem.before(newElem) would cause an error.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/22000400>
Nikita Vasilyev
I have found only one instance that satisfier the following requirement:
elemA.parentElement.insertBefore(highlightNode, elemA);
\ /
\------------------ same elements ------------/
https://github.com/WebKit/webkit/blob/981bae9952b1f312b89d362fd39768c075408669/Source/WebInspectorUI/UserInterface/Base/Main.js#L1990
Probably doesn't worth a patch.