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
Align stroke-dasharray
CSS property parsing with the specification
#7884
Merged
webkit-early-warning-system
merged 1 commit into
WebKit:main
from
cdumez:249615_stroke-dasharray_fixes
Dec 20, 2022
Merged
Align stroke-dasharray
CSS property parsing with the specification
#7884
webkit-early-warning-system
merged 1 commit into
WebKit:main
from
cdumez:249615_stroke-dasharray_fixes
Dec 20, 2022
Conversation
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
EWS run on previous version of this PR (hash ff4a1db) |
cdumez
force-pushed
the
249615_stroke-dasharray_fixes
branch
from
December 20, 2022 00:49
ff4a1db
to
1446f15
Compare
EWS run on previous version of this PR (hash 1446f15) |
cdumez
force-pushed
the
249615_stroke-dasharray_fixes
branch
from
December 20, 2022 01:46
1446f15
to
92827d6
Compare
EWS run on current version of this PR (hash 92827d6) |
webkit-ews-buildbot
added
the
merging-blocked
Applied to prevent a change from being merged
label
Dec 20, 2022
smfr
approved these changes
Dec 20, 2022
Upstream WPT PR: web-platform-tests/wpt#37603 |
cdumez
added
the
unsafe-merge-queue
Applied to send a pull request to merge-queue, but skip building and testing
label
Dec 20, 2022
https://bugs.webkit.org/show_bug.cgi?id=249615 Reviewed by Simon Fraser. Align `stroke-dasharray` CSS property parsing with the specification: - https://svgwg.org/svg2-draft/painting.html#StrokeDashing - https://svgwg.org/svg2-draft/painting.html#DataTypeDasharray * LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/stroke-dasharray-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/stroke-dasharray.html: Update stroke-dasharray css-typed-on WPT test to match the specification. In particular, <length> | <percentage> | <number> should be allowed. Negative values shouldn't be allowed. Also, computed values should be converted to lengths if numbers were provided. * LayoutTests/imported/w3c/web-platform-tests/svg/painting/parsing/stroke-dasharray-invalid-expected.txt: Rebaseline WPT test now that more checks are passing. * Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp: Update LengthRawKnownTokenTypeNumberConsumer::consume() to stop ignoring the UnitlessZeroQuirk parameter. Previously, no matter what value the caller was passing for this parameter, we were allowing unitless zero. Update call sites to pass UnitlessZeroQuirk::Allow to maintain pre-existing behavior for now. However, I made sure to pass UnitlessZeroQuirk::Forbid in consumeStrokeDasharray() since we want to make sure "0" gets parsed as a <number>, not a <length> (covered by stroke-dasharray-valid.html WPT test). (WebCore::CSSPropertyParserHelpers::consumeStrokeDasharray): Fallback to parsing input as a <number> if parsing it as a <length-percentage>, as per the specification. * Source/WebCore/css/typedom/CSSUnitValue.cpp: (WebCore::isValueOutOfRangeForProperty): Update isValueOutOfRangeForProperty() to properly indicate that stroke-dasharray doesn't allow negative values. * Source/WebCore/style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertSVGLengthValue): (WebCore::Style::BuilderConverter::convertSVGLengthVector): (WebCore::Style::BuilderConverter::convertStrokeDashArray): Update our style builder converter to: - Deal with stroke-dasharray values coming from CSS-Typed-OM, which may not have been converted to a CSSValueList yet (unlike values coming from the CSS parser). - Request that numbers get converted to lengths (by using 'px' unit), now that we allow numbers at parser level (per the specification). * Source/WebCore/svg/SVGLengthValue.cpp: (WebCore::SVGLengthValue::fromCSSPrimitiveValue): * Source/WebCore/svg/SVGLengthValue.h: Canonical link: https://commits.webkit.org/258136@main
webkit-early-warning-system
force-pushed
the
249615_stroke-dasharray_fixes
branch
from
December 20, 2022 16:49
92827d6
to
36071c5
Compare
Committed 258136@main (36071c5): https://commits.webkit.org/258136@main Reviewed commits have been landed. Closing PR #7884 and removing active labels. |
webkit-commit-queue
removed
the
unsafe-merge-queue
Applied to send a pull request to merge-queue, but skip building and testing
label
Dec 20, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
36071c5
92827d6