Title: [208706] trunk/Source/WebCore
Revision
208706
Author
[email protected]
Date
2016-11-14 13:37:03 -0800 (Mon, 14 Nov 2016)

Log Message

[CSS Parser] Support the font-synthesis property
https://bugs.webkit.org/show_bug.cgi?id=164728

Reviewed by Dean Jackson.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontSynthesis):
(WebCore::CSSPropertyParser::parseSingleValue):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (208705 => 208706)


--- trunk/Source/WebCore/ChangeLog	2016-11-14 21:18:41 UTC (rev 208705)
+++ trunk/Source/WebCore/ChangeLog	2016-11-14 21:37:03 UTC (rev 208706)
@@ -1,3 +1,14 @@
+2016-11-14  Dave Hyatt  <[email protected]>
+
+        [CSS Parser] Support the font-synthesis property
+        https://bugs.webkit.org/show_bug.cgi?id=164728
+
+        Reviewed by Dean Jackson.
+
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::consumeFontSynthesis):
+        (WebCore::CSSPropertyParser::parseSingleValue):
+
 2016-11-12  Sam Weinig  <[email protected]>
 
         [SVG] Moving more special casing of SVG out of the bindings - SVGNumber/SVGPoint/SVGRect/SVGLength/SVGTransform/SVGMatrix

Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (208705 => 208706)


--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2016-11-14 21:18:41 UTC (rev 208705)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2016-11-14 21:37:03 UTC (rev 208706)
@@ -787,6 +787,35 @@
     return list;
 }
 
+static RefPtr<CSSValue> consumeFontSynthesis(CSSParserTokenRange& range)
+{
+    // none | [ weight || style ]
+    if (range.peek().id() == CSSValueNone)
+        return consumeIdent(range);
+    
+    RefPtr<CSSValue> weight;
+    RefPtr<CSSValue> style;
+    
+    // FIXME: We allow weight and style to occur multiple times because the
+    // old parser did, and layout tests specifically check for it. It seems
+    // wrong though.
+    do {
+        if (range.peek().id() == CSSValueWeight)
+            weight = consumeIdent(range);
+        else if (range.peek().id() == CSSValueStyle)
+            style = consumeIdent(range);
+        else
+            return nullptr;
+    } while (!range.atEnd());
+    
+    auto list = CSSValueList::createSpaceSeparated();
+    if (weight)
+        list->append(weight.releaseNonNull());
+    if (style)
+        list->append(style.releaseNonNull());
+    return WTFMove(list);
+}
+
 static RefPtr<CSSValue> consumeLetterSpacing(CSSParserTokenRange& range, CSSParserMode cssParserMode)
 {
     if (range.peek().id() == CSSValueNormal)
@@ -3348,6 +3377,8 @@
         return consumeFontFamily(m_range);
     case CSSPropertyFontWeight:
         return consumeFontWeight(m_range);
+    case CSSPropertyFontSynthesis:
+        return consumeFontSynthesis(m_range);
     case CSSPropertyLetterSpacing:
         return consumeLetterSpacing(m_range, m_context.mode);
     case CSSPropertyWordSpacing:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to