Title: [209351] trunk/Source/WebCore
Revision
209351
Author
[email protected]
Date
2016-12-05 14:38:37 -0800 (Mon, 05 Dec 2016)

Log Message

[CSS Parser] Support glyph-orientation-horizontal and glyph-orientation-vertical
https://bugs.webkit.org/show_bug.cgi?id=165414

Reviewed by Zalan Bujtas.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeGlyphOrientation):
(WebCore::CSSPropertyParser::parseSingleValue):
Add support for the glyph-orientation-horizontal and glyph-orientation-vertical
properties. They take an angle and allow unitless values.

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeAngle):
Fix a bug in the handling of unitless values for angles. Make sure to
actually pass in the value instead of always doing 0. Blink does not
accept unitless values for angles at all, so this is another difference
to investigate for SVG in the future.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (209350 => 209351)


--- trunk/Source/WebCore/ChangeLog	2016-12-05 22:20:08 UTC (rev 209350)
+++ trunk/Source/WebCore/ChangeLog	2016-12-05 22:38:37 UTC (rev 209351)
@@ -1,3 +1,23 @@
+2016-12-05  Dave Hyatt  <[email protected]>
+
+        [CSS Parser] Support glyph-orientation-horizontal and glyph-orientation-vertical
+        https://bugs.webkit.org/show_bug.cgi?id=165414
+
+        Reviewed by Zalan Bujtas.
+
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::consumeGlyphOrientation):
+        (WebCore::CSSPropertyParser::parseSingleValue):
+        Add support for the glyph-orientation-horizontal and glyph-orientation-vertical
+        properties. They take an angle and allow unitless values.
+
+        * css/parser/CSSPropertyParserHelpers.cpp:
+        (WebCore::CSSPropertyParserHelpers::consumeAngle):
+        Fix a bug in the handling of unitless values for angles. Make sure to
+        actually pass in the value instead of always doing 0. Blink does not
+        accept unitless values for angles at all, so this is another difference
+        to investigate for SVG in the future.
+
 2016-12-05  Ryan Haddad  <[email protected]>
 
         Unreviewed, rolling out r209299.

Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (209350 => 209351)


--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2016-12-05 22:20:08 UTC (rev 209350)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2016-12-05 22:38:37 UTC (rev 209351)
@@ -1968,6 +1968,17 @@
     return consumeColor(range, cssParserMode);
 }
 
+static RefPtr<CSSValue> consumeGlyphOrientation(CSSParserTokenRange& range, CSSParserMode mode, CSSPropertyID property)
+{
+    if (range.peek().id() == CSSValueAuto) {
+        if (property == CSSPropertyGlyphOrientationVertical)
+            return consumeIdent(range);
+        return nullptr;
+    }
+    
+    return consumeAngle(range, mode, UnitlessQuirk::Allow);
+}
+
 static RefPtr<CSSValue> consumePaintOrder(CSSParserTokenRange& range)
 {
     if (range.peek().id() == CSSValueNormal)
@@ -3505,7 +3516,7 @@
 {
     if (range.peek().type() == IdentToken)
         return consumeIdent<CSSValueSmall, CSSValueMedium, CSSValueLarge>(range);
-    return consumeLengthOrPercent(range, cssParserMode, ValueRangeAll);
+    return consumeLengthOrPercent(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Allow);
 }
 
 static RefPtr<CSSValue> consumeWebkitMarqueeRepetition(CSSParserTokenRange& range)
@@ -3937,6 +3948,9 @@
     case CSSPropertyFill:
     case CSSPropertyStroke:
         return consumePaintStroke(m_range, m_context.mode);
+    case CSSPropertyGlyphOrientationVertical:
+    case CSSPropertyGlyphOrientationHorizontal:
+        return consumeGlyphOrientation(m_range, m_context.mode, property);
     case CSSPropertyPaintOrder:
         return consumePaintOrder(m_range);
     case CSSPropertyMarkerStart:

Modified: trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp (209350 => 209351)


--- trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp	2016-12-05 22:20:08 UTC (rev 209350)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp	2016-12-05 22:38:37 UTC (rev 209351)
@@ -287,8 +287,7 @@
         }
     }
     if (token.type() == NumberToken && shouldAcceptUnitlessValue(token.numericValue(), cssParserMode, unitless)) {
-        range.consumeIncludingWhitespace();
-        return CSSValuePool::singleton().createValue(0, CSSPrimitiveValue::UnitTypes::CSS_DEG);
+        return CSSValuePool::singleton().createValue(range.consumeIncludingWhitespace().numericValue(), CSSPrimitiveValue::UnitTypes::CSS_DEG);
     }
 
     CalcParser calcParser(range, ValueRangeAll);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to