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

[anchor-position] Properly implement CSSOM API classes #40926

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jul 7, 2023

This patch adds proper implementation of the CSSPositionFallbackRule
and CSSTryRule API as specified [1]:

  1. It reimplements CSSPositionFallbackRule as a subclass of
    CSSGroupingRule, and StyleRulePositionFallback as a subclass
    of StyleRuleGroup.

  2. It adds some code to CSSGroupingRule.insertRule() to make sure
    the function only adds @try rules into CSSPositionFallbackRule.

  3. Since CSSStyleRule.style.setProperty() can add disallowed
    properties into a @try block [2], this patch also adds filtering
    into 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}

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.

This patch adds proper implementation of the CSSPositionFallbackRule
and CSSTryRule API as specified [1]:

1. It reimplements `CSSPositionFallbackRule` as a subclass of
   `CSSGroupingRule`, and `StyleRulePositionFallback` as a subclass
   of `StyleRuleGroup`.

2. It adds some code to `CSSGroupingRule.insertRule()` to make sure
   the function only adds `@try` rules into `CSSPositionFallbackRule`.

3. Since `CSSStyleRule.style.setProperty()` can add disallowed
   properties into a `@try` block [2], this patch also adds filtering
   into 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}
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 1379ecf into master Jul 10, 2023
21 checks passed
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-4668131 branch July 10, 2023 20:36
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