Diff
Modified: trunk/LayoutTests/ChangeLog (217266 => 217267)
--- trunk/LayoutTests/ChangeLog 2017-05-23 04:59:53 UTC (rev 217266)
+++ trunk/LayoutTests/ChangeLog 2017-05-23 06:03:24 UTC (rev 217267)
@@ -1,3 +1,15 @@
+2017-05-22 Myles C. Maxfield <mmaxfi...@apple.com>
+
+ Support calc() in font-variation-settings and font-feature-settings
+ https://bugs.webkit.org/show_bug.cgi?id=171032
+
+ Reviewed by David Hyatt.
+
+ * css3/font-feature-settings-calc-expected.html: Added.
+ * css3/font-feature-settings-calc.html: Added.
+ * fast/text/variations/calc-expected.html: Added.
+ * fast/text/variations/calc.html: Added.
+
2017-05-22 Ryan Haddad <ryanhad...@apple.com>
Mark to imported/w3c/web-platform-tests/webrtc tests as failing on ios-wk2.
Added: trunk/LayoutTests/css3/font-feature-settings-calc-expected.html (0 => 217267)
--- trunk/LayoutTests/css3/font-feature-settings-calc-expected.html (rev 0)
+++ trunk/LayoutTests/css3/font-feature-settings-calc-expected.html 2017-05-23 06:03:24 UTC (rev 217267)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: "FontFeaturesTestOTF";
+ src: url("resources/FontWithFeatures.otf") format("opentype");
+}
+</style>
+</head>
+<body>
+This test makes sure that calc() can be used in font-feature-settings.
+<div style="font: 48px 'FontFeaturesTestOTF';">
+<span style="font-feature-settings: 'zero' 1;">W</span>
+</div>
+</body>
+<html>
Added: trunk/LayoutTests/css3/font-feature-settings-calc.html (0 => 217267)
--- trunk/LayoutTests/css3/font-feature-settings-calc.html (rev 0)
+++ trunk/LayoutTests/css3/font-feature-settings-calc.html 2017-05-23 06:03:24 UTC (rev 217267)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: "FontFeaturesTestOTF";
+ src: url("resources/FontWithFeatures.otf") format("opentype");
+}
+</style>
+</head>
+<body>
+This test makes sure that calc() can be used in font-feature-settings.
+<div style="font: 48px 'FontFeaturesTestOTF';">
+<span style="font-feature-settings: 'zero' calc(3 - 2);">W</span>
+</div>
+</body>
+<html>
Added: trunk/LayoutTests/fast/text/variations/calc-expected.html (0 => 217267)
--- trunk/LayoutTests/fast/text/variations/calc-expected.html (rev 0)
+++ trunk/LayoutTests/fast/text/variations/calc-expected.html 2017-05-23 06:03:24 UTC (rev 217267)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: "Boxis";
+ src: url("resources/Boxis-VF.ttf");
+}
+</style>
+</head>
+<body>
+This test makes sure that calc() works in font-variation-settings.
+<div style="font: 48px 'Boxis'; font-variation-settings: 'desc' 0, 'hght' 750, 'trac' 0, 'wdth' 400;">Hi</div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/text/variations/calc.html (0 => 217267)
--- trunk/LayoutTests/fast/text/variations/calc.html (rev 0)
+++ trunk/LayoutTests/fast/text/variations/calc.html 2017-05-23 06:03:24 UTC (rev 217267)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: "Boxis";
+ src: url("resources/Boxis-VF.ttf");
+}
+</style>
+</head>
+<body>
+This test makes sure that calc() works in font-variation-settings.
+<div style="font: 48px 'Boxis'; font-variation-settings: 'desc' 0, 'hght' 750, 'trac' 0, 'wdth' calc(200 + 200);">Hi</div>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (217266 => 217267)
--- trunk/Source/WebCore/ChangeLog 2017-05-23 04:59:53 UTC (rev 217266)
+++ trunk/Source/WebCore/ChangeLog 2017-05-23 06:03:24 UTC (rev 217267)
@@ -1,3 +1,19 @@
+2017-05-22 Myles C. Maxfield <mmaxfi...@apple.com>
+
+ Support calc() in font-variation-settings and font-feature-settings
+ https://bugs.webkit.org/show_bug.cgi?id=171032
+
+ Reviewed by David Hyatt.
+
+ Tests: css3/font-feature-settings-calc.html
+ fast/text/variations/calc.html
+
+ We can use the convenience functions in CSSPropertyParserHelpers.cpp.
+
+ * css/parser/CSSPropertyParser.cpp:
+ (WebCore::consumeFontFeatureTag):
+ (WebCore::consumeFontVariationTag):
+
2017-05-22 Michael Catanzaro <mcatanz...@igalia.com>
Unreviewed, attempt to fix test runner by removing Unicode character from stderr output
Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (217266 => 217267)
--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp 2017-05-23 04:59:53 UTC (rev 217266)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp 2017-05-23 06:03:24 UTC (rev 217267)
@@ -479,13 +479,14 @@
}
int tagValue = 1;
- // Feature tag values could follow: <integer> | on | off
- if (range.peek().type() == NumberToken && range.peek().numericValueType() == IntegerValueType && range.peek().numericValue() >= 0) {
- tagValue = clampTo<int>(range.consumeIncludingWhitespace().numericValue());
- if (tagValue < 0)
+ if (!range.atEnd() && range.peek().type() != CommaToken) {
+ // Feature tag values could follow: <integer> | on | off
+ if (auto primitiveValue = consumeInteger(range, 0))
+ tagValue = primitiveValue->intValue();
+ else if (range.peek().id() == CSSValueOn || range.peek().id() == CSSValueOff)
+ tagValue = range.consumeIncludingWhitespace().id() == CSSValueOn;
+ else
return nullptr;
- } else if (range.peek().id() == CSSValueOn || range.peek().id() == CSSValueOff) {
- tagValue = range.consumeIncludingWhitespace().id() == CSSValueOn;
}
return CSSFontFeatureValue::create(WTFMove(tag), tagValue);
}
@@ -523,10 +524,13 @@
tag[i] = character;
}
- if (range.atEnd() || range.peek().type() != NumberToken)
+ if (range.atEnd())
return nullptr;
- float tagValue = range.consumeIncludingWhitespace().numericValue();
+ double tagValue = 0;
+ auto success = consumeNumberRaw(range, tagValue);
+ if (!success)
+ return nullptr;
return CSSFontVariationValue::create(tag, tagValue);
}