[webkit-changes] [WebKit/WebKit] 997d98: [@property] Rules in shadow trees should be ignored.

Antti Koivisto noreply at github.com
Fri Jan 13 11:42:40 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 997d987fd5b6f1909b9fad9c0018f383a97ed8cc
      https://github.com/WebKit/WebKit/commit/997d987fd5b6f1909b9fad9c0018f383a97ed8cc
  Author: Antti Koivisto <antti at apple.com>
  Date:   2023-01-13 (Fri, 13 Jan 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/at-property-shadow-expected.txt
    M Source/WebCore/css/CSSVariableReferenceValue.cpp
    M Source/WebCore/css/DOMCSSRegisterCustomProperty.cpp
    M Source/WebCore/style/RuleSetBuilder.cpp
    M Source/WebCore/style/StyleResolver.cpp
    M Source/WebCore/style/StyleResolver.h
    M Source/WebCore/style/StyleScope.cpp

  Log Message:
  -----------
  [@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




More information about the webkit-changes mailing list