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
Add block-step-size to CSS parser. #10176
Add block-step-size to CSS parser. #10176
Conversation
EWS run on previous version of this PR (hash 59c3981)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add tests for animation support. You'll likely need to rebase some tests too. See: af2d999
@@ -173,6 +173,8 @@ class StyleRareNonInheritedData : public RefCounted<StyleRareNonInheritedData> { | |||
|
|||
float zoom; | |||
|
|||
std::optional<Length> blockStepSize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to compare in the equality operator as well and add it to the copy constructor.
https://searchfox.org/wubkat/source/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp#161
https://searchfox.org/wubkat/rev/6312ca8a662145d355274780bbf68b6ce735d8e8/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp#283
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think I got everything but let me know if I missed something
<title>CSS Rhythm: block-step-size invalid values</title> | ||
<title>CSS Rhythm: block-step-size valid values</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: double title
<title>CSS Rhythm: block-step-size invalid values</title> | |
<title>CSS Rhythm: block-step-size valid values</title> | |
<title>CSS Rhythm: block-step-size invalid values</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
@@ -1839,5 +1841,12 @@ inline TextAutospace BuilderConverter::convertTextAutospace(BuilderState&, const | |||
return { }; | |||
} | |||
|
|||
inline std::optional<Length> BuilderConverter::convertBlockStepSize(BuilderState& builderState, const CSSValue& value) | |||
{ | |||
if (auto primitiveValue = downcast<CSSPrimitiveValue>(value).valueID() == CSSValueNone) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (auto primitiveValue = downcast<CSSPrimitiveValue>(value).valueID() == CSSValueNone) | |
if (downcast<CSSPrimitiveValue>(value).valueID() == CSSValueNone) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
@@ -3662,6 +3662,7 @@ CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap() | |||
case CSSPropertyAnimationPlayState: | |||
case CSSPropertyAnimationTimingFunction: | |||
case CSSPropertyAppearance: | |||
case CSSPropertyBlockStepSize: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, the spec doesn't define whether the property is animatable. Can you file an issue on w3c/csswg-drafts?
Feel free to ignore my comment about animation tests for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
59c3981
to
94751c6
Compare
EWS run on previous version of this PR (hash 94751c6)
|
<title>CSS Rhythm: block-step-size computed values</title> | ||
<title>CSS Rhythm: block-step-size valid values</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<title>CSS Rhythm: block-step-size computed values</title> | |
<title>CSS Rhythm: block-step-size valid values</title> | |
<title>CSS Rhythm: block-step-size computed values</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to land, can you update the WPT PR too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, done!
94751c6
to
ca1c50b
Compare
EWS run on current version of this PR (hash ca1c50b)
|
https://bugs.webkit.org/show_bug.cgi?id=252205 rdar://105421486 Reviewed by Tim Nguyen. Grammar for property: none | <length [0,∞]> We store the value within a std::optional<Length> within StyleRareNonInheritedData. If we get an invalid value or "none," this field will not have a value inside of it. Otherwise, we will store the specified length as the value. It seems like it is currently an open discussion as to whether it should be animatable, so we mark it as a property that cannot be animated. If the spec changes, then we will need to make the proper changes. * LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/parsing/block-step-size-computed-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/parsing/block-step-size-computed.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/parsing/block-step-size-invalid-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/parsing/block-step-size-invalid.html: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/parsing/block-step-size-valid-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/parsing/block-step-size-valid.html: Added. * LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt: * LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt: * LayoutTests/platform/ipad/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt: * LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt: * LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt: * Source/WebCore/animation/CSSPropertyAnimation.cpp: (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): * Source/WebCore/css/CSSProperties.json: * Source/WebCore/css/ComputedStyleExtractor.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * Source/WebCore/rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialBlockStepSize): (WebCore::RenderStyle::blockStepSize const): (WebCore::RenderStyle::setBlockStepSize): * Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * Source/WebCore/rendering/style/StyleRareNonInheritedData.h: * Source/WebCore/style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertBlockStepSize): Canonical link: https://commits.webkit.org/260574@main
ca1c50b
to
84095e2
Compare
Committed 260574@main (84095e2): https://commits.webkit.org/260574@main Reviewed commits have been landed. Closing PR #10176 and removing active labels. |
84095e2
ca1c50b
🛠 wincairo🧪 api-gtk