Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / css / SVGCSSParser.cpp
index 8c07b14..d6e080e 100644 (file)
@@ -25,7 +25,7 @@
 #include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
 #include "RuntimeEnabledFeatures.h"
-#include "core/css/CSSParser.h"
+#include "core/css/parser/BisonCSSParser.h"
 #include "core/css/CSSValueList.h"
 #include "core/rendering/RenderTheme.h"
 #include "core/svg/SVGPaint.h"
@@ -39,7 +39,7 @@ static bool isSystemColor(int id)
     return (id >= CSSValueActiveborder && id <= CSSValueWindowtext) || id == CSSValueMenu;
 }
 
-bool CSSParser::parseSVGValue(CSSPropertyID propId, bool important)
+bool BisonCSSParser::parseSVGValue(CSSPropertyID propId, bool important)
 {
     CSSParserValue* value = m_valueList->current();
     if (!value)
@@ -197,6 +197,8 @@ bool CSSParser::parseSVGValue(CSSPropertyID propId, bool important)
                         parsedValue = SVGPaint::createURIAndColor(value->string, c);
                     else if (m_valueList->current()->id == CSSValueNone)
                         parsedValue = SVGPaint::createURIAndNone(value->string);
+                    else if (m_valueList->current()->id == CSSValueCurrentcolor)
+                        parsedValue = SVGPaint::createURIAndCurrentColor(value->string);
                 }
                 if (!parsedValue)
                     parsedValue = SVGPaint::createURI(value->string);
@@ -285,7 +287,7 @@ bool CSSParser::parseSVGValue(CSSPropertyID propId, bool important)
     case CSSPropertyMarker:
     {
         ShorthandScope scope(this, propId);
-        CSSParser::ImplicitScope implicitScope(this, PropertyImplicit);
+        BisonCSSParser::ImplicitScope implicitScope(this, PropertyImplicit);
         if (!parseValue(CSSPropertyMarkerStart, important))
             return false;
         if (m_valueList->current()) {
@@ -299,7 +301,7 @@ bool CSSParser::parseSVGValue(CSSPropertyID propId, bool important)
     }
     default:
         // If you crash here, it's because you added a css property and are not handling it
-        // in either this switch statement or the one in CSSParser::parseValue
+        // in either this switch statement or the one in BisonCSSParser::parseValue
         ASSERT_WITH_MESSAGE(0, "unimplemented propertyID: %d", propId);
         return false;
     }
@@ -328,9 +330,9 @@ bool CSSParser::parseSVGValue(CSSPropertyID propId, bool important)
     return true;
 }
 
-PassRefPtr<CSSValue> CSSParser::parseSVGStrokeDasharray()
+PassRefPtr<CSSValue> BisonCSSParser::parseSVGStrokeDasharray()
 {
-    RefPtr<CSSValueList> ret = CSSValueList::createCommaSeparated();
+    RefPtrWillBeRawPtr<CSSValueList> ret = CSSValueList::createCommaSeparated();
     CSSParserValue* value = m_valueList->current();
     bool valid_primitive = true;
     while (value) {
@@ -350,7 +352,7 @@ PassRefPtr<CSSValue> CSSParser::parseSVGStrokeDasharray()
     return ret.release();
 }
 
-PassRefPtr<CSSValue> CSSParser::parseSVGPaint()
+PassRefPtr<CSSValue> BisonCSSParser::parseSVGPaint()
 {
     RGBA32 c = Color::transparent;
     if (!parseColorFromValue(m_valueList->current(), c))
@@ -358,7 +360,7 @@ PassRefPtr<CSSValue> CSSParser::parseSVGPaint()
     return SVGPaint::createColor(Color(c));
 }
 
-PassRefPtr<CSSValue> CSSParser::parseSVGColor()
+PassRefPtr<CSSValue> BisonCSSParser::parseSVGColor()
 {
     RGBA32 c = Color::transparent;
     if (!parseColorFromValue(m_valueList->current(), c))
@@ -367,7 +369,7 @@ PassRefPtr<CSSValue> CSSParser::parseSVGColor()
 }
 
 // normal | [ fill || stroke || markers ]
-PassRefPtr<CSSValue> CSSParser::parsePaintOrder() const
+PassRefPtr<CSSValue> BisonCSSParser::parsePaintOrder() const
 {
     if (m_valueList->size() > 3)
         return 0;
@@ -376,7 +378,7 @@ PassRefPtr<CSSValue> CSSParser::parsePaintOrder() const
     if (!value)
         return 0;
 
-    RefPtr<CSSValueList> parsedValues = CSSValueList::createSpaceSeparated();
+    RefPtrWillBeRawPtr<CSSValueList> parsedValues = CSSValueList::createSpaceSeparated();
 
     // The default paint-order is: Fill, Stroke, Markers.
     bool seenFill = false,