[webkit-changes] [WebKit/WebKit] 0effe5: font-style: oblique with calc() should allow out-o...

Darin Adler noreply at github.com
Mon Oct 24 12:06:23 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0effe5fb60bbf1787eb71d2d6802e15f0c379c74
      https://github.com/WebKit/WebKit/commit/0effe5fb60bbf1787eb71d2d6802e15f0c379c74
  Author: Darin Adler <darin at apple.com>
  Date:   2022-10-24 (Mon, 24 Oct 2022)

  Changed paths:
    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/font-parse-numeric-stretch-style-weight-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/font-style-parsing-expected.txt
    M Source/WebCore/css/CSSFontFace.cpp
    M Source/WebCore/css/parser/CSSPropertyParserWorkerSafe.cpp
    M Source/WebCore/style/StyleBuilderConverter.h

  Log Message:
  -----------
  font-style: oblique with calc() should allow out-of-range angles, and clamp them for computed style
https://bugs.webkit.org/show_bug.cgi?id=246909
rdar://problem/101484863

Reviewed by Tim Nguyen.

* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/at-font-face-descriptors-expected.txt:
Updated results. These are still failures, and the reason for this seems to be that either the
specification or the test is incorrect; specification says "specified values are not clamped".

* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/font-parse-numeric-stretch-style-weight-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/variations/font-style-parsing-expected.txt:
Updated for new pass results.

* Source/WebCore/css/CSSFontFace.cpp:
(WebCore::calculateItalicRange): Added calls to Style::BuilderConverter::convertFontStyleAngle,
which does clamping. Also refactored to tighten and simplify the function.

* Source/WebCore/css/parser/CSSPropertyParserWorkerSafe.cpp:
(WebCore::CSSPropertyParserHelpersWorkerSafe::consumeFontStyleAngle): Added. Needed because we
can't use consumeFontStyleRaw, since that discards calculations and turns them into numbers.
This function now only rejects out-of-range angles if the angle's value is *not* calculated.
(WebCore::CSSPropertyParserHelpersWorkerSafe::consumeFontStyleKeywordValue): Deleted.
(WebCore::CSSPropertyParserHelpersWorkerSafe::consumeFontStyleRange): Merged in the
consumeFontStyleKeywordValue function. Refactored this to use the consumeFontStyleAngle
function, and make some other simplifications.
(WebCore::CSSPropertyParserHelpersWorkerSafe::consumeFontStyle): Added. Callers can't use
consumeFontStyleRaw for the reason given above.

* Source/WebCore/style/StyleBuilderConverter.h: Removed redundant assertions that replicate the
assertion already built into the downcast<> function teplate.
(WebCore::Style::BuilderConverter::convertFontStyleAngle): Added. Does the necessary clamping.
(WebCore::Style::BuilderConverter::convertFontStyleFromValue): Call the new function above.

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




More information about the webkit-changes mailing list