Closed
Bug 1474340
Opened 6 years ago
Closed 6 years ago
Remove toolbar.toolbox XBL property and update its consumers
Categories
(Firefox :: Toolbars and Customization, task, P3)
Firefox
Toolbars and Customization
Tracking
()
RESOLVED
FIXED
Firefox 64
People
(Reporter: Gijs, Assigned: mconley)
References
Details
(Whiteboard: [lang=js])
Attachments
(1 file)
With the goal of eventually removing the toolbar.xml toolbar binding from CustomizableUI, we're slowly removing parts of the binding.
In this bug, we should:
- remove https://dxr.mozilla.org/mozilla-central/rev/085cdfb90903d4985f0de1dc7786522d9fb45596/browser/components/customizableui/content/toolbar.xml#92-112
- remove https://dxr.mozilla.org/mozilla-central/rev/085cdfb90903d4985f0de1dc7786522d9fb45596/browser/components/customizableui/content/toolbar.xml#179-190
- replace the code at https://dxr.mozilla.org/mozilla-central/rev/085cdfb90903d4985f0de1dc7786522d9fb45596/browser/components/customizableui/content/toolbar.xml#22 with:
let toolbox = this.closest("toolbox");
- remove https://dxr.mozilla.org/mozilla-central/source/browser/components/customizableui/CustomizableUI.jsm#1006
- go through browser/components/customizableui/CustomizableUI.jsm, and wherever we use the `.toolbox` property on an area node, instead reuse a local variable or argument pointing to `window`, or use node.ownerGlobal, to get a reference to `window.gNavToolbox` for the window in which the areaNode is present.
I *think* that should be enough. When fixing this bug, we should run the tests from:
./mach mochitest browser/components/customizableui/
(after rebuilding) to make sure we don't break anything.
Updated•6 years ago
|
Blocks: war-on-xbl
Updated•6 years ago
|
Assignee: nobody → 1991manish.kumar
Comment 1•6 years ago
|
||
What exactly I should write?
Can you tell about this case?
https://dxr.mozilla.org/mozilla-central/source/browser/components/customizableui/CustomizableUI.jsm#856
> - go through browser/components/customizableui/CustomizableUI.jsm, and
> wherever we use the `.toolbox` property on an area node, instead reuse a
> local variable or argument pointing to `window`, or use node.ownerGlobal, to
> get a reference to `window.gNavToolbox` for the window in which the areaNode
> is present.
Flags: needinfo?(gijskruitbosch+bugs)
Reporter | ||
Comment 2•6 years ago
|
||
(In reply to Manish Kumar [:manishkk] from comment #1)
> What exactly I should write?
>
> Can you tell about this case?
> https://dxr.mozilla.org/mozilla-central/source/browser/components/
> customizableui/CustomizableUI.jsm#856
>
> > - go through browser/components/customizableui/CustomizableUI.jsm, and
> > wherever we use the `.toolbox` property on an area node, instead reuse a
> > local variable or argument pointing to `window`, or use node.ownerGlobal, to
> > get a reference to `window.gNavToolbox` for the window in which the areaNode
> > is present.
So in this particular case, the existing code does:
let palette = aAreaNode.toolbox ? aAreaNode.toolbox.palette : null;
so you could do:
let toolbox = aAreaNode.ownerGlobal.gNavToolbox || null;
let palette = toolbox ? toolbox.palette : null;
In e.g. https://dxr.mozilla.org/mozilla-central/rev/085cdfb90903d4985f0de1dc7786522d9fb45596/browser/components/customizableui/CustomizableUI.jsm#1077 there is already a local variable `window`, so you can just replace:
areaNode.toolbox.palette.appendChild(widgetNode);
with
window.gNavToolbox.palette.appendChild(widgetNode);
And so on along the rest of the file. This is because `window` and `areaNode.ownerGlobal` point to the same object, and `window.gNavToolbox` will always point to the same thing that `areaNode.toolbox` points to right now. Does that make sense?
Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(1991manish.kumar)
Reporter | ||
Comment 3•6 years ago
|
||
Hey Manish, do you need more help with this? Let me know on bugzilla if something's not clear. Thanks for working on this!
Updated•6 years ago
|
Assignee: 1991manish.kumar → nobody
Flags: needinfo?(1991manish.kumar)
Comment 4•6 years ago
|
||
hey, Can i work on this? I am beginner.
Reporter | ||
Comment 5•6 years ago
|
||
(In reply to akshitsoni0000 from comment #4)
> hey, Can i work on this? I am beginner.
I think as your first bug this is probably a bit tricky. Try looking for bugs that are marked 'good-first-bug' instead. I saw your comment on bug 1423843 - that might be an easier bug to get started on.
Assignee | ||
Comment 6•6 years ago
|
||
This is blocking my work in bug 1356920, so I'll do this.
Assignee: nobody → mconley
Mentor: gijskruitbosch+bugs
Assignee | ||
Comment 7•6 years ago
|
||
Reporter | ||
Comment 8•6 years ago
|
||
Comment on attachment 9009744 [details]
Bug 1474340 - Remove toolbox XBL property from toolbar. r?Gijs
:Gijs (he/him) has approved the revision.
Attachment #9009744 -
Flags: review+
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/12dcd7c35b36
Remove toolbox XBL property from toolbar. r=Gijs
Comment 10•6 years ago
|
||
Backed out changeset 12dcd7c35b36 (bug 1474340) for ESlint failure
push that caused the backout: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&classifiedState=unclassified&selectedJob=199949216&revision=12dcd7c35b36a48d8a1e101255df15b9112157eb
failure: https://treeherder.mozilla.org/#/jobs?repo=autoland&fromchange=b26a70a0fe8f22ee4a5118c7c563ab98a115e692&selectedJob=199946963&searchStr=linting%2Copt%2Csource-test-mozlint-eslint%2C%28es%29
backout: https://hg.mozilla.org/integration/autoland/rev/941266ad9f8f4093f5de294955ffabe67fcb1e08
Flags: needinfo?(mconley)
Comment 11•6 years ago
|
||
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e1c0d8cbad37
Remove toolbox XBL property from toolbar. r=Gijs
Assignee | ||
Updated•6 years ago
|
Flags: needinfo?(mconley)
Comment 12•6 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 64
Updated•6 years ago
|
Updated•6 years ago
|
Type: enhancement → task
You need to log in
before you can comment on or make changes to this bug.
Description
•