Upstream version 11.40.277.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / css / DOMWindowCSS.cpp
index 69b7a32..0bf59f9 100644 (file)
 #include "config.h"
 #include "core/css/DOMWindowCSS.h"
 
-#include "core/css/CSSParser.h"
+#include "core/css/CSSPropertyMetadata.h"
 #include "core/css/StylePropertySet.h"
-#include "core/page/RuntimeCSSEnabled.h"
+#include "core/css/parser/CSSParser.h"
 #include "wtf/text/WTFString.h"
 
-namespace WebCore {
+namespace blink {
 
-PassRefPtr<DOMWindowCSS> DOMWindowCSS::create()
+PassRefPtrWillBeRawPtr<DOMWindowCSS> DOMWindowCSS::create()
 {
-    return adoptRef(new DOMWindowCSS());
+    return adoptRefWillBeNoop(new DOMWindowCSS());
 }
 
 static String valueWithoutImportant(const String& value)
@@ -61,9 +61,7 @@ bool DOMWindowCSS::supports(const String& property, const String& value) const
     CSSPropertyID propertyID = cssPropertyID(property.stripWhiteSpace());
     if (propertyID == CSSPropertyInvalid)
         return false;
-
-    if (!RuntimeCSSEnabled::isCSSPropertyEnabled(propertyID))
-        return false;
+    ASSERT(CSSPropertyMetadata::isEnabledProperty(propertyID));
 
     // CSSParser::parseValue() won't work correctly if !important is present,
     // so just get rid of it. It doesn't matter to supports() if it's actually
@@ -74,15 +72,13 @@ bool DOMWindowCSS::supports(const String& property, const String& value) const
     if (normalizedValue.isEmpty())
         return false;
 
-    RefPtr<MutableStylePropertySet> dummyStyle = MutableStylePropertySet::create();
+    RefPtrWillBeRawPtr<MutableStylePropertySet> dummyStyle = MutableStylePropertySet::create();
     return CSSParser::parseValue(dummyStyle.get(), propertyID, normalizedValue, false, HTMLStandardMode, 0);
 }
 
 bool DOMWindowCSS::supports(const String& conditionText) const
 {
-    CSSParserContext context(HTMLStandardMode);
-    CSSParser parser(context);
-    return parser.parseSupportsCondition(conditionText);
+    return CSSParser::parseSupportsCondition(conditionText);
 }
 
 }