Skip to content
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

background-size should not accept unitless lengths #12644

Merged
merged 1 commit into from Apr 12, 2023

Conversation

annevk
Copy link
Contributor

@annevk annevk commented Apr 12, 2023

0b6c4aa

background-size should not accept unitless lengths
https://bugs.webkit.org/show_bug.cgi?id=139029
rdar://97039770

Reviewed by Antti Koivisto and Tim Nguyen.

Align with other browsers by not using unitless length parsing for background-size.

* LayoutTests/fast/backgrounds/size/parsing-background-size-values-expected.txt:
* LayoutTests/fast/backgrounds/size/parsing-inherit-expected.txt:
* LayoutTests/fast/backgrounds/size/resources/parsing-background-size-values.js:
(test):
* LayoutTests/fast/backgrounds/size/resources/parsing-inherit.js:
(test):
* LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-002-expected.txt:
* Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::shouldAcceptUnitlessValue):
(WebCore::CSSPropertyParserHelpers::IntegerTypeRawKnownTokenTypeNumberConsumer::consume):
(WebCore::CSSPropertyParserHelpers::IntegerTypeKnownTokenTypeNumberConsumer::consume):
(WebCore::CSSPropertyParserHelpers::NumberRawKnownTokenTypeNumberConsumer::consume):
(WebCore::CSSPropertyParserHelpers::NumberCSSPrimitiveValueWithCalcWithKnownTokenTypeNumberConsumer::consume):
(WebCore::CSSPropertyParserHelpers::PercentCSSPrimitiveValueWithCalcWithKnownTokenTypePercentConsumer::consume):
(WebCore::CSSPropertyParserHelpers::consumeMetaConsumer):
(WebCore::CSSPropertyParserHelpers::parseNonRelativeRGBParametersRaw):
(WebCore::CSSPropertyParserHelpers::consumeColorInterpolationMethod):
(WebCore::CSSPropertyParserHelpers::parseColorMixFunctionParametersRaw):
(WebCore::CSSPropertyParserHelpers::consumePositionCoordinates):
(WebCore::CSSPropertyParserHelpers::consumePrefixedRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumePrefixedLinearGradient):
(WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
(WebCore::CSSPropertyParserHelpers::consumeConicGradient):
(WebCore::CSSPropertyParserHelpers::consumeSingleShadow):
(WebCore::CSSPropertyParserHelpers::consumeFamilyNameList):
(WebCore::CSSPropertyParserHelpers::consumeFontVariantEastAsian):
(WebCore::CSSPropertyParserHelpers::consumeFontVariantAlternates):
(WebCore::CSSPropertyParserHelpers::consumeClip):
(WebCore::CSSPropertyParserHelpers::consumeSteps):
(WebCore::CSSPropertyParserHelpers::consumeCubicBezier):
(WebCore::CSSPropertyParserHelpers::consumeSpringFunction):
(WebCore::CSSPropertyParserHelpers::consumeTransformFunction):
(WebCore::CSSPropertyParserHelpers::consumeAttr):
(WebCore::CSSPropertyParserHelpers::consumeBasicShapePath):
(WebCore::CSSPropertyParserHelpers::consumeReflect):
(WebCore::CSSPropertyParserHelpers::consumeBackgroundSize):
(WebCore::CSSPropertyParserHelpers::consumeAlignTracks):
(WebCore::CSSPropertyParserHelpers::consumeJustifyTracks):
(WebCore::CSSPropertyParserHelpers::consumeHangingPunctuation):

Canonical link: https://commits.webkit.org/262873@main

5e1b997

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1   πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@annevk annevk self-assigned this Apr 12, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Apr 12, 2023
@Ahmad-S792 Ahmad-S792 added CSS Cascading Style Sheets implementation and removed merging-blocked Applied to prevent a change from being merged labels Apr 12, 2023
@annevk annevk changed the title limit CSS parser hashless-color and unitless-length quirks to only the properties that need them background-size should not accept unitless lengths Apr 12, 2023
@annevk annevk added the request-merge-queue Request a pull request to be added to merge-queue once ready label Apr 12, 2023
@annevk
Copy link
Contributor Author

annevk commented Apr 12, 2023

All I changed is the commit message based on some feedback from smfr. This should be good to go.

@webkit-early-warning-system
Copy link
Collaborator

Starting EWS tests for 5e1b997. Live statuses available at the PR page, #12644

@Ahmad-S792 Ahmad-S792 added merge-queue Applied to send a pull request to merge-queue and removed request-merge-queue Request a pull request to be added to merge-queue once ready labels Apr 12, 2023
Copy link
Member

@nt1m nt1m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This affects -webkit-background-size too, which seems undesirable?

@nt1m nt1m removed the merge-queue Applied to send a pull request to merge-queue label Apr 12, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Apr 12, 2023
Copy link
Member

@nt1m nt1m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably fine since this only affects quirks mode.

@nt1m nt1m self-requested a review April 12, 2023 17:03
@nt1m nt1m added merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged labels Apr 12, 2023
https://bugs.webkit.org/show_bug.cgi?id=139029
rdar://97039770

Reviewed by Antti Koivisto and Tim Nguyen.

Align with other browsers by not using unitless length parsing for background-size.

* LayoutTests/fast/backgrounds/size/parsing-background-size-values-expected.txt:
* LayoutTests/fast/backgrounds/size/parsing-inherit-expected.txt:
* LayoutTests/fast/backgrounds/size/resources/parsing-background-size-values.js:
(test):
* LayoutTests/fast/backgrounds/size/resources/parsing-inherit.js:
(test):
* LayoutTests/imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-002-expected.txt:
* Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::shouldAcceptUnitlessValue):
(WebCore::CSSPropertyParserHelpers::IntegerTypeRawKnownTokenTypeNumberConsumer::consume):
(WebCore::CSSPropertyParserHelpers::IntegerTypeKnownTokenTypeNumberConsumer::consume):
(WebCore::CSSPropertyParserHelpers::NumberRawKnownTokenTypeNumberConsumer::consume):
(WebCore::CSSPropertyParserHelpers::NumberCSSPrimitiveValueWithCalcWithKnownTokenTypeNumberConsumer::consume):
(WebCore::CSSPropertyParserHelpers::PercentCSSPrimitiveValueWithCalcWithKnownTokenTypePercentConsumer::consume):
(WebCore::CSSPropertyParserHelpers::consumeMetaConsumer):
(WebCore::CSSPropertyParserHelpers::parseNonRelativeRGBParametersRaw):
(WebCore::CSSPropertyParserHelpers::consumeColorInterpolationMethod):
(WebCore::CSSPropertyParserHelpers::parseColorMixFunctionParametersRaw):
(WebCore::CSSPropertyParserHelpers::consumePositionCoordinates):
(WebCore::CSSPropertyParserHelpers::consumePrefixedRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumePrefixedLinearGradient):
(WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
(WebCore::CSSPropertyParserHelpers::consumeConicGradient):
(WebCore::CSSPropertyParserHelpers::consumeSingleShadow):
(WebCore::CSSPropertyParserHelpers::consumeFamilyNameList):
(WebCore::CSSPropertyParserHelpers::consumeFontVariantEastAsian):
(WebCore::CSSPropertyParserHelpers::consumeFontVariantAlternates):
(WebCore::CSSPropertyParserHelpers::consumeClip):
(WebCore::CSSPropertyParserHelpers::consumeSteps):
(WebCore::CSSPropertyParserHelpers::consumeCubicBezier):
(WebCore::CSSPropertyParserHelpers::consumeSpringFunction):
(WebCore::CSSPropertyParserHelpers::consumeTransformFunction):
(WebCore::CSSPropertyParserHelpers::consumeAttr):
(WebCore::CSSPropertyParserHelpers::consumeBasicShapePath):
(WebCore::CSSPropertyParserHelpers::consumeReflect):
(WebCore::CSSPropertyParserHelpers::consumeBackgroundSize):
(WebCore::CSSPropertyParserHelpers::consumeAlignTracks):
(WebCore::CSSPropertyParserHelpers::consumeJustifyTracks):
(WebCore::CSSPropertyParserHelpers::consumeHangingPunctuation):

Canonical link: https://commits.webkit.org/262873@main
@webkit-commit-queue
Copy link
Collaborator

Committed 262873@main (0b6c4aa): https://commits.webkit.org/262873@main

Reviewed commits have been landed. Closing PR #12644 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 0b6c4aa into WebKit:main Apr 12, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Apr 12, 2023
@annevk annevk deleted the unitless-background-size branch April 12, 2023 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Cascading Style Sheets implementation
Projects
None yet
7 participants