Closed
Bug 1446721
Opened 7 years ago
Closed 6 years ago
Replace parent.removeChild(element) with element.remove() in tabbrowser.js
Categories
(Firefox :: Tabbed Browser, enhancement, P3)
Firefox
Tabbed Browser
Tracking
()
RESOLVED
FIXED
Firefox 62
Tracking | Status | |
---|---|---|
firefox62 | --- | fixed |
People
(Reporter: dao, Assigned: constfilin, Mentored)
Details
(Keywords: good-first-bug, Whiteboard: [lang=js])
Attachments
(1 file)
Instead of parent.removeChild(element), we should use the newer and simpler element.remove():
https://searchfox.org/mozilla-central/search?q=removeChild&case=true®exp=false&path=tabbrowser.js
Reporter | ||
Updated•7 years ago
|
status-firefox61:
affected → ---
Priority: -- → P3
Reporter | ||
Comment 1•7 years ago
|
||
I see there's an eslint rule for this from bug 1334831. Florian, is this not enabled by default or why hasn't it caught this?
Flags: needinfo?(florian)
Comment 2•7 years ago
|
||
(In reply to Dão Gottwald [::dao] from comment #1)
> I see there's an eslint rule for this from bug 1334831. Florian, is this not
> enabled by default or why hasn't it caught this?
Because of the 'parent' temporary variable here. We are rejecting .parentNode.removeChild, and elt.removeChild(elt.firstChild), but there's nothing obviously wrong with var1.removeChild(var2).
Flags: needinfo?(florian)
Comment 3•7 years ago
|
||
Hi, I'm interested in working on this bug. Could you please point me in the right direction to get me started working on it? Thanks!
Reporter | ||
Comment 4•7 years ago
|
||
(In reply to Sophie Helf from comment #3)
> Hi, I'm interested in working on this bug. Could you please point me in the
> right direction to get me started working on it? Thanks!
Hi! Have you built Firefox yet? Have you read how to create a patch? Please let me know how far you got and where you potentially got stuck so I can help effectively.
The file that needs to be changed is browser/base/content/tabbrowser.js and I described in comment 0 what needs to change.
Flags: needinfo?(sophie.helf)
Comment 5•7 years ago
|
||
HI can I work on the bug?
Comment 6•7 years ago
|
||
HI can I work on the bug?
Reporter | ||
Comment 7•7 years ago
|
||
(In reply to akira.jainn2 from comment #6)
> HI can I work on the bug?
Alright! I haven't heard back from Sophie and it looks like Kev is working on bug 1447941.
Assignee: nobody → akira.jainn2
Status: NEW → ASSIGNED
Flags: needinfo?(sophie.helf)
Comment 8•7 years ago
|
||
working on this
Reporter | ||
Comment 9•7 years ago
|
||
(In reply to akira.jainn2 from comment #8)
> working on this
Any update? Please let me know if you need help.
Flags: needinfo?(akira.jainn2)
Reporter | ||
Updated•6 years ago
|
Assignee: akira.jainn2 → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(akira.jainn2)
Assignee | ||
Comment 10•6 years ago
|
||
@dao: can I please get this assigned to myself???
Reporter | ||
Comment 11•6 years ago
|
||
(In reply to constfilin from comment #10)
> @dao: can I please get this assigned to myself???
Sure... Let me know if something isn't clear about what needs to be done in this bug.
Assignee: nobody → constfilin
Comment hidden (mozreview-request) |
Assignee | ||
Comment 13•6 years ago
|
||
Thanks, @dao.
Please review:
submitting 1 changesets for review
changeset: 466557:5891c9ae66d2
summary: Bug 1446721: replacing parent.removeChild(child) with simpler child.remove; r?dao
review: https://reviewboard.mozilla.org/r/244570 (draft)
review id: bz://1446721/mr31415926
review url: https://reviewboard.mozilla.org/r/244568 (draft)
publish these review requests now (Yn)?
(published review request 244568)
Thanks!
Reporter | ||
Comment 14•6 years ago
|
||
mozreview-review |
Comment on attachment 8976425 [details]
Bug 1446721: replacing parent.removeChild(child) with simpler child.remove;
https://reviewboard.mozilla.org/r/244570/#review250614
::: browser/base/content/tabbrowser.js:2135
(Diff revision 1)
> }
>
> aBrowser.destroy();
>
> let notificationbox = this.getNotificationBox(aBrowser);
> - this.tabpanels.removeChild(notificationbox);
> + if( notificationbox ) notificationbox.remove();
Is this null-check really needed? I would think that the browser should always have a notification box at this point. Also, you could get rid of the notificationbox variable:
this.getNotificationBox(aBrowser).remove();
Attachment #8976425 -
Flags: review?(dao+bmo)
Comment hidden (mozreview-request) |
Assignee | ||
Comment 16•6 years ago
|
||
ok, @dao. I made the fix, merged the two commits into a single review using "hg histedit"
Please take a look again at https://reviewboard.mozilla.org/r/244568/
Thanks!
Reporter | ||
Comment 17•6 years ago
|
||
mozreview-review |
Comment on attachment 8976425 [details]
Bug 1446721: replacing parent.removeChild(child) with simpler child.remove;
https://reviewboard.mozilla.org/r/244570/#review250748
Looks good. Thanks!
Attachment #8976425 -
Flags: review?(dao+bmo) → review+
Comment 18•6 years ago
|
||
Pushed by dgottwald@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ed45b1e16eff
replacing parent.removeChild(child) with simpler child.remove; r=dao
Assignee | ||
Comment 19•6 years ago
|
||
Thanks, @dao. Is there anything else I need to do to get this merged and pushed across the finish line?
Comment 20•6 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox62:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 62
Reporter | ||
Comment 21•6 years ago
|
||
(In reply to constfilin from comment #19)
> Thanks, @dao. Is there anything else I need to do to get this merged and
> pushed across the finish line?
Patches are merged automatically from autoland to central unless they cause tests to fail. Everything went smooth in this case. Well done!
You need to log in
before you can comment on or make changes to this bug.
Description
•