[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-nesting] Use "quiet" rules for use-counting bare declarations #43973

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

The CSSWG wants to change how non-leading bare declarations work.
Instead of "shifting up" those declarations to the rule's main
declaration block, we want to treat them as wrapped by an &-rule,
except with parse-time expansion of selectors instead of the normal
behavior for '&' [1][2].

Actually making this change is easier said than done, since we now
have to worry about the compat risk. A naive use-counter added
previously shows that ~0.16% of page loads at some point parse
bare declarations after a nested rule. This is too high, and we
need a more advanced use-counter.

This CL adds the concept of "quiet rules", which are generated
automatically from detecting bare declarations in CSSParserImpl
and mostly treated normally until we reach StyleCascade.
In StyleCascade we cascade with and without the quiet rules,
check if quiet rules made a difference, and trigger a use-counter
based on that.

[1] w3c/csswg-drafts#8738
[2] w3c/csswg-drafts#9492
[3] https://chromestatus.com/metrics/feature/timeline/popularity/4709

Bug: 1517290
Change-Id: Ieef0b47d85ffb5a5e58424457422686e74ea0668
Reviewed-on: https://chromium-review.googlesource.com/5177646
WPT-Export-Revision: f0c8d351a2483a1b93d9806afada5303b667c6cd

The CSSWG wants to change how non-leading bare declarations work.
Instead of "shifting up" those declarations to the rule's main
declaration block, we want to treat them as wrapped by an &-rule,
except with parse-time expansion of selectors instead of the normal
behavior for '&' [1][2].

Actually making this change is easier said than done, since we now
have to worry about the compat risk. A naive use-counter added
previously shows that ~0.16% of page loads at some point parse
bare declarations after a nested rule. This is too high, and we
need a more advanced use-counter.

This CL adds the concept of "quiet rules", which are generated
automatically from detecting bare declarations in CSSParserImpl
and mostly treated normally until we reach StyleCascade.
In StyleCascade we cascade with and without the quiet rules,
check if quiet rules made a difference, and trigger a use-counter
based on that.

[1] w3c/csswg-drafts#8738
[2] w3c/csswg-drafts#9492
[3] https://chromestatus.com/metrics/feature/timeline/popularity/4709

Bug: 1517290
Change-Id: Ieef0b47d85ffb5a5e58424457422686e74ea0668
Copy link
Collaborator
@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants