Skip to content

Commit

Permalink
font-face must accept ranges in reverse order, and reverse them for *…
Browse files Browse the repository at this point in the history
…computed* style

https://bugs.webkit.org/show_bug.cgi?id=246585
rdar://problem/101210777

[ Mac ] imported/w3c/web-platform-tests/server-timing/service_worker_idl.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=219907
rdar://problem/72351272

https://bugs.webkit.org/show_bug.cgi?id=244900
New Test(254036@main): [ iOS macOS Debug ] 3X imported/w3c/web-platform-tests/dom/nodes/NodeList-static-length-getter-tampered-indexOf-(Layout tests) are constant timeouts
rdar://problem/99657326

Reviewed by Tim Nguyen.

The biggest change here is to store the specified values in CSSFontFace. The existing code was
not storing these values, and when querying it would return a computed value, but that is not
the same thing. We store the values either in the style properties of a StyleRuleFontFace if this
font face is connected to a CSS style rule, or in our own MutableStyleProperties object if it is
not connected.

When it comes to tests, many of the ones we wrote for WebKit were expecting the computed values,
but the web platform tests were expecting the specified values. The WebKit ones needed some
updating to expect the correct behavior.

* LayoutTests/fast/text/font-face-javascript-expected.txt:
* LayoutTests/fast/text/font-face-javascript.html: Updated to expect the style attribute to return
the specified style "oblique" rather than the computed style "italic".

* LayoutTests/fast/text/font-loading-font-display-expected.txt:
* LayoutTests/fast/text/font-loading-font-display.html: Updated to expect font-display to get set
to "auto" when we set the display attribute on a FontFace to "auto". The old code expected the
empty string, but a review of the specification makes it clear that was not correct.

* LayoutTests/fast/text/font-selection-font-face-parse-expected.txt:
* LayoutTests/fast/text/font-selection-font-face-parse.html: Updated since out of order ranges now
are parsed successfully. There was one test case each for fontWeight, fontStretch, and fontStyle
that was affected.

* LayoutTests/fast/text/font-selection-font-loading-api-parse-expected.txt:
* LayoutTests/fast/text/font-selection-font-loading-api-parse.html: Updated since the style
attribute now returns the specified style rather than the computed style. That means we get "400"
instead of "normal" and "700" instead of "bold", and other similar changes.

* LayoutTests/fast/text/variations/font-loading-api-parse-ranges-expected.txt:
* LayoutTests/fast/text/variations/font-loading-api-parse-ranges.html: Updated since out of order
ranges are now parsed successfully. There was one case each for weight, stretch, and style that
was affected.

* LayoutTests/TestExpectations: Removed expectation for simulcast-h264.html, which has been removed.

* LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-face-range-order-expected.txt:
* 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-font-matching-expected.txt:
* 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 expected results. These are mostly progressions. In a few cases we have a test that is
newly failing because we are now parsing font-face correctly and matching incorrectly. In those
cases the old version failed to parse so the test was saying PASS but that was a false negative.

* LayoutTests/platform/gtk/fast/text/font-selection-font-loading-api-parse-expected.txt: Removed.
* LayoutTests/platform/ios/fast/text/font-selection-font-face-parse-expected.txt: Removed.
* LayoutTests/platform/ios/fast/text/font-selection-font-loading-api-parse-expected.txt: Removed.
* LayoutTests/platform/mac/fast/text/font-selection-font-face-parse-expected.txt: Removed.
* LayoutTests/platform/mac/fast/text/font-selection-font-loading-api-parse-expected.txt: Removed.
* LayoutTests/platform/wpe/fast/text/font-selection-font-face-parse-expected.txt: Removed.
* LayoutTests/platform/wpe/fast/text/font-selection-font-loading-api-parse-expected.txt: Removed.

* LayoutTests/platform/mac/TestExpectations: Removed expectations for service_worker_idl.html and
NodeList-static-length-getter-tampered-indexOf-[1-3].html, which have been removed.

