Closed
Bug 1420990
Opened 7 years ago
Closed 7 years ago
Remove the preference 'container' XBL binding and instead build the DOM directly in gContainersPane._rebuildView
Categories
(Firefox :: Settings UI, task, P3)
Firefox
Settings UI
Tracking
()
RESOLVED
FIXED
Firefox 61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: bgrins, Assigned: bgrins)
References
Details
Attachments
(1 file)
There's a binding "container" in the prefs UI that adds content inside a richlistitem in about:preferences#containers
- https://dxr.mozilla.org/mozilla-central/rev/da90245d47b17c750560dedb5cbe1973181166e3/browser/components/preferences/handlers.xml#74-95
- https://dxr.mozilla.org/mozilla-central/rev/da90245d47b17c750560dedb5cbe1973181166e3/browser/components/preferences/handlers.css#13-15
The richlist item is created here:
https://dxr.mozilla.org/mozilla-central/rev/da90245d47b17c750560dedb5cbe1973181166e3/browser/components/preferences/in-content/containers.js#29-43
Because it uses entities it's causing some extra work in Bug 1419547. But since it's only adding content, I suspect that the DOM can be built directly in containers.js as an alternative.
Updated•7 years ago
|
Updated•7 years ago
|
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Updated•7 years ago
|
Assignee: nobody → bgrinstead
Priority: -- → P5
Updated•7 years ago
|
Status: NEW → ASSIGNED
Updated•7 years ago
|
Priority: P5 → P4
Updated•7 years ago
|
Priority: P4 → P3
Assignee | ||
Updated•7 years ago
|
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 5•7 years ago
|
||
Comment on attachment 8932161 [details]
Bug 1420990 - Build the DOM for container items directly in containers.js instead of with XBL;
I don't love the extra verbosity here. I wish we had some way other that innerHTML to be more declarative with how the markup will be in JS - going to look into that for when we start shipping Custom Elements in chrome.
But IMO it ends up more straightforward with the change (due to no more attribute mapping via `inherits` and no <children> in XBL), and it gets rid of one more binding. Let me know if you have ideas on how to make this better.
Attachment #8932161 -
Flags: review?(jaws)
Comment 6•7 years ago
|
||
mozreview-review |
Comment on attachment 8932161 [details]
Bug 1420990 - Build the DOM for container items directly in containers.js instead of with XBL;
https://reviewboard.mozilla.org/r/203204/#review240866
::: browser/components/preferences/in-content/containers.js:35
(Diff revision 4)
> + let outer = document.createElement("hbox");
> + outer.setAttribute("flex", 1);
> + outer.setAttribute("equalsize", "always");
> + item.appendChild(outer);
> +
> + let inner = document.createElement("hbox");
> + inner.setAttribute("flex", 1);
> + inner.setAttribute("align", "center");
> + outer.appendChild(inner);
You might want to look into combining outer with inner to simplify the markup. It would make it less verbose.
I used bug 1437230 as an opportunity to also simplify the markup there too.
Comment 7•7 years ago
|
||
mozreview-review |
Comment on attachment 8932161 [details]
Bug 1420990 - Build the DOM for container items directly in containers.js instead of with XBL;
https://reviewboard.mozilla.org/r/203204/#review241874
Attachment #8932161 -
Flags: review?(jaws) → review+
Assignee | ||
Comment 8•7 years ago
|
||
mozreview-review |
Comment on attachment 8932161 [details]
Bug 1420990 - Build the DOM for container items directly in containers.js instead of with XBL;
https://reviewboard.mozilla.org/r/203204/#review241886
::: browser/components/preferences/in-content/containers.js:35
(Diff revision 4)
> + let outer = document.createElement("hbox");
> + outer.setAttribute("flex", 1);
> + outer.setAttribute("equalsize", "always");
> + item.appendChild(outer);
> +
> + let inner = document.createElement("hbox");
> + inner.setAttribute("flex", 1);
> + inner.setAttribute("align", "center");
> + outer.appendChild(inner);
Good point. I checked locally and moving `align=center` up to outer and removing `equalsize=always` then removing `inner` renders the same
Comment hidden (mozreview-request) |
Comment 10•7 years ago
|
||
mozreview-review |
Comment on attachment 8932161 [details]
Bug 1420990 - Build the DOM for container items directly in containers.js instead of with XBL;
https://reviewboard.mozilla.org/r/203204/#review241896
::: browser/components/preferences/handlers.css:9
(Diff revision 5)
> #containersView > richlistitem {
> - -moz-binding: url("chrome://browser/content/preferences/handlers.xml#container");
> + -moz-binding: none;
> }
You can avoid this by using a vbox/hbox instead.
Assignee | ||
Comment 11•7 years ago
|
||
(In reply to Tim Nguyen :ntim from comment #10)
> Comment on attachment 8932161 [details]
> Bug 1420990 - Build the DOM for container items directly in containers.js
> instead of with XBL;
>
> https://reviewboard.mozilla.org/r/203204/#review241896
>
> ::: browser/components/preferences/handlers.css:9
> (Diff revision 5)
> > #containersView > richlistitem {
> > - -moz-binding: url("chrome://browser/content/preferences/handlers.xml#container");
> > + -moz-binding: none;
> > }
>
> You can avoid this by using a vbox/hbox instead.
I thought about that, but didn't want to lose any styling or make it inconsistent with other lists in prefs. If we were OK with that we could also turn this into a Custom Element.
Comment 12•7 years ago
|
||
Pushed by bgrinstead@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/19dfac734e3e
Build the DOM for container items directly in containers.js instead of with XBL;r=jaws
Comment 13•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 61
Updated•6 years ago
|
Type: enhancement → task
You need to log in
before you can comment on or make changes to this bug.
Description
•