[webkit-changes] [WebKit/WebKit] ce1ebf: [css-values] Implement CSS cap unit

Tim Nguyen noreply at github.com
Fri Aug 25 20:12:17 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ce1ebf3906ee2f1bf9b5a5d8b85d7f5e28b14098
      https://github.com/WebKit/WebKit/commit/ce1ebf3906ee2f1bf9b5a5d8b85d7f5e28b14098
  Author: Tim Nguyen <ntim at apple.com>
  Date:   2023-08-25 (Fri, 25 Aug 2023)

  Changed paths:
    M LayoutTests/TestExpectations
    M LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-units-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-values/cap-invalidation-expected.txt
    M Source/WebCore/css/CSSPrimitiveValue.cpp
    M Source/WebCore/css/CSSPrimitiveValue.h
    M Source/WebCore/css/CSSPrimitiveValueMappings.h
    M Source/WebCore/css/CSSUnits.cpp
    M Source/WebCore/css/CSSUnits.h
    M Source/WebCore/css/calc/CSSCalcCategoryMapping.cpp
    M Source/WebCore/css/parser/CSSParserToken.cpp
    M Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
    M Source/WebCore/css/parser/SizesAttributeParser.cpp
    M Source/WebCore/css/typedom/CSSNumericFactory.h
    M Source/WebCore/css/typedom/CSSStyleValueFactory.cpp

  Log Message:
  -----------
  [css-values] Implement CSS cap unit
https://bugs.webkit.org/show_bug.cgi?id=242466
rdar://97025854

Reviewed by Myles C. Maxfield and Darin Adler.

https://drafts.csswg.org/css-values/#cap

> Equal to the used cap-height of the first available font [CSS3-FONTS]. [...] In the cases where it is impossible or impractical to determine the cap-height, the font’s ascent must be used.

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/font-relative-units-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/cap-invalidation-expected.txt:
* Source/WebCore/css/CSSPrimitiveValue.cpp:
(WebCore::isValidCSSUnitTypeForDoubleConversion):
(WebCore::isStringType):
(WebCore::CSSPrimitiveValue::~CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::computeUnzoomedNonCalcLengthDouble):
(WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble):
(WebCore::CSSPrimitiveValue::unitTypeString):
(WebCore::CSSPrimitiveValue::serializeInternal const):
(WebCore::CSSPrimitiveValue::equals const):
(WebCore::CSSPrimitiveValue::addDerivedHash const):
(WebCore::CSSPrimitiveValue::collectComputedStyleDependencies const):
* Source/WebCore/css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isFontRelativeLength):
(WebCore::CSSPrimitiveValue::isLength):
* Source/WebCore/css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::convertingToLengthRequiresNonNullStyle const):
* Source/WebCore/css/CSSUnits.cpp:
(WebCore::unitCategory):
(WebCore::operator<<):
* Source/WebCore/css/CSSUnits.h:
* Source/WebCore/css/calc/CSSCalcCategoryMapping.cpp:
(WebCore::calcUnitCategory):
(WebCore::calculationCategoryForCombination):
(WebCore::hasDoubleValue):
* Source/WebCore/css/parser/CSSParserToken.cpp:
(WebCore::cssPrimitiveValueUnitFromTrie):
* Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::LengthRawKnownTokenTypeDimensionConsumer::consume):
* Source/WebCore/css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::computeLength):
* Source/WebCore/css/typedom/CSSNumericFactory.h:
* Source/WebCore/css/typedom/CSSStyleValueFactory.cpp:
(WebCore::CSSStyleValueFactory::reifyValue):

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




More information about the webkit-changes mailing list