Closed
Bug 1334831
Opened 8 years ago
Closed 8 years ago
Use .remove() instead of .parentNode.removeChild
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
FIXED
Firefox 54
Tracking | Status | |
---|---|---|
firefox54 | --- | fixed |
People
(Reporter: florian, Assigned: florian)
References
(Depends on 1 open bug)
Details
Attachments
(4 files)
(deleted),
text/plain
|
Details | |
(deleted),
patch
|
jaws
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jaws
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jaws
:
review+
|
Details | Diff | Splinter Review |
ChildNode.remove() was implemented in bug 856629 for Firefox 23.
Assignee | ||
Comment 1•8 years ago
|
||
removeChild returns the removed node, whereas remove() doesn't return anything. We had only one place in the tree depending on this return value, and it's in a test that can easily be simplified.
Attachment #8831468 -
Flags: review?(jaws)
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → florian
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•8 years ago
|
||
Attachment #8831469 -
Flags: review?(jaws)
Assignee | ||
Comment 3•8 years ago
|
||
I had to leave some files unmodified to avoid test failures.
These use the incomplete DOM API implemented in JSDOMParser.js:
- toolkit/components/reader/Readability.js
- toolkit/components/reader/JSDOMParser.js
remove() doesn't seem to work on <option> elements:
- dom/html/test/test_bug394700.html
I intend to file bugs on these 2 issues in the relevant components, and attach in these bugs the patches doing the replacements in these files.
Attachment #8831470 -
Flags: review?(jaws)
Assignee | ||
Comment 4•8 years ago
|
||
Updated•8 years ago
|
Attachment #8831468 -
Flags: review?(jaws) → review+
Updated•8 years ago
|
Attachment #8831469 -
Flags: review?(jaws) → review+
Comment 5•8 years ago
|
||
Comment on attachment 8831470 [details] [diff] [review]
script-generated patch
Review of attachment 8831470 [details] [diff] [review]:
-----------------------------------------------------------------
rs=me
Attachment #8831470 -
Flags: review?(jaws) → review+
Assignee | ||
Comment 6•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/5d95649edd01cee9bf502db4a7b07de0f965f49f
Bug 1334831 - Make the printpreview_bug396024_helper.xul test not depend on the removeChild return value, r=jaws.
https://hg.mozilla.org/integration/mozilla-inbound/rev/cbe16a8a26150a0469177a50e08f090146d2afbe
Bug 1334831 - add an eslint rule to report usage of .parentNode.removeChild when .remove() could be used instead, r=jaws.
https://hg.mozilla.org/integration/mozilla-inbound/rev/a9d172aa441447396884068a7d01561843cdf596
Bug 1334831 - script-generated patch to use .remove() instead of .parentNode.removeChild, r=jaws.
Comment 7•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5d95649edd01
https://hg.mozilla.org/mozilla-central/rev/cbe16a8a2615
https://hg.mozilla.org/mozilla-central/rev/a9d172aa4414
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox54:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 54
Comment 8•8 years ago
|
||
(In reply to Carsten Book [:Tomcat] from comment #7)
> https://hg.mozilla.org/mozilla-central/rev/a9d172aa4414
Looks like this didn't get upstreamed :(
Flags: needinfo?(jonas.jenwald)
Assignee | ||
Comment 9•8 years ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM] from comment #8)
> (In reply to Carsten Book [:Tomcat] from comment #7)
> > https://hg.mozilla.org/mozilla-central/rev/a9d172aa4414
>
> Looks like this didn't get upstreamed :(
See https://github.com/mozilla/pdf.js/issues/8008
Comment 10•8 years ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM] from comment #8)
> (In reply to Carsten Book [:Tomcat] from comment #7)
> > https://hg.mozilla.org/mozilla-central/rev/a9d172aa4414
>
> Looks like this didn't get upstreamed :(
Initially it was easiest to not upstream that, as discussed in https://github.com/mozilla/pdf.js/issues/8008, since there's issues with cross-browser support for ChildNode.remove().
However, given your comment, it seemed that this issue might continue to come up. Hence I decided to look at this once more, and it turned out that it wasn't actually too difficult to polyfill ChildNode.remove(), so these changes were upstreamed in PR https://github.com/mozilla/pdf.js/pull/8056 (which is included in the latest patch in bug 1338395).
Flags: needinfo?(jonas.jenwald)
You need to log in
before you can comment on or make changes to this bug.
Description
•