Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
https://bugs.webkit.org/show_bug.cgi?id=249579 <rdar://problem/103516443> Reviewed by Sam Weinig. Make @Property registrations from stylesheets work. * LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/layer-cssom-order-reverse-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/layer-property-override-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/container-inner-at-rules-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/at-property-animation-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/at-property-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/at-property-shadow-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/at-property-stylesheets-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/at-property-viewport-units-dynamic-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/at-property-viewport-units-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/determine-registration-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/registered-property-crosstalk-expected.txt: * Source/WebCore/Sources.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/animation/CSSPropertyAnimation.cpp: * Source/WebCore/css/CSSPropertyRule.cpp: (WebCore::CSSPropertyRule::initialValue const): (WebCore::CSSPropertyRule::cssText const): * Source/WebCore/css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * Source/WebCore/css/ComputedStyleExtractor.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): * Source/WebCore/css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * Source/WebCore/css/StyleProperties.cpp: (WebCore::MutableStyleProperties::setCustomProperty): * Source/WebCore/css/StyleRule.h: * Source/WebCore/css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * Source/WebCore/css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::consumePropertyRule): Pass the initial value as parser tokens instead of a string to avoid unnecessary re-tokenization. * Source/WebCore/dom/Document.cpp: (WebCore::Document::customPropertyRegistry const): (WebCore::Document::registerCSSCustomProperty): Deleted. * Source/WebCore/dom/Document.h: (WebCore::Document::registeredCSSCustomProperties const): Deleted. Move registry ownership to Style::Scope. * Source/WebCore/style/CustomPropertyRegistry.cpp: Added. (WebCore::Style::CustomPropertyRegistry::CustomPropertyRegistry): (WebCore::Style::CustomPropertyRegistry::get const): Look up API registrations first, then stylesheet registrations. (WebCore::Style::CustomPropertyRegistry::registerFromAPI): (WebCore::Style::CustomPropertyRegistry::registerFromStylesheet): Logic for registering a descriptor from a @Property rule. (WebCore::Style::CustomPropertyRegistry::clearRegisteredFromStylesheets): * Source/WebCore/style/CustomPropertyRegistry.h: Added. Add a registry class. * Source/WebCore/style/RuleSetBuilder.cpp: (WebCore::Style::RuleSetBuilder::addChildRules): Collect property rules. Use switch. (WebCore::Style::RuleSetBuilder::addMutatingRulesToResolver): Register the collected property rules in correct order. * Source/WebCore/style/RuleSetBuilder.h: * Source/WebCore/style/StyleBuilder.cpp: (WebCore::Style::Builder::applyProperty): * Source/WebCore/style/StyleResolver.h: (WebCore::Style::Resolver::rootDefaultStyle const): * Source/WebCore/style/StyleScope.cpp: (WebCore::Style::Scope::Scope): (WebCore::Style::Scope::clearResolver): (WebCore::Style::Scope::updateResolver): * Source/WebCore/style/StyleScope.h: (WebCore::Style::Scope::customPropertyRegistry const): (WebCore::Style::Scope::customPropertyRegistry): Style::Scope owns the registry. Canonical link: https://commits.webkit.org/258106@main
- Loading branch information
Showing
32 changed files
with
376 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
FAIL @property unlayered overrides layered assert_equals: expected "rgb(0, 128, 0)" but got "rgba(0, 0, 0, 0)" | ||
FAIL @property override between layers assert_equals: expected "rgb(0, 128, 0)" but got "rgba(0, 0, 0, 0)" | ||
FAIL @property override update with appended sheet 1 assert_equals: expected "rgb(0, 128, 0)" but got "rgba(0, 0, 0, 0)" | ||
FAIL @property override update with appended sheet 2 assert_equals: expected "rgb(0, 128, 0)" but got "rgba(0, 0, 0, 0)" | ||
PASS @property unlayered overrides layered | ||
PASS @property override between layers | ||
PASS @property override update with appended sheet 1 | ||
PASS @property override update with appended sheet 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
|
||
FAIL @keyframes works with @property assert_equals: expected "150px" but got "200px" | ||
FAIL @keyframes picks up the latest @property in the document assert_equals: expected "rgb(150, 150, 150)" but got "rgb(200, 200, 200)" | ||
FAIL Ongoing animation picks up redeclared custom property assert_equals: expected "0px" but got "rgb(200, 200, 200)" | ||
FAIL Ongoing animation matches new keyframes against the current registration assert_equals: expected "0px" but got "rgb(200, 200, 200)" | ||
FAIL Ongoing animation picks up redeclared intial value assert_equals: expected "200px" but got "400px" | ||
FAIL Ongoing animation picks up redeclared inherits flag assert_equals: expected "200px" but got "400px" | ||
FAIL Ongoing animation picks up redeclared meaning of 'unset' assert_equals: expected "200px" but got "400px" | ||
FAIL Transitioning from initial value assert_equals: expected "rgb(255, 0, 0)" but got "" | ||
FAIL Transitioning from specified value assert_equals: expected "rgb(0, 0, 255)" but got "blue" | ||
FAIL Transition triggered by initial value change assert_equals: expected "100px" but got "" | ||
FAIL No transition when changing types assert_equals: expected "100px" but got "" | ||
PASS @keyframes works with @property | ||
PASS @keyframes picks up the latest @property in the document | ||
FAIL Ongoing animation picks up redeclared custom property assert_equals: expected "rgb(150, 150, 150)" but got "0px" | ||
PASS Ongoing animation matches new keyframes against the current registration | ||
FAIL Ongoing animation picks up redeclared intial value assert_equals: expected "250px" but got "200px" | ||
FAIL Ongoing animation picks up redeclared inherits flag assert_equals: expected "250px" but got "200px" | ||
FAIL Ongoing animation picks up redeclared meaning of 'unset' assert_equals: expected "250px" but got "200px" | ||
FAIL Transitioning from initial value assert_equals: expected "rgb(128, 0, 128)" but got "rgb(0, 0, 255)" | ||
FAIL Transitioning from specified value assert_equals: expected "rgb(0, 64, 128)" but got "rgb(0, 128, 0)" | ||
FAIL Transition triggered by initial value change assert_equals: expected "150px" but got "200px" | ||
PASS No transition when changing types | ||
FAIL No transition when removing @property rule assert_equals: expected " 100px" but got "100px" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
FAIL @property rules in shadow trees should have no effect assert_equals: expected "2px" but got "calc(1px + 1px)" | ||
FAIL @property rules in shadow trees should have no effect assert_equals: expected " calc(1px + 1px)" but got "2px" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
FAIL @property detected when stylesheet appears assert_equals: expected "1px" but got "" | ||
FAIL @property removal detected when last @property rule disappears assert_equals: expected "1px" but got "" | ||
FAIL @property detected in second stylesheet assert_equals: expected "2px" but got "" | ||
FAIL @property removal detected with removal of second stylesheet assert_equals: expected "2px" but got "" | ||
FAIL @property removal detected with removal of first stylesheet assert_equals: expected "1px" but got "" | ||
PASS @property detected when stylesheet appears | ||
PASS @property removal detected when last @property rule disappears | ||
PASS @property detected in second stylesheet | ||
PASS @property removal detected with removal of second stylesheet | ||
PASS @property removal detected with removal of first stylesheet | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
|
||
FAIL @property: viewport units in initial value (dynamic) assert_equals: expected "40px" but got "" | ||
FAIL @property: viewport units in initial value (dynamic) assert_equals: expected "10px" but got "40px" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
|
||
|
||
FAIL 10vw is 40px assert_equals: expected "40px" but got "" | ||
FAIL 10vh is 20px assert_equals: expected "20px" but got "" | ||
FAIL 10vi is 40px assert_equals: expected "40px" but got "" | ||
FAIL 10vb is 20px assert_equals: expected "20px" but got "" | ||
FAIL 10vmin is 20px assert_equals: expected "20px" but got "" | ||
FAIL 10vmax is 40px assert_equals: expected "40px" but got "" | ||
FAIL 10svw is 40px assert_equals: expected "40px" but got "" | ||
FAIL 10svh is 20px assert_equals: expected "20px" but got "" | ||
FAIL 10svi is 40px assert_equals: expected "40px" but got "" | ||
FAIL 10svb is 20px assert_equals: expected "20px" but got "" | ||
FAIL 10svmin is 20px assert_equals: expected "20px" but got "" | ||
FAIL 10svmax is 40px assert_equals: expected "40px" but got "" | ||
FAIL 10lvw is 40px assert_equals: expected "40px" but got "" | ||
FAIL 10lvh is 20px assert_equals: expected "20px" but got "" | ||
FAIL 10lvi is 40px assert_equals: expected "40px" but got "" | ||
FAIL 10lvb is 20px assert_equals: expected "20px" but got "" | ||
FAIL 10lvmin is 20px assert_equals: expected "20px" but got "" | ||
FAIL 10lvmax is 40px assert_equals: expected "40px" but got "" | ||
FAIL 10dvw is 40px assert_equals: expected "40px" but got "" | ||
FAIL 10dvh is 20px assert_equals: expected "20px" but got "" | ||
FAIL 10dvi is 40px assert_equals: expected "40px" but got "" | ||
FAIL 10dvb is 20px assert_equals: expected "20px" but got "" | ||
FAIL 10dvmin is 20px assert_equals: expected "20px" but got "" | ||
FAIL 10dvmax is 40px assert_equals: expected "40px" but got "" | ||
PASS 10vw is 40px | ||
PASS 10vh is 20px | ||
PASS 10vi is 40px | ||
PASS 10vb is 20px | ||
PASS 10vmin is 20px | ||
PASS 10vmax is 40px | ||
PASS 10svw is 40px | ||
PASS 10svh is 20px | ||
PASS 10svi is 40px | ||
PASS 10svb is 20px | ||
PASS 10svmin is 20px | ||
PASS 10svmax is 40px | ||
PASS 10lvw is 40px | ||
PASS 10lvh is 20px | ||
PASS 10lvi is 40px | ||
PASS 10lvb is 20px | ||
PASS 10lvmin is 20px | ||
PASS 10lvmax is 40px | ||
PASS 10dvw is 40px | ||
PASS 10dvh is 20px | ||
PASS 10dvi is 40px | ||
PASS 10dvb is 20px | ||
PASS 10dvmin is 20px | ||
PASS 10dvmax is 40px | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
|
||
FAIL @property determines the registration when uncontested assert_equals: expected "1px" but got "" | ||
PASS @property determines the registration when uncontested | ||
PASS CSS.registerProperty wins over @property | ||
FAIL @property later in document order wins assert_equals: expected "6" but got "" | ||
FAIL @property later in stylesheet wins assert_equals: expected "rgb(255, 0, 0)" but got "" | ||
PASS @property later in document order wins | ||
PASS @property later in stylesheet wins | ||
PASS CSS.registerProperty determines the registration when uncontested | ||
FAIL @property registrations are cleared when rule removed assert_equals: expected "10px" but got "" | ||
PASS @property registrations are cleared when rule removed | ||
FAIL Computed value becomes token sequence when @property is removed assert_equals: expected " calc(1px + 1px)" but got "calc(1px + 1px)" | ||
FAIL Inherited status is reflected in computed styles when @property is removed assert_equals: expected " 10px" but got "10px" | ||
FAIL Invalid @property rule (missing syntax) does not overwrite previous valid rule assert_equals: expected "1px" but got "" | ||
FAIL Invalid @property rule (missing inherits descriptor) does not overwrite previous valid rule assert_equals: expected "1px" but got "" | ||
FAIL Invalid @property rule (missing initial-value) does not overwrite previous valid rule assert_equals: expected "1px" but got "" | ||
FAIL Previous invalid rule does not prevent valid rule from causing registration assert_equals: expected "1px" but got "" | ||
FAIL Unknown descriptors are ignored and do not invalidate rule assert_equals: expected "1px" but got "" | ||
PASS Invalid @property rule (missing syntax) does not overwrite previous valid rule | ||
PASS Invalid @property rule (missing inherits descriptor) does not overwrite previous valid rule | ||
PASS Invalid @property rule (missing initial-value) does not overwrite previous valid rule | ||
PASS Previous invalid rule does not prevent valid rule from causing registration | ||
PASS Unknown descriptors are ignored and do not invalidate rule | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
FAIL Only #c should be affected by --x:42 assert_equals: expected "0" but got "" | ||
PASS Only #c should be affected by --x:42 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.