* Source/WebCore/css/CSSFontFace.cpp:
(WebCore::propertiesOrCSSConnection): Added. Helper for the below. Could have used a lambda, but then
the style checker would have gotten all confused.
(WebCore::CSSFontFace::CSSFontFace): Initialize m_propertiesOrCSSConnection.
(WebCore::CSSFontFace::properties): Added.
(WebCore::CSSFontFace::mutableProperties): Added.
(WebCore::CSSFontFace::cssConnection): Moved here from the header.
(WebCore::CSSFontFace::setFamilies): Changed argument type to CSSValueList. Use mutableProperties.
Removed unneeded boolean return value.
(WebCore::CSSFontFace::setWeight): Use mutableProperties. Set the weight in
m_fontSelectionCapabilities directly rather than using a helper function.
(WebCore::CSSFontFace::setStretch): Use mutableProperties. Set the stretch in
m_fontSelectionCapabilities directly rather than using a helper function.
(WebCore::CSSFontFace::setStyle): Use mutableProperties. Set the slope in
m_fontSelectionCapabilities directly rather than using a helper function.
(WebCore::CSSFontFace::setUnicodeRange): Changed argument type to CSSValueList. Use
mutableProperties. Removed unneeded boolean return value.
(WebCore::CSSFontFace::setFeatureSettings): Use mutableProperties. Renamed the
existing data member to m_parsedFeatureSettings.
(WebCore::CSSFontFace::setDisplay): Renamed from setLoadingBehavior to match the terminology in the
specification. Use mutableProperties. Changed the argument type to CSSPrimitiveValue.
(WebCore::CSSFontFace::family const): Added. Gets the property from the properties object. Moved
logic here, to work around the fact that we use a list, from FontFace::family.
(WebCore::CSSFontFace::style const): Ditto.
(WebCore::CSSFontFace::weight const): Ditto.
(WebCore::CSSFontFace::stretch const): Ditto.
(WebCore::CSSFontFace::unicodeRange const): Ditto.
(WebCore::CSSFontFace::featureSettings const): Ditto.
(WebCore::CSSFontFace::display const): Ditto.
(WebCore::CSSFontFace::families const): Just a simple getter, here so the header does not have
to include CSSValueList.h.

* Source/WebCore/css/CSSFontFace.h: Updated for the above. Removed the functions that returned
various computed properties, and instead have functions that return the specified properties
as strings since that is what FontFace needs for its interface. The only ones that return computed
properties that are kept are families, ranges, and fontSelectionCapabilities; they could probably
use names that make it clear they return computed values. Return a span instead of a vector from
the ranges function, a pointer instead of an optional pointer from the families function, and a
non-optional FontSelectionCapabilities from the fontSelectionCapabilities function. Added private
member functions named properties and mutableProperties and replaced m_cssConnection with a
private data member named m_propertiesOrCSSConnection. These store the specified property values
in the appropriate place whether or not a CSS connection exists.

* Source/WebCore/css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered): Added a comment.
(WebCore::CSSFontFaceSet::addToFacesLookupTable): Updated for the return type change of
CSSFontFace::families.
(WebCore::CSSFontFaceSet::remove): Ditto.
(WebCore::CSSFontFaceSet::fontFace): Updated to check the loading staus explicitly instead of
doing it implicitly with the optional status of fontSelectionCapabilities. This makes it more
explicit what this is doing, and perhaps might even lead us to discover the code is unneeded later.
Updated since fontSelectionCapabilities return type is no longer optional.

* Source/WebCore/css/CSSFontFaceSet.h: Added newly-needed forward declaration.

* Source/WebCore/css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule): Updated for changes to CSSFontFace::setFamilies,
CSSFontFace::setUnicodeRange, and CSSFontFace::setDisplay.

* Source/WebCore/css/CSSFontSelector.h: Removed unneeded forward declaration.

* Source/WebCore/css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::fontRanges): Updated for changes to CSSFontFace::ranges and
CSSFontFace::fontSelectionCapabilities.

* Source/WebCore/css/FontFace.cpp:
(WebCore::FontFace::setFamily): Updated for change to CSSFontFace::setFamilies.
(WebCore::FontFace::setStyle): Removed unneeded special case for empty string; the
CSSPropertyParserWorkerSafe::parseFontFaceStyle function fails to parse it.
(WebCore::FontFace::setWeight): Removed unneeded special case for empty string, since the
CSSPropertyParserWorkerSafe::parseFontFaceWeight function fails to parse it.
(WebCore::FontFace::setStretch): Removed unneeded special case for empty string, since the
CSSPropertyParserWorkerSafe::parseFontFaceStretch function fails to parse it.
(WebCore::FontFace::setUnicodeRange): Removed unneeded special case for empty string, since the
CSSPropertyParserWorkerSafe::parseFontFaceUnicodeRange function fails to parse it. Also updated
for change to CSSFontFace::setUnicodeRange.
(WebCore::FontFace::setFeatureSettings): Removed unneeded special case for empty string, since the
CSSPropertyParserWorkerSafe::parseFontFaceFeatureSettings function fails to parse it. Changed
the coding style to match the other surrounding functions.
(WebCore::FontFace::setDisplay): Removed unneeded special case for empty string, since the
CSSPropertyParserWorkerSafe::parseFontFaceDisplay function fails to parse it. Updated for the
change to CSSFontFace::setDisplay.
(WebCore::FontFace::family const): Instead of a computed value string, get the specified value
string by calling the function on the CSSFontFace.
(WebCore::FontFace::style const): Ditto.
(WebCore::FontFace::weight const): Ditto.
(WebCore::FontFace::stretch const): Ditto.
(WebCore::FontFace::unicodeRange const): Ditto.
(WebCore::FontFace::featureSettings const): Ditto.
(WebCore::FontFace::display const): Ditto.

