[webkit-changes] [WebKit/WebKit] 2a77ee: StylePropertyMap.set() should wrap value in a calc...

Chris Dumez noreply at github.com
Wed Dec 7 09:22:17 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2a77eefbdefdfe3b450259a8b108f6a79f457d7a
      https://github.com/WebKit/WebKit/commit/2a77eefbdefdfe3b450259a8b108f6a79f457d7a
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2022-12-07 (Wed, 07 Dec 2022)

  Changed paths:
    A LayoutTests/fast/css/css-typed-om/style-property-map-set-negative-value-expected.txt
    A LayoutTests/fast/css/css-typed-om/style-property-map-set-negative-value.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/block-size-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/column-count-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/column-rule-width-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/flex-grow-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/flex-shrink-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/font-size-adjust-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/font-size-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/font-stretch-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/height-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/inline-size-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/logical-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/orphans-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/padding-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/perspective-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/radius-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/shape-margin-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/tab-size-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/widows-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/width-expected.txt
    M Source/WebCore/css/calc/CSSCalcExpressionNode.h
    M Source/WebCore/css/calc/CSSCalcOperationNode.cpp
    M Source/WebCore/css/parser/CSSParserFastPaths.cpp
    M Source/WebCore/css/parser/CSSParserFastPaths.h
    M Source/WebCore/css/typedom/CSSStyleValue.h
    M Source/WebCore/css/typedom/CSSUnitValue.cpp
    M Source/WebCore/css/typedom/CSSUnitValue.h
    M Source/WebCore/css/typedom/StylePropertyMap.cpp

  Log Message:
  -----------
  StylePropertyMap.set() should wrap value in a calc() if outside the allowed range
https://bugs.webkit.org/show_bug.cgi?id=248547

Reviewed by Antti Koivisto.

StylePropertyMap.set() should wrap value in a calc() if outside the allowed
range for the given property, instead of throwing.

This is the behavior expected by WPT tests and it matches what Blink is doing,
though I cannot find a reference to this in the specification:
- https://github.com/w3c/css-houdini-drafts/issues/1081

This is covered by a lot of WPT tests. Sadly, those WPT tests still don't pass
because we fail a following subtest (which I'll investigate next).

For clarity, I extracted this separate check into its own test:
- fast/css/css-typed-om/style-property-map-set-negative-value.html

* LayoutTests/fast/css/css-typed-om/style-property-map-set-negative-value-expected.txt: Added.
* LayoutTests/fast/css/css-typed-om/style-property-map-set-negative-value.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/block-size-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/column-count-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/column-rule-width-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/flex-grow-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/flex-shrink-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/font-size-adjust-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/font-size-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/font-stretch-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/height-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/inline-size-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/logical-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/orphans-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/padding-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/radius-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/shape-margin-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/tab-size-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/widows-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/width-expected.txt:
* Source/WebCore/css/calc/CSSCalcExpressionNode.h:
(WebCore::CSSCalcExpressionNode::shouldForceEnclosingCalcInCSSText const):
(WebCore::CSSCalcExpressionNode::setShouldForceEnclosingCalcInCSSText):
* Source/WebCore/css/calc/CSSCalcOperationNode.cpp:
(WebCore::CSSCalcOperationNode::buildCSSText):
* Source/WebCore/css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isSimpleLengthPropertyID):
(WebCore::parseSimpleLengthValue):
(WebCore::isSimpleLengthPropertyID): Deleted.
* Source/WebCore/css/parser/CSSParserFastPaths.h:
* Source/WebCore/css/typedom/CSSStyleValue.h:
(WebCore::CSSStyleValue::toCSSValueWithProperty const):
* Source/WebCore/css/typedom/CSSUnitValue.cpp:
(WebCore::isValueOutOfRangeForProperty):
(WebCore::CSSUnitValue::toCSSValueWithProperty const):
* Source/WebCore/css/typedom/CSSUnitValue.h:
* Source/WebCore/css/typedom/StylePropertyMap.cpp:
(WebCore::cssValueFromStyleValues):

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




More information about the webkit-changes mailing list