[anchor-position] Properly implement CSSOM API classes #40926
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch adds proper implementation of the CSSPositionFallbackRule
and CSSTryRule API as specified [1]:
It reimplements
CSSPositionFallbackRule
as a subclass ofCSSGroupingRule
, andStyleRulePositionFallback
as a subclassof
StyleRuleGroup
.It adds some code to
CSSGroupingRule.insertRule()
to make surethe function only adds
@try
rules intoCSSPositionFallbackRule
.Since
CSSStyleRule.style.setProperty()
can add disallowedproperties into a
@try
block [2], this patch also adds filteringinto the style cascade to make sure when applying the style from
a
@try
rule, only allowed properties' values are applied.This patch also manually adds the IDL of the APIs into wpt so that we
can add idlharness test without waiting for the IDL auto roller.
[1] https://drafts.csswg.org/css-anchor-position-1/#interfaces
[2] w3c/csswg-drafts#9042
Bug: 1309178
Change-Id: Ib7700605a9968a3547fbe99197c882e8aa6caaea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4668131
Reviewed-by: Daniil Sakhapov <sakhapov@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1168271}