* Source/WebCore/css/FontFace.h: Removed ScriptExecutionContext argument from display getter.
* Source/WebCore/css/FontFace.idl: Updated for the above.

* Source/WebCore/css/parser/CSSPropertyParserHelpers.h:
(WebCore::CSSPropertyParserHelpers::isFontStyleAngleInRange): Updated to allow -90 and 90
degrees as specified.

* Source/WebCore/css/parser/CSSPropertyParserWorkerSafe.cpp:
(WebCore::CSSPropertyParserWorkerSafe::parseFontFaceUnicodeRange): Return CSSValueList.
(WebCore::CSSPropertyParserWorkerSafe::parseFontFaceDisplay): Return CSSPrimitiveValue.
(WebCore::CSSPropertyParserHelpersWorkerSafe::consumeFontStyleRange): Removed the check that the
two angles are in order. This is now handled as part of style computation instead.
(WebCore::CSSPropertyParserHelpersWorkerSafe::consumeFontWeightAbsoluteRange): Removed the check
that the two weights are in order. This is now handled as part of style computation instead.
(WebCore::CSSPropertyParserHelpersWorkerSafe::consumeFontStretchRange): Removed the check that the
two stretches are in order. This is now handled as part of style computation instead.

* Source/WebCore/css/parser/CSSPropertyParserWorkerSafe.h: Updated the return types mentioned above.

* Source/WebCore/platform/graphics/FontSelectionAlgorithm.h: Change the FontSelectionRange
constructor to sort the two values so either can be the minimum and either can be the maximum.
This is the behavior the specification calls for. And it's required we do this sorting as part
of the computation process, rather than when parsing the specified values.

Canonical link: https://commits.webkit.org/255893@main
  • Loading branch information
darinadler committed Oct 23, 2022
1 parent 0acf245 commit 30bf0f9
Show file tree
Hide file tree
Showing 36 changed files with 334 additions and 951 deletions.
1 change: 0 additions & 1 deletion LayoutTests/TestExpectations
Expand Up @@ -2304,7 +2304,6 @@ webrtc/h265.html [ Pass Failure ]

webrtc/vp9-vtb.html [ Skip ]

webrtc/simulcast-h264.html [ Slow ]
webrtc/h264-baseline.html [ Slow ]
webrtc/h264-high.html [ Slow ]

