Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(559)

Unified Diff: Source/core/css/DOMWindowCSS.cpp

Issue 14324009: Add support for disabling CSS Properties at runtime (Closed) Base URL: http://src.chromium.org/blink/trunk/Source/
Patch Set: Runtime guard more uses of CSSPropertyID, per Elliot's request. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSParser.cpp ('k') | Source/core/css/StylePropertySet.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/DOMWindowCSS.cpp
diff --git a/Source/core/css/DOMWindowCSS.cpp b/Source/core/css/DOMWindowCSS.cpp
index f9aa060c00211832fa5885a2559afb69517c744d..410f5c5b77d7b05835260a14fc959e8b6282e0da 100644
--- a/Source/core/css/DOMWindowCSS.cpp
+++ b/Source/core/css/DOMWindowCSS.cpp
@@ -31,6 +31,7 @@
#include "DOMWindowCSS.h"
#include "CSSParser.h"
+#include "core/page/RuntimeCSSEnabled.h"
#include "StylePropertySet.h"
#include <wtf/text/WTFString.h>
@@ -58,10 +59,12 @@ static String valueWithoutImportant(const String& value)
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;
+
// 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
// there or not, provided how it's specified in the value is correct.
« no previous file with comments | « Source/core/css/CSSParser.cpp ('k') | Source/core/css/StylePropertySet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698