Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
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
- Loading branch information
1 parent
013ff9c
commit 0effe5fb60bbf1787eb71d2d6802e15f0c379c74
Showing
6 changed files
with
71 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters