Prepare sidebar CSS and rendering for the new macOS vibrancy implementation
Categories
(Firefox :: Theme, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox79 | --- | fixed |
People
(Reporter: mstange, Assigned: mstange)
References
Details
Attachments
(3 files)
Bug 1592739 will change vibrancy so that it only works if nothing is rendered behind the vibrant element. To make this work properly with the browser sidebars, both in lwtheme mode and without, we need some changes.
Assignee | ||
Comment 1•4 years ago
|
||
This is needed because under the new vibrancy model, vibrant -moz-appearance
values only work on elements that have nothing rendered behind them. The elements
with the vibrant appearance become truly transparent.
Assignee | ||
Comment 2•4 years ago
|
||
When a tree row in the sidebar is selected, the background of that selected row
is styled with -moz-appearance: -moz-mac-(active-)source-list-selection
.
We have two ways of rendering such selections:
- With vibrancy, on 10.10+ if the sidebar itself uses vibrancy, and
- With a solid fill, on 10.9 or if the sidebar itself does not use vibrancy.
In the Firefox main browser window, sidebar styling crosses document boundaries.
<hbox id="browser">
<vbox id="sidebar-box"> <-- this one has -moz-appearance: -moz-mac-source-list (or not)
<browser> (bookmarksSidebar.xhtml or historySidebar.xhtml)
<window>
<tree> <-- this contains the tree body frame which renders the tree contents,
including the selection backgrounds
We detect whether "the sidebar itself uses vibrancy" by walking up the frame tree
and looking for a frame with -moz-appearance: -moz-mac-source-list
.
In the past, this lookup was inconsistent between nsTreeBodyFrame.cpp and theme rendering,
and it stopped at document boundaries. This patch makes the implementations more
consistent and allows it to cross document boundaries.
The old code only worked with the given DOM structure because -moz-appearance: -moz-mac-source-list
was repeated on the <tree> element. I'd like to remove that duplication.
The new code works correctly if -moz-appearance: -moz-mac-source-list
is only set
on <vbox id="sidebar-box"> and not repeated on the tree.
Depends on D51465
Assignee | ||
Comment 3•4 years ago
|
||
This -moz-appearance is already set on #sidebar-box, in the main browser document.
Furthermore, we don't want to set the -moz-appearance when lwthemes are used, and
(as far as I can tell) we cannot detect lwtheme usage with :-moz-lwtheme in the
nested documents (bookmarksSidebar.xhtml, historySidebar.xhtml, syncedtabs/sidebar.xhtml).
Depends on D78924
Comment 5•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/81cffaeae7f6
https://hg.mozilla.org/mozilla-central/rev/fad8f87c1f8f
https://hg.mozilla.org/mozilla-central/rev/6f6757bfd329
Description
•