Expand Down
2 changes: 1 addition & 1 deletion LayoutTests/fast/text/font-face-javascript-expected.txt
Expand Up @@ -7,7 +7,7 @@ PASS new FontFace('family_name', 'url(\'asdf\')', {}).featureSettings is "normal
PASS new FontFace('family_name', 'url(\'asdf\')', {'style': 'normal'}).style is "normal"
PASS new FontFace('family_name', 'url(\'asdf\')', {'style': 'inherit'}).status is "error"
PASS new FontFace('family_name', 'url(\'asdf\')', {'style': 'italic'}).style is "italic"
PASS new FontFace('family_name', 'url(\'asdf\')', {'style': 'oblique'}).style is "italic"
PASS new FontFace('family_name', 'url(\'asdf\')', {'style': 'oblique'}).style is "oblique"
PASS new FontFace('family_name', 'url(\'asdf\')', {'style': 'asdf'}).status is "error"
PASS new FontFace('family_name', 'url(\'asdf\')', {'weight': 'normal'}).weight is "normal"
PASS new FontFace('family_name', 'url(\'asdf\')', {'weight': '200'}).weight is "200"
Expand Down
2 changes: 1 addition & 1 deletion LayoutTests/fast/text/font-face-javascript.html
Expand Up @@ -15,7 +15,7 @@
shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'style': 'normal'}).style", "normal");
shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'style': 'inherit'}).status","error");
shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'style': 'italic'}).style", "italic");
shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'style': 'oblique'}).style", "italic");
shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'style': 'oblique'}).style", "oblique");
shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'style': 'asdf'}).status", "error");
shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'weight': 'normal'}).weight", "normal");
shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'weight': '200'}).weight", "200");
Expand Down
@@ -1,6 +1,6 @@
PASS fontFaceRule.style.getPropertyValue('font-display') is ""
PASS fontFace.display is "auto"
PASS fontFaceRule.style.getPropertyValue('font-display') is ""
PASS fontFaceRule.style.getPropertyValue('font-display') is "auto"
PASS fontFace.display is "auto"
PASS fontFaceRule.style.getPropertyValue('font-display') is "block"
PASS fontFace.display is "block"
Expand Down
2 changes: 1 addition & 1 deletion LayoutTests/fast/text/font-loading-font-display.html
Expand Up @@ -21,7 +21,7 @@
let values = ["auto", "block", "swap", "fallback", "optional"];
for (let value of values) {
fontFace.display = value;
shouldBeEqualToString("fontFaceRule.style.getPropertyValue('font-display')", value == "auto" ? "" : value);
shouldBeEqualToString("fontFaceRule.style.getPropertyValue('font-display')", value);
shouldBeEqualToString("fontFace.display", value);
}
shouldThrow("fontFace.display = 'garbage'");
Expand Down
56 changes: 28 additions & 28 deletions LayoutTests/fast/text/font-selection-font-face-parse-expected.txt
@@ -1,4 +1,4 @@
FAIL weightTestSheet.cssRules[0].style.fontWeight should be 1. Was .
PASS weightTestSheet.cssRules[0].style.fontWeight is "1"
PASS weightTestSheet.cssRules[1].style.fontWeight is "100"
PASS weightTestSheet.cssRules[2].style.fontWeight is "200"
PASS weightTestSheet.cssRules[3].style.fontWeight is "300"
Expand All @@ -13,23 +13,23 @@ PASS weightTestSheet.cssRules[11].style.fontWeight is "900"
PASS weightTestSheet.cssRules[12].style.fontWeight is ""
PASS weightTestSheet.cssRules[13].style.fontWeight is ""
PASS weightTestSheet.cssRules[14].style.fontWeight is ""
FAIL weightTestSheet.cssRules[15].style.fontWeight should be 7. Was .
PASS weightTestSheet.cssRules[15].style.fontWeight is "7"
PASS weightTestSheet.cssRules[16].style.fontWeight is "300"
PASS weightTestSheet.cssRules[17].style.fontWeight is "200"
FAIL weightTestSheet.cssRules[18].style.fontWeight should be 100 200. Was .
FAIL weightTestSheet.cssRules[19].style.fontWeight should be 100 200. Was .
PASS weightTestSheet.cssRules[18].style.fontWeight is "100 200"
PASS weightTestSheet.cssRules[19].style.fontWeight is "100 200"
PASS weightTestSheet.cssRules[20].style.fontWeight is ""
PASS weightTestSheet.cssRules[21].style.fontWeight is ""
PASS weightTestSheet.cssRules[22].style.fontWeight is ""
PASS weightTestSheet.cssRules[23].style.fontWeight is ""
PASS weightTestSheet.cssRules[24].style.fontWeight is ""
PASS weightTestSheet.cssRules[25].style.fontWeight is ""
FAIL weightTestSheet.cssRules[26].style.fontWeight should be 1 2. Was .
PASS weightTestSheet.cssRules[26].style.fontWeight is "1 2"
PASS weightTestSheet.cssRules[27].style.fontWeight is ""
PASS weightTestSheet.cssRules[28].style.fontWeight is ""
FAIL weightTestSheet.cssRules[29].style.fontWeight should be 7 8. Was .
FAIL weightTestSheet.cssRules[30].style.fontWeight should be 2 7. Was .
FAIL stretchTestSheet.cssRules[0].style.fontStretch should be 1%. Was .
PASS weightTestSheet.cssRules[28].style.fontWeight is "2 1"
PASS weightTestSheet.cssRules[29].style.fontWeight is "7 8"
PASS weightTestSheet.cssRules[30].style.fontWeight is "2 7"
PASS stretchTestSheet.cssRules[0].style.fontStretch is "1%"
PASS stretchTestSheet.cssRules[1].style.fontStretch is ""
PASS stretchTestSheet.cssRules[2].style.fontStretch is "ultra-condensed"
PASS stretchTestSheet.cssRules[3].style.fontStretch is "extra-condensed"
Expand All @@ -54,27 +54,27 @@ PASS stretchTestSheet.cssRules[21].style.fontStretch is ""
PASS stretchTestSheet.cssRules[22].style.fontStretch is ""
PASS stretchTestSheet.cssRules[23].style.fontStretch is ""
PASS stretchTestSheet.cssRules[24].style.fontStretch is ""
FAIL stretchTestSheet.cssRules[25].style.fontStretch should be 100% 200%. Was .
FAIL stretchTestSheet.cssRules[26].style.fontStretch should be 100% 200%. Was .
PASS stretchTestSheet.cssRules[25].style.fontStretch is "100% 200%"
PASS stretchTestSheet.cssRules[26].style.fontStretch is "100% 200%"
PASS stretchTestSheet.cssRules[27].style.fontStretch is ""
PASS stretchTestSheet.cssRules[28].style.fontStretch is ""
PASS stretchTestSheet.cssRules[29].style.fontStretch is ""
PASS stretchTestSheet.cssRules[30].style.fontStretch is ""
PASS stretchTestSheet.cssRules[31].style.fontStretch is ""
PASS stretchTestSheet.cssRules[32].style.fontStretch is ""
FAIL stretchTestSheet.cssRules[33].style.fontStretch should be 1% 2%. Was .
PASS stretchTestSheet.cssRules[33].style.fontStretch is "1% 2%"
PASS stretchTestSheet.cssRules[34].style.fontStretch is ""
PASS stretchTestSheet.cssRules[35].style.fontStretch is ""
PASS stretchTestSheet.cssRules[35].style.fontStretch is "2% 1%"
PASS stretchTestSheet.cssRules[36].style.fontStretch is ""
PASS stretchTestSheet.cssRules[37].style.fontStretch is ""
PASS stretchTestSheet.cssRules[38].style.fontStretch is ""
PASS stretchTestSheet.cssRules[39].style.fontStretch is ""
FAIL stretchTestSheet.cssRules[40].style.fontStretch should be calc(7%) 8%. Was .
FAIL stretchTestSheet.cssRules[41].style.fontStretch should be 2% calc(7%). Was .
FAIL styleTestSheet.cssRules[0].style.fontStyle should be oblique 1deg. Was .
FAIL styleTestSheet.cssRules[1].style.fontStyle should be oblique 20grad. Was .
FAIL styleTestSheet.cssRules[2].style.fontStyle should be oblique 0.28318rad. Was .
FAIL styleTestSheet.cssRules[3].style.fontStyle should be oblique 0.04turn. Was .
PASS stretchTestSheet.cssRules[40].style.fontStretch is "calc(7%) 8%"
PASS stretchTestSheet.cssRules[41].style.fontStretch is "2% calc(7%)"
PASS styleTestSheet.cssRules[0].style.fontStyle is "oblique 1deg"
PASS styleTestSheet.cssRules[1].style.fontStyle is "oblique 20grad"
PASS styleTestSheet.cssRules[2].style.fontStyle is "oblique 0.28318rad"
PASS styleTestSheet.cssRules[3].style.fontStyle is "oblique 0.04turn"
PASS styleTestSheet.cssRules[4].style.fontStyle is ""
PASS styleTestSheet.cssRules[5].style.fontStyle is ""
PASS styleTestSheet.cssRules[6].style.fontStyle is "italic"
Expand All @@ -83,7 +83,7 @@ PASS styleTestSheet.cssRules[8].style.fontStyle is "normal"
PASS styleTestSheet.cssRules[9].style.fontStyle is ""
PASS styleTestSheet.cssRules[10].style.fontStyle is ""
PASS styleTestSheet.cssRules[11].style.fontStyle is ""
FAIL styleTestSheet.cssRules[12].style.fontStyle should be oblique calc(15.4deg). Was .
PASS styleTestSheet.cssRules[12].style.fontStyle is "oblique calc(15.4deg)"
PASS styleTestSheet.cssRules[13].style.fontStyle is ""
PASS styleTestSheet.cssRules[14].style.fontStyle is ""
PASS styleTestSheet.cssRules[15].style.fontStyle is ""
Expand All @@ -95,24 +95,24 @@ PASS styleTestSheet.cssRules[20].style.fontStyle is ""
PASS styleTestSheet.cssRules[21].style.fontStyle is ""
PASS styleTestSheet.cssRules[22].style.fontStyle is ""
PASS styleTestSheet.cssRules[23].style.fontStyle is ""
FAIL styleTestSheet.cssRules[24].style.fontStyle should be oblique 10deg 20deg. Was .
FAIL styleTestSheet.cssRules[25].style.fontStyle should be oblique 10deg 20deg. Was .
PASS styleTestSheet.cssRules[24].style.fontStyle is "oblique 10deg 20deg"
PASS styleTestSheet.cssRules[25].style.fontStyle is "oblique 10deg 20deg"
PASS styleTestSheet.cssRules[26].style.fontStyle is ""
PASS styleTestSheet.cssRules[27].style.fontStyle is ""
PASS styleTestSheet.cssRules[28].style.fontStyle is ""
PASS styleTestSheet.cssRules[29].style.fontStyle is ""
PASS styleTestSheet.cssRules[30].style.fontStyle is ""
PASS styleTestSheet.cssRules[31].style.fontStyle is ""
FAIL styleTestSheet.cssRules[32].style.fontStyle should be oblique 1deg 2deg. Was .
FAIL styleTestSheet.cssRules[33].style.fontStyle should be oblique -2deg -1deg. Was .
PASS styleTestSheet.cssRules[34].style.fontStyle is ""
PASS styleTestSheet.cssRules[32].style.fontStyle is "oblique 1deg 2deg"
PASS styleTestSheet.cssRules[33].style.fontStyle is "oblique -2deg -1deg"
PASS styleTestSheet.cssRules[34].style.fontStyle is "oblique 2deg 1deg"
PASS styleTestSheet.cssRules[35].style.fontStyle is ""
PASS styleTestSheet.cssRules[36].style.fontStyle is ""
FAIL styleTestSheet.cssRules[37].style.fontStyle should be oblique 2deg 4grad. Was .
PASS styleTestSheet.cssRules[37].style.fontStyle is "oblique 2deg 4grad"
PASS styleTestSheet.cssRules[38].style.fontStyle is ""
PASS styleTestSheet.cssRules[39].style.fontStyle is ""
FAIL styleTestSheet.cssRules[40].style.fontStyle should be oblique calc(7deg) 8deg. Was .
FAIL styleTestSheet.cssRules[41].style.fontStyle should be oblique 2deg calc(7deg). Was .
PASS styleTestSheet.cssRules[40].style.fontStyle is "oblique calc(7deg) 8deg"
PASS styleTestSheet.cssRules[41].style.fontStyle is "oblique 2deg calc(7deg)"
PASS successfullyParsed is true

