getComputedStyle should return an empty style for elements outside the flattened tree
Categories
(Core :: CSS Parsing and Computation, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox96 | --- | fixed |
People
(Reporter: smaug, Assigned: emilio)
References
Details
Attachments
(1 file, 3 obsolete files)
Reporter | ||
Comment 1•6 years ago
|
||
Assignee | ||
Comment 2•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Reporter | ||
Comment 3•6 years ago
|
||
Reporter | ||
Comment 4•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 5•6 years ago
|
||
Reporter | ||
Comment 6•6 years ago
|
||
Reporter | ||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 7•6 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:smaug, could you have a look please?
Reporter | ||
Comment 8•6 years ago
|
||
This landed as part of https://hg.mozilla.org/mozilla-central/rev/16daef3a89a2
Assignee | ||
Comment 9•6 years ago
|
||
The underlying issue (getComputedStyle outside of the flattened tree returning styles) is not fixed though.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 10•3 years ago
|
||
As per spec. This could cause wrong styles to be returned because we
fill the bloom filter based on flat tree ancestors, which was ultimately
the root cause of bug 1737131.
Updated•3 years ago
|
Assignee | ||
Comment 11•3 years ago
|
||
This test was relying on querying the computed style of elements outside
of the tree (which could cause bogus results like bug 1737131).
In this case, it worked out for what the test wanted to assert, but
after the previous patch it no longer does (those elements effectively
do not have styles).
Fix the test in a similar fashion, to make sure we've opened all the
menus at least once so that we hit this code:
and the elements are slotted.
Assignee | ||
Comment 12•3 years ago
|
||
This is a more generic fix for
https://phabricator.services.mozilla.com/D131080 that we might want to
take instead. I'm not aware of other tests triggering the same issue but
this causes behavior to be a bit more predictable.
Context: We have tests that query the style of menupopups/menuitems that
are not in the flat tree (that is, that are children of a shadow host,
but are not slotted). That makes no sense, because the flat tree is how
we determine where to inherit from (so the styles that we were returning
before this bug are wrong, they just happen to work for that particular
test).
Panels and menupopups have some lazy initialization code that before
this patch left a shadow root attached to the element but no slot.
Instead, don't even bother to create a shadow root (and do that lazily
as well). It's a bit more predictable behavior, and is also less work
during startup, so should be a win.
Comment 13•3 years ago
|
||
Comment on attachment 9250608 [details]
Bug 1483798 - Don't make menupopups and panels leave unslotted children. r=Gijs,mconley,bgrins
Revision D131081 was moved to bug 1741089. Setting attachment 9250608 [details] to obsolete.
Comment 14•3 years ago
|
||
Comment 15•3 years ago
|
||
bugherder |
Updated•3 years ago
|
Description
•