You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[@Property] Rules in shadow trees should be ignored.
https://bugs.webkit.org/show_bug.cgi?id=250567
rdar://104221943
Reviewed by Simon Fraser.
"A @Property is invalid if it occurs in a stylesheet inside of a shadow tree, and must be ignored."
https://drafts.css-houdini.org/css-properties-values-api/#at-property-rule
* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/at-property-shadow-expected.txt:
* Source/WebCore/css/CSSVariableReferenceValue.cpp:
* Source/WebCore/css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
No need to create a style resolver.
* Source/WebCore/style/RuleSetBuilder.cpp:
(WebCore::Style::RuleSetBuilder::addChildRule):
Fix indentation.
(WebCore::Style::RuleSetBuilder::addMutatingRulesToResolver):
The actual fix. Check if we are in a shadow scope and bail.
* Source/WebCore/style/StyleResolver.cpp:
(WebCore::Style::Resolver::create):
Pass the scope as enum value (document or shadow). Due to sharing between identically styled
shadow trees we don't provide the actual Style::Scope.
(WebCore::Style::Resolver::Resolver):
Use WeakPtr for the document.
(WebCore::Style::Resolver::initialize):
Factor into a function.
(WebCore::Style::Resolver::document):
(WebCore::Style::Resolver::document const):
(WebCore::Style::Resolver::scope): Deleted.
(WebCore::Style::Resolver::scope const): Deleted.
(WebCore::Style::Resolver::~Resolver): Deleted.
* Source/WebCore/style/StyleResolver.h:
(WebCore::Style::Resolver::scopeType const):
* Source/WebCore/style/StyleScope.cpp:
(WebCore::Style::Scope::createDocumentResolver):
(WebCore::Style::Scope::createOrFindSharedShadowTreeResolver):
Canonical link: https://commits.webkit.org/258880@main
<
8000
span class="x x-first x-last">FAIL @property rules in shadow trees should have no effect assert_equals: expected "calc(1px + 1px)" but got "2px"
2
+
PASS @property rules in shadow trees should have no effect
0 commit comments