TEST COMPLETE
Expand Down
6 changes: 3 additions & 3 deletions LayoutTests/fast/text/font-selection-font-face-parse.html
Expand Up @@ -386,7 +386,7 @@
shouldBeEqualToString("weightTestSheet.cssRules[25].style.fontWeight", "");
shouldBeEqualToString("weightTestSheet.cssRules[26].style.fontWeight", "1 2");
shouldBeEqualToString("weightTestSheet.cssRules[27].style.fontWeight", "");
shouldBeEqualToString("weightTestSheet.cssRules[28].style.fontWeight", "");
shouldBeEqualToString("weightTestSheet.cssRules[28].style.fontWeight", "2 1");
shouldBeEqualToString("weightTestSheet.cssRules[29].style.fontWeight", "7 8");
shouldBeEqualToString("weightTestSheet.cssRules[30].style.fontWeight", "2 7");

Expand Down Expand Up @@ -426,7 +426,7 @@
shouldBeEqualToString("stretchTestSheet.cssRules[32].style.fontStretch", "");
shouldBeEqualToString("stretchTestSheet.cssRules[33].style.fontStretch", "1% 2%");
shouldBeEqualToString("stretchTestSheet.cssRules[34].style.fontStretch", "");
shouldBeEqualToString("stretchTestSheet.cssRules[35].style.fontStretch", "");
shouldBeEqualToString("stretchTestSheet.cssRules[35].style.fontStretch", "2% 1%");
shouldBeEqualToString("stretchTestSheet.cssRules[36].style.fontStretch", "");
shouldBeEqualToString("stretchTestSheet.cssRules[37].style.fontStretch", "");
shouldBeEqualToString("stretchTestSheet.cssRules[38].style.fontStretch", "");
Expand Down Expand Up @@ -470,7 +470,7 @@
shouldBeEqualToString("styleTestSheet.cssRules[31].style.fontStyle", "");
shouldBeEqualToString("styleTestSheet.cssRules[32].style.fontStyle", "oblique 1deg 2deg");
shouldBeEqualToString("styleTestSheet.cssRules[33].style.fontStyle", "oblique -2deg -1deg");
shouldBeEqualToString("styleTestSheet.cssRules[34].style.fontStyle", "");
shouldBeEqualToString("styleTestSheet.cssRules[34].style.fontStyle", "oblique 2deg 1deg");
shouldBeEqualToString("styleTestSheet.cssRules[35].style.fontStyle", "");
shouldBeEqualToString("styleTestSheet.cssRules[36].style.fontStyle", "");
shouldBeEqualToString("styleTestSheet.cssRules[37].style.fontStyle", "oblique 2deg 4grad");
Expand Down
@@ -1,21 +1,21 @@
FAIL setFontFaceWeight(fontFace, '1') should be 1. Threw exception SyntaxError: The string did not match the expected pattern.
PASS setFontFaceWeight(fontFace, '1') is "1"
PASS setFontFaceWeight(fontFace, '100') is "100"
PASS setFontFaceWeight(fontFace, '200') is "200"
PASS setFontFaceWeight(fontFace, '300') is "300"
PASS setFontFaceWeight(fontFace, '400') is "normal"
PASS setFontFaceWeight(fontFace, '400') is "400"
PASS setFontFaceWeight(fontFace, 'normal') is "normal"
PASS setFontFaceWeight(fontFace, '500') is "500"
PASS setFontFaceWeight(fontFace, '600') is "600"
PASS setFontFaceWeight(fontFace, '700') is "bold"
PASS setFontFaceWeight(fontFace, '700') is "700"
PASS setFontFaceWeight(fontFace, 'bold') is "bold"
PASS setFontFaceWeight(fontFace, '800') is "800"
PASS setFontFaceWeight(fontFace, '900') is "900"
PASS setFontFaceWeight(fontFace, 'garbage') threw exception SyntaxError: The string did not match the expected pattern..
PASS setFontFaceWeight(fontFace, 'initial') threw exception SyntaxError: The string did not match the expected pattern..
FAIL setFontFaceWeight(fontFace, 'calc(3 + 4)') should be 7. Threw exception SyntaxError: The string did not match the expected pattern.
PASS setFontFaceWeight(fontFace, 'calc(3 + 4)') is "7"
PASS setFontFaceWeight(fontFace, 'calc(100 + 200)') is "300"
PASS setFontFaceWeight(fontFace, 'calc(150 + 50)') is "200"
FAIL setFontFaceStretch(fontFace, '1%') should be 1%. Threw exception SyntaxError: The string did not match the expected pattern.
PASS setFontFaceStretch(fontFace, '1%') is "1%"
PASS setFontFaceStretch(fontFace, '2') threw exception SyntaxError: The string did not match the expected pattern..
PASS setFontFaceStretch(fontFace, 'ultra-condensed') is "ultra-condensed"
PASS setFontFaceStretch(fontFace, 'extra-condensed') is "extra-condensed"
Expand All @@ -29,20 +29,20 @@ PASS setFontFaceStretch(fontFace, 'ultra-expanded') is "ultra-expanded"
PASS setFontFaceStretch(fontFace, 'garbage') threw exception SyntaxError: The string did not match the expected pattern..
PASS setFontFaceStretch(fontFace, 'initial') threw exception SyntaxError: The string did not match the expected pattern..
PASS setFontFaceStretch(fontFace, 'calc(3 + 4)') threw exception SyntaxError: The string did not match the expected pattern..
FAIL setFontFaceStretch(fontFace, 'calc(3% + 4%)') should be 7%. Threw exception SyntaxError: The string did not match the expected pattern.
FAIL setFontFaceStyle(fontFace, 'oblique 1deg') should be oblique 1deg. Threw exception SyntaxError: The string did not match the expected pattern.
FAIL setFontFaceStyle(fontFace, 'oblique 20grad') should be oblique 18deg. Threw exception SyntaxError: The string did not match the expected pattern.
FAIL setFontFaceStyle(fontFace, 'oblique 0.28318rad') should be oblique 16deg. Threw exception SyntaxError: The string did not match the expected pattern.
FAIL setFontFaceStyle(fontFace, 'oblique 0.04turn') should be oblique 14.25deg. Threw exception SyntaxError: The string did not match the expected pattern.
PASS setFontFaceStretch(fontFace, 'calc(3% + 4%)') is "calc(7%)"
PASS setFontFaceStyle(fontFace, 'oblique 1deg') is "oblique 1deg"
PASS setFontFaceStyle(fontFace, 'oblique 20grad') is "oblique 20grad"
PASS setFontFaceStyle(fontFace, 'oblique 0.28318rad') is "oblique 0.28318rad"
PASS setFontFaceStyle(fontFace, 'oblique 0.04turn') is "oblique 0.04turn"
PASS setFontFaceStyle(fontFace, 'oblique 5') threw exception SyntaxError: The string did not match the expected pattern..
PASS setFontFaceStyle(fontFace, 'oblique 20') threw exception SyntaxError: The string did not match the expected pattern..
PASS setFontFaceStyle(fontFace, 'italic') is "italic"
PASS setFontFaceStyle(fontFace, 'oblique') is "italic"
PASS setFontFaceStyle(fontFace, 'oblique') is "oblique"
PASS setFontFaceStyle(fontFace, 'normal') is "normal"
PASS setFontFaceStyle(fontFace, 'garbage') threw exception SyntaxError: The string did not match the expected pattern..
PASS setFontFaceStyle(fontFace, 'initial') threw exception SyntaxError: The string did not match the expected pattern..
PASS setFontFaceStyle(fontFace, 'oblique calc(3 + 4)') threw exception SyntaxError: The string did not match the expected pattern..
FAIL setFontFaceStyle(fontFace, 'oblique calc(0.04turn + 1deg)') should be oblique 15.25deg. Threw exception SyntaxError: The string did not match the expected pattern.
PASS setFontFaceStyle(fontFace, 'oblique calc(0.04turn + 1deg)') is "oblique calc(15.4deg)"
PASS successfullyParsed is true

TEST COMPLETE
Expand Down
16 changes: 8 additions & 8 deletions LayoutTests/fast/text/font-selection-font-loading-api-parse.html
Expand Up @@ -25,11 +25,11 @@
shouldBeEqualToString("setFontFaceWeight(fontFace, '100')", "100");
shouldBeEqualToString("setFontFaceWeight(fontFace, '200')", "200");
shouldBeEqualToString("setFontFaceWeight(fontFace, '300')", "300");
shouldBeEqualToString("setFontFaceWeight(fontFace, '400')", "normal");
shouldBeEqualToString("setFontFaceWeight(fontFace, '400')", "400");
shouldBeEqualToString("setFontFaceWeight(fontFace, 'normal')", "normal");
shouldBeEqualToString("setFontFaceWeight(fontFace, '500')", "500");
shouldBeEqualToString("setFontFaceWeight(fontFace, '600')", "600");
shouldBeEqualToString("setFontFaceWeight(fontFace, '700')", "bold");
shouldBeEqualToString("setFontFaceWeight(fontFace, '700')", "700");
shouldBeEqualToString("setFontFaceWeight(fontFace, 'bold')", "bold");
shouldBeEqualToString("setFontFaceWeight(fontFace, '800')", "800");
shouldBeEqualToString("setFontFaceWeight(fontFace, '900')", "900");
Expand All @@ -53,21 +53,21 @@
shouldThrow("setFontFaceStretch(fontFace, 'garbage')");
shouldThrow("setFontFaceStretch(fontFace, 'initial')");
shouldThrow("setFontFaceStretch(fontFace, 'calc(3 + 4)')");
shouldBeEqualToString("setFontFaceStretch(fontFace, 'calc(3% + 4%)')", "7%");
shouldBeEqualToString("setFontFaceStretch(fontFace, 'calc(3% + 4%)')", "calc(7%)");

shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 1deg')", "oblique 1deg");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 20grad')", "oblique 18deg");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 0.28318rad')", "oblique 16deg");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 0.04turn')", "oblique 14.25deg");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 20grad')", "oblique 20grad");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 0.28318rad')", "oblique 0.28318rad");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 0.04turn')", "oblique 0.04turn");
shouldThrow("setFontFaceStyle(fontFace, 'oblique 5')");
shouldThrow("setFontFaceStyle(fontFace, 'oblique 20')");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'italic')", "italic");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique')", "italic");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique')", "oblique");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'normal')", "normal");
shouldThrow("setFontFaceStyle(fontFace, 'garbage')");
shouldThrow("setFontFaceStyle(fontFace, 'initial')");
shouldThrow("setFontFaceStyle(fontFace, 'oblique calc(3 + 4)')");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique calc(0.04turn + 1deg)')", "oblique 15.25deg");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique calc(0.04turn + 1deg)')", "oblique calc(15.4deg)");
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
Expand Down

0 comments on commit 30bf0f9

Please sign in to comment.