InspectorUtils.parseStyleSheet does not seem to fully update stylesheet state when input has nested rules
Categories
(DevTools :: Inspector, defect, P1)
Tracking
(firefox116 fixed)
Tracking | Status | |
---|---|---|
firefox116 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: emilio)
References
Details
Attachments
(2 files)
Steps to reproduce
- Pull https://phabricator.services.mozilla.com/D181645
- Run
./mach test layout/inspector/tests/browser/browser_parseStyleSheet_nested.js
Expected results
The test passes
Actual results
The test fails
The test basically opens a tab with a simple stylesheet containing nested rules:
<style>
h1 {
.mySpan {
background: gold;
&.mySpan {
color: red;
}
}
}
</style>
<h1>Hello<span class="mySpan">world</span>
then calls parseStyleSheet
on the stylesheet, changing the red
color to black
InspectorUtils.parseStyleSheet(
sheet,
`h1 {
.mySpan {
background: gold;
&.mySpan {
color: black;
}
}
}`
);
and run some assertions.
The rule cssText
is updated as expected, but the new color isn't applied to the element
Furthermore, InspectorUtils.getCSSStyleRules
on said element now returns no rules, while it used to returned the expected 2 rules.
For some reason, I wasn't able to reproduce with a plain mochitest (which are widely used for the InspectorUtils
tests, but I was seeing the odd behavior in DevTools
Hopefully I'm not missing something important
Assignee | ||
Comment 1•1 year ago
|
||
In particular, style rules weren't taking the children code-path.
Updated•1 year ago
|
Assignee | ||
Comment 2•1 year ago
|
||
I can't access https://phabricator.services.mozilla.com/D181645, it says:
Access Denied: Restricted Differential Revision
Do you know what that might be about? But I suspect comment 1 fixes it.
Reporter | ||
Comment 3•1 year ago
|
||
Reporter | ||
Comment 4•1 year ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #2)
I can't access https://phabricator.services.mozilla.com/D181645, it says:
Access Denied: Restricted Differential Revision
Do you know what that might be about? But I suspect comment 1 fixes it.
erf, not sure, I just set it as "review needed" , which I guess should unblock the access.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 7•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/096fdcd38685
https://hg.mozilla.org/mozilla-central/rev/766b38dd96b6
Description
•