Read the XUL flexbox attributes on XUL elements in CSS flexbox when layout.css.emulate-moz-box-with-flex is set
Categories
(Core :: Layout: Flexbox, enhancement, P3)
Tracking
()
People
(Reporter: bgrins, Assigned: enndeakin)
References
Details
Attachments
(2 files, 6 obsolete files)
Comment 2•7 years ago
|
||
| Reporter | ||
Comment 3•7 years ago
|
||
Updated•7 years ago
|
| Assignee | ||
Comment 4•6 years ago
|
||
| Assignee | ||
Comment 5•6 years ago
|
||
| Reporter | ||
Comment 6•6 years ago
|
||
I went ahead and applied this locally, and did a few of try pushes (will take a while for results):
- Talos push with pref flipped (baseline is without pref flipped): https://treeherder.mozilla.org/perf.html#/compare?originalProject=try&originalRevision=03d8d0286112d5869f6c48f2ad26c627cb40a7b4&newProject=try&newRevision=bf30e2ca6295471b621977a7bf87efc8da05954e&framework=1&showOnlyImportant=1
- Talos push with pref flipped (baseline is with pref also flipped but patch not applied): https://treeherder.mozilla.org/perf.html#/compare?originalProject=try&originalRevision=&newProject=try&newRevision=bf30e2ca6295471b621977a7bf87efc8da05954e&framework=1&showOnlyImportant=1
- Try push with -u all and pref flipped: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f14bdfb430f9a842a4c930dfc5b0d3facddd7315
| Reporter | ||
Comment 7•6 years ago
|
||
And:
4. Try push with -u all and pref flipped (with this patch not applied): https://treeherder.mozilla.org/#/jobs?repo=try&revision=d24d72198dc3c3d25cc40c6c6c8b5ea23d13cb5a
| Reporter | ||
Comment 8•6 years ago
|
||
Uploading a screenshot before/after this patch
| Reporter | ||
Comment 9•6 years ago
|
||
A couple of issues I see with the patch applied:
- The "Search with" text in url bar is centered
- The content area is shorter than the window height
It's possible (2) is related to the special rules we have for <browser> https://searchfox.org/mozilla-central/rev/152993fa346c8fd9296e4cd6622234a664f53341/toolkit/content/xul.css#167 (I haven't checked). Here's all the special CSS rules we use when in emulation mode: https://searchfox.org/mozilla-central/search?q=moz-bool-pref%28%22layout.css.emulate-moz-box-with-flex%22%29&path=
| Reporter | ||
Comment 10•6 years ago
|
||
(In reply to Brian Grinstead [:bgrins] from comment #9)
Created attachment 9041232 [details]
with-patch-emulation.pngA couple of issues I see with the patch applied:
- The "Search with" text in url bar is centered
This can be fixed by increasing moz-box-flex at https://searchfox.org/mozilla-central/rev/ddd1679c0534f7ddf36cafddd17b710c4fefe3c4/toolkit/themes/osx/global/textbox.css#27, but this may be highlighting a bug with emulation or with the patch, since the sibling node (.urlbar-scheme) is an HTML input element with position:absolute.
Comment 11•6 years ago
•
|
||
| Assignee | ||
Comment 12•6 years ago
|
||
| Reporter | ||
Comment 13•6 years ago
|
||
(In reply to Neil Deakin from comment #12)
Comment on attachment 9040484 [details] [diff] [review]
Support attributes in flexThe patch above is quite outdated, so please don't spend time looking at it
right now. I'll be back next week and can provide a better version.
Any progress here? I'd like to test out the new version when it's ready.
| Assignee | ||
Comment 14•6 years ago
|
||
This is a rollup patch that contains many of the changes so far. Some fixes above the earlier patch:
- Fixes the size of the browser content area and alignment in the url bar by not checking flex for anonymous items.
- Fixes trees by using a minimum size instead of a fixed size.
- Enables the emulated pref by default for easy testing.
- Checks width/height for splitter and resizer. Splitter does not yet work as it expects it siblings to returns something useful for XUL layout methods. Resizer works ok.
- Treats some emulated flexbox frames as being xul box frames as some callers expect this. Some of this isn't right but will be fixed up later.
- Menupopups inherit from FlexContainerFrame and uses flexbox layout. Mostly this works but scrolling does not.
| Assignee | ||
Comment 15•6 years ago
|
||
Some other pieces not included above as they are in various states of disarray and/or completion:
- Getting splitter to work
- Some hacks to get menus to scroll when a maximum height is set on the menupopup
- Converting stacks/decks to use flexbox layout
Scrolling is a noteable issue. CSS generally only constrains the container (allowing scrolling) when a height is explicitly specified and just lets containers overflow when their contents are too large, whereas XUL layout will stretch flexible children to make them fit inside. For example:
<menupopup style="height: 100px">
<arrowscrollbox flex="1">
<scrollbox style="overflow: auto" flex="1">...</scrollbox>
<arrowscrollbox>
<menupopup>
In XUL layout, this creates a 100 pixel high menu with a scrollbox constrained to 100 pixels as the child is flexible. But in CSS layout, the scrollbox just extends outside its container.
This and related issues affects scrolling menus, as well as prevents scrollbars in the Preferences pane, and makes the page info window too large as the permissions pane won't shrink down.
| Assignee | ||
Comment 16•6 years ago
|
||
| Assignee | ||
Comment 17•6 years ago
|
||
Depends on D31097
| Assignee | ||
Comment 18•6 years ago
|
||
| Assignee | ||
Comment 19•6 years ago
|
||
The three patches here implement getting attributes. The two followup bugs fix some issues with trees and menus.
| Reporter | ||
Updated•6 years ago
|
| Assignee | ||
Updated•6 years ago
|
Comment 20•6 years ago
|
||
Neil: I am happy to address the review comments myself (requesting review from someone else wherever I'm changing something substantial) & shepherd this patch stack in, but there were several places where I didn't understand something about the changes.
Would you mind going through the phabricator feedback and replying to the non-trivial issues there, with any background/explanation that you can recall? I'm happy to take it from there.
Comment 21•5 years ago
|
||
Update: I'd been meaning to get to this and address my own review feedback, but haven't gotten to that yet (and I'm about to disappear for ~1 month for parental leave).
From conversations in slack & on other bugs with ntim and bgrins, I think (?) it's possible we might not actually need this patch stack anymore, too, but I might have misunderstood.
Anyway -- I'll plan on checking in with bgrins when I'm back from leave and seeing where things stand.
| Reporter | ||
Comment 22•5 years ago
|
||
(In reply to Daniel Holbert [:dholbert] (blocking needinfo/review, due to AFK on parental leave 12/9 - 1/6) from comment #21)
Update: I'd been meaning to get to this and address my own review feedback, but haven't gotten to that yet (and I'm about to disappear for ~1 month for parental leave).
From conversations in slack & on other bugs with ntim and bgrins, I think (?) it's possible we might not actually need this patch stack anymore, too, but I might have misunderstood.
Anyway -- I'll plan on checking in with bgrins when I'm back from leave and seeing where things stand.
Yes, we are planning to stop relying on the attributes being read from layout and elsewhere as part of Bug 1596497 (which should handle both flexbox emulation and migration to HTML elements).
I suspect that there are parts of this stack or dependent bugs that are still important for emulated flexbox (like removing calls to nsIFrame::IsXULBoxFrame / GetChildXULBox and handling style.width/height on resizer), but I don't know exactly what is still relevant. Revisiting this when you are back sounds good, thanks.
Updated•3 years ago
|
Comment 23•2 years ago
|
||
We ported these to use regular style attributes etc.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Description
•