[webkit-changes] [WebKit/WebKit] 64bbc0: CSS font consumers should not eagerly evaluate calc()

Sam Weinig noreply at github.com
Thu Sep 12 11:25:10 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 64bbc037116b8c9877e3478088f8dc8a2e23310a
      https://github.com/WebKit/WebKit/commit/64bbc037116b8c9877e3478088f8dc8a2e23310a
  Author: Sam Weinig <sam at webkit.org>
  Date:   2024-09-12 (Thu, 12 Sep 2024)

  Changed paths:
    M LayoutTests/fast/css/font-calculated-value-expected.txt
    M LayoutTests/fast/css/font-calculated-value.html
    M LayoutTests/fast/text/font-selection-font-face-parse-expected.txt
    M LayoutTests/fast/text/font-selection-font-face-parse.html
    M LayoutTests/fast/text/font-selection-font-loading-api-parse-expected.txt
    M LayoutTests/fast/text/font-selection-font-loading-api-parse.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/animations/font-variation-settings-interpolation-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/calc-in-font-variation-settings-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/calc-in-font-variation-settings.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/at-font-face-descriptors-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/at-font-face-descriptors.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/font-weight-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-values/signs-abs-invalid-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/css/CSSFontFace.cpp
    M Source/WebCore/css/CSSFontFace.h
    M Source/WebCore/css/CSSFontFaceSet.cpp
    M Source/WebCore/css/CSSFontFeatureValue.cpp
    M Source/WebCore/css/CSSFontFeatureValue.h
    M Source/WebCore/css/CSSFontVariationValue.cpp
    M Source/WebCore/css/CSSFontVariationValue.h
    M Source/WebCore/css/CSSProperties.json
    M Source/WebCore/css/ComputedStyleExtractor.cpp
    M Source/WebCore/css/FontFace.cpp
    M Source/WebCore/css/calc/CSSCalcValue.cpp
    M Source/WebCore/css/calc/CSSCalcValue.h
    M Source/WebCore/css/parser/CSSParserImpl.cpp
    M Source/WebCore/css/parser/CSSPropertyParser.cpp
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+Angle.cpp
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+Angle.h
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+CSSPrimitiveValueResolver.cpp
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+CSSPrimitiveValueResolver.h
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+Font.cpp
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+Font.h
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+Grid.cpp
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+Image.cpp
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+Length.cpp
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+Length.h
    A Source/WebCore/css/parser/CSSPropertyParserConsumer+LengthPercentage.cpp
    A Source/WebCore/css/parser/CSSPropertyParserConsumer+LengthPercentage.h
    A Source/WebCore/css/parser/CSSPropertyParserConsumer+LengthPercentageDefinitions.h
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+Number.cpp
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+Number.h
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+Position.cpp
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+RawTypes.cpp
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+RawTypes.h
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+Transform.cpp
    M Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
    M Source/WebCore/css/process-css-properties.py
    M Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
    M Source/WebCore/html/canvas/OffscreenCanvasRenderingContext2D.cpp
    M Source/WebCore/page/IntersectionObserver.cpp
    M Source/WebCore/style/StyleBuilderConverter.h
    M Source/WebCore/style/StyleBuilderCustom.h
    M Source/WebCore/style/StyleResolveForFontRaw.cpp
    M Source/WebCore/style/StyleResolveForFontRaw.h

  Log Message:
  -----------
  CSS font consumers should not eagerly evaluate calc()
https://bugs.webkit.org/show_bug.cgi?id=279473

Reviewed by Antti Koivisto.

Replaces eager evaluation of calc() in CSS font consumers with
storing the primitive value for resolution at style building time
for uses by style rules and storing UnevaluatedCalcs for non-style
rule uses (like @font-face, JS FontFace and Canvas).

Requires adding a new "Raw" type to represent <length-percentage>,
as the existing modeling of that using LengthRaw and PercentRaw
was unable to capture the fact that only a single calc(), with
category PercentLength, was required.

Still needed is determining how to resolve all the UnevaluatedCalcs
when conversion data is required, but that is an existing problem.

* LayoutTests/fast/css/font-calculated-value-expected.txt:
* LayoutTests/fast/css/font-calculated-value.html:
* LayoutTests/fast/text/font-selection-font-face-parse-expected.txt:
* LayoutTests/fast/text/font-selection-font-face-parse.html:
* LayoutTests/fast/text/font-selection-font-loading-api-parse-expected.txt:
* LayoutTests/fast/text/font-selection-font-loading-api-parse.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/animations/font-variation-settings-interpolation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/calc-in-font-variation-settings-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/calc-in-font-variation-settings.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/at-font-face-descriptors-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/at-font-face-descriptors.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/font-weight-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/signs-abs-invalid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/css/CSSFontFace.cpp:
* Source/WebCore/css/CSSFontFace.h:
* Source/WebCore/css/CSSFontFaceSet.cpp:
* Source/WebCore/css/CSSFontFeatureValue.cpp:
* Source/WebCore/css/CSSFontFeatureValue.h:
* Source/WebCore/css/CSSFontVariationValue.cpp:
* Source/WebCore/css/CSSFontVariationValue.h:
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/ComputedStyleExtractor.cpp:
* Source/WebCore/css/FontFace.cpp:
* Source/WebCore/css/calc/CSSCalcValue.cpp:
* Source/WebCore/css/calc/CSSCalcValue.h:
* Source/WebCore/css/parser/CSSParserImpl.cpp:
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Angle.cpp:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Angle.h:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+CSSPrimitiveValueResolver.cpp:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+CSSPrimitiveValueResolver.h:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Font.cpp:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Font.h:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Grid.cpp:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Image.cpp:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Length.cpp:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Length.h:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+LengthPercentage.cpp: Added.
* Source/WebCore/css/parser/CSSPropertyParserConsumer+LengthPercentage.h: Added.
* Source/WebCore/css/parser/CSSPropertyParserConsumer+LengthPercentageDefinitions.h: Added.
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Lists.cpp:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Lists.h:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Number.cpp:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Number.h:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Position.cpp:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+RawTypes.cpp:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+RawTypes.h:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Transform.cpp:
* Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:
* Source/WebCore/css/process-css-properties.py:
* Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:
* Source/WebCore/html/canvas/OffscreenCanvasRenderingContext2D.cpp:
* Source/WebCore/page/IntersectionObserver.cpp:
* Source/WebCore/style/StyleBuilderConverter.h:
* Source/WebCore/style/StyleBuilderCustom.h:
* Source/WebCore/style/StyleResolveForFontRaw.cpp:
* Source/WebCore/style/StyleResolveForFontRaw.h:

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list