InspectorUtils.getCSSStyleRules only returns nested CSSStartingStyleRule rules of rules with selectors using children/descendent combinator in their selectors
Categories
(DevTools :: Inspector, defect, P2)
Tracking
(firefox129 fixed, firefox130 fixed)
People
(Reporter: nchevobbe, Assigned: boris)
References
Details
Attachments
(4 files, 1 obsolete file)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
On data:text/html,<meta charset=utf8><style> html body {background-color: tomato;@starting-style {background-color: gold;}}</style>Hello
, InspectorUtils.getCSSStyleRules
does not return the html body
rule.
I'll add a patch extending https://searchfox.org/mozilla-central/rev/56dd89bcf4d3b85f66621e89eac6e2936ad382d9/layout/inspector/tests/test_getCSSStyleRules_starting_style.html to demonstrate the issue
Reporter | ||
Comment 1•1 year ago
|
||
From my testing, this only applies child and descendant combinators, rules with sibling combinators are returned fine.
Boris, would you know what's happening?
Reporter | ||
Comment 2•1 year ago
|
||
Reporter | ||
Comment 3•1 year ago
|
||
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #0)
I'll add a patch extending https://searchfox.org/mozilla-central/rev/56dd89bcf4d3b85f66621e89eac6e2936ad382d9/layout/inspector/tests/test_getCSSStyleRules_starting_style.html to demonstrate the issue
Assignee | ||
Comment 4•1 year ago
•
|
||
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #1)
From my testing, this only applies child and descendant combinators, rules with sibling combinators are returned fine.
Boris, would you know what's happening?
So looks like this API failed when running something like this:
<style>
div {
width: 100px;
height: 100px;
background-color: green;
transition: background-color 2s linear;
}
@starting-style {
body > div {
background-color: blue;
}
}
</style>
<body>
<div></div>
</body>
The transition works well, but Inspector didn't return the rules inside @starting-style
as the above example. Obviously this is a bug of this API. Let me check the API for more details.
Assignee | ||
Updated•1 year ago
|
Reporter | ||
Comment 5•1 year ago
|
||
Boris, do you think we'll find the culprit before the soft freeze (which is this week, and Firday is wellness day) ?
If not, we should probably disable showing starting-style rules in the Inspector until we get a proper fix. My preference would be to enable this in the same release we ship starting-style in Firefox, but I'd understand if this is a complex bug to figure out.
Assignee | ||
Comment 6•1 year ago
|
||
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #5)
Boris, do you think we'll find the culprit before the soft freeze (which is this week, and Firday is wellness day) ?
If not, we should probably disable showing starting-style rules in the Inspector until we get a proper fix. My preference would be to enable this in the same release we ship starting-style in Firefox, but I'd understand if this is a complex bug to figure out.
Per our slack talk, please feel free to disable showing starting-style rules in Inspector because it's unlikely to resolve this bug before the soft freeze.
Assignee | ||
Comment 7•1 year ago
•
|
||
Oh. I found the reason. I didn't use the correct bloom filter. The bloom filter in this API doesn't take the its ancestor into account, so we fast-rejected the rule with this children combinator.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 8•1 year ago
|
||
Otherwise, we may fast-reject the descendant/child selectors.
Reporter | ||
Comment 9•1 year ago
|
||
Depends on D216130
Updated•1 year ago
|
Updated•1 year ago
|
Comment 10•1 year ago
|
||
Comment 11•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/17ccfaf01595
https://hg.mozilla.org/mozilla-central/rev/77e9230da6a8
Reporter | ||
Comment 12•1 year ago
|
||
Otherwise, we may fast-reject the descendant/child selectors.
Original Revision: https://phabricator.services.mozilla.com/D216130
Updated•1 year ago
|
Reporter | ||
Comment 13•1 year ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D216133
Updated•1 year ago
|
Comment 14•1 year ago
|
||
beta Uplift Approval Request
- User impact if declined: developers won't be able to debug @starting-style rules from their pages, which is unfortunate as we're shipping them in 129
- Code covered by automated testing: yes
- Fix verified in Nightly: no
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: -
- Risk associated with taking this patch: low
- Explanation of risk level: DevTools only change, covered by multiple mochitests
- String changes made/needed: -
- Is Android affected?: no
Comment 15•1 year ago
|
||
beta Uplift Approval Request
- User impact if declined: developers won't be able to debug @starting-style rules from their pages, which is unfortunate as we're shipping them in 129
- Code covered by automated testing: yes
- Fix verified in Nightly: no
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: -
- Risk associated with taking this patch: low
- Explanation of risk level: one line change in DevTools utility, covered by a test
- String changes made/needed: -
- Is Android affected?: no
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 16•1 year ago
|
||
uplift |
Description
•