Declaration after nested rule appears in its parent rule
Categories
(DevTools :: Inspector: Rules, defect)
Tracking
(firefox-esr128 unaffected, firefox135 wontfix, firefox136 fixed, firefox137 fixed)
Tracking | Status | |
---|---|---|
firefox-esr128 | --- | unaffected |
firefox135 | --- | wontfix |
firefox136 | --- | fixed |
firefox137 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: nchevobbe)
References
(Regression)
Details
(Keywords: perf-alert, regression)
Attachments
(2 files, 1 obsolete file)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
Steps to reproduce
- Navigate to
data:text/html,<meta charset=utf8><style>body { color: red; span {} color: green; }</style>Hello
- Open the inspector
In the rules view, we're getting:
body {
{
color: green;
}
}
body {
color: red;
color: green;
}
but we should have
body {
{
color: green;
}
}
body {
color: red;
}
Assignee | ||
Updated•7 months ago
|
Assignee | ||
Comment 1•7 months ago
|
||
parseDeclarationsInternal
handling of nested rules predate changes made to the spec and additions of CSSNesstedDeclarations
:
if (
// If we're not already in a nested rule
!isInNested &&
// and there's an opening curly bracket
token.tokenType === "CurlyBracketBlock" &&
// and we're not inside a function or an attribute
!currentBlocks.length
) {
// Assume we're encountering a nested rule.
isInNested = true;
nestingLevel = 1;
continue;
} else if (isInNested) {
if (token.tokenType == "CurlyBracketBlock") {
nestingLevel++;
} else if (token.tokenType == "CloseCurlyBracket") {
nestingLevel--;
}
// If we were in a nested rule, and we saw the last closing curly bracket,
// reset the state to parse possible declarations declared after the nested rule.
if (nestingLevel === 0) {
isInNested = false;
// We need to remove the previous pending declaration and reset the state
declarations.pop();
resetStateForNextDeclaration();
}
continue;
which means we still retrieve the declarations after nested block, although we shouldn't now, since they're now in a different rule that we do retrieve as well
Comment 2•7 months ago
|
||
Set release status flags based on info from the regressing bug 1919853
:emilio, since you are the author of the regressor, bug 1919853, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
Comment 3•7 months ago
|
||
You're definitely more familiar than me with this code, do you plan to look at this? Otherwise I could but I'm honestly a bit swamped with other things so...
Assignee | ||
Comment 4•7 months ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)
You're definitely more familiar than me with this code, do you plan to look at this? Otherwise I could but I'm honestly a bit swamped with other things so...
yeah yeah, don't worry, I'm having a look
Assignee | ||
Comment 5•7 months ago
|
||
Updated•7 months ago
|
Assignee | ||
Comment 6•7 months ago
|
||
Stop collecting declarations as soon as we detect a nested rule.
Any declaration that come after the nested rules are now put in a
separate CSSNestedDeclaration rule.
We still need to handle the nesting logic for commented declarations,
as highlighted by a test case in test_parseDeclarations.js.
Other test cases there for nested rules are updated, and we add
a CSSNestedDeclaration in a Rules view mochitest to make sure we
don't get the declaration in the "top level" rule anymore.
Updated•7 months ago
|
Comment 7•7 months ago
|
||
Comment on attachment 9465079 [details]
Bug 1946445 - [devtools] Turn RuleRewriter into a proper ES6 class. r=#devtools.
Revision D237519 was moved to bug 1946442. Setting attachment 9465079 [details] to obsolete.
Comment 9•7 months ago
|
||
bugherder |
Comment 10•7 months ago
|
||
The patch landed in nightly and beta is affected.
:nchevobbe, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox136
towontfix
.
For more information, please visit BugBot documentation.
Assignee | ||
Comment 11•7 months ago
|
||
Stop collecting declarations as soon as we detect a nested rule.
Any declaration that come after the nested rules are now put in a
separate CSSNestedDeclaration rule.
We still need to handle the nesting logic for commented declarations,
as highlighted by a test case in test_parseDeclarations.js.
Other test cases there for nested rules are updated, and we add
a CSSNestedDeclaration in a Rules view mochitest to make sure we
don't get the declaration in the "top level" rule anymore.
Original Revision: https://phabricator.services.mozilla.com/D237520
Updated•7 months ago
|
Assignee | ||
Updated•7 months ago
|
Comment 12•7 months ago
|
||
beta Uplift Approval Request
- User impact if declined: duplicated declaration in Inspector Rules view, might confuse users
- 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 fix, covered by unit test and mochitest
- String changes made/needed: -
- Is Android affected?: yes
Updated•7 months ago
|
Comment 13•7 months ago
|
||
uplift |
Updated•7 months ago
|
Comment 14•7 months ago
|
||
For more information on performance sheriffing please see our FAQ.
(In reply to Cristian Tuns from comment #9)
Perfherder has detected a devtools performance change from push a08727399a3753b89c1270329ebd0f0499c3740d.
Improvements:
Ratio | Test | Platform | Options | Absolute values (old vs new) |
---|---|---|---|---|
8% | damp browser-toolbox.webconsole-ready.DAMP | linux1804-64-shippable-qr | e10s fission stylo webrender | 698.31 -> 644.43 |
6% | damp browser-toolbox.webconsole-ready.DAMP | windows11-64-shippable-qr | e10s fission stylo webrender | 427.31 -> 400.16 |
Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.
If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a sheriff to do that for you.
You can run these tests on try with ./mach try perf --alert 43855
Description
•