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

Unified Diff: sky/engine/core/css/DOMWindowCSS.cpp

Issue 860423004: Remove css !important (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « sky/engine/core/css/CSSStyleDeclaration.idl ('k') | sky/engine/core/css/FontFace.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/css/DOMWindowCSS.cpp
diff --git a/sky/engine/core/css/DOMWindowCSS.cpp b/sky/engine/core/css/DOMWindowCSS.cpp
index c6779838ae0c75b04e0d6e4867ae53f57a89ccb6..6e820d074d310558908edc228af1dded076271ac 100644
--- a/sky/engine/core/css/DOMWindowCSS.cpp
+++ b/sky/engine/core/css/DOMWindowCSS.cpp
@@ -42,20 +42,6 @@ PassRefPtr<DOMWindowCSS> DOMWindowCSS::create()
return adoptRef(new DOMWindowCSS());
}
-static String valueWithoutImportant(const String& value)
-{
- if (!value.endsWith("important", false))
- return value;
-
- String newValue = value;
- int bangIndex = newValue.length() - 9 - 1;
- if (newValue[bangIndex] == ' ')
- bangIndex--;
- newValue = newValue.left(bangIndex);
-
- return newValue;
-}
-
bool DOMWindowCSS::supports(const String& property, const String& value) const
{
CSSPropertyID propertyID = cssPropertyID(property.stripWhiteSpace());
@@ -63,17 +49,13 @@ bool DOMWindowCSS::supports(const String& property, const String& value) const
return false;
ASSERT(CSSPropertyMetadata::isEnabledProperty(propertyID));
- // BisonCSSParser::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.
String normalizedValue = value.stripWhiteSpace().simplifyWhiteSpace();
- normalizedValue = valueWithoutImportant(normalizedValue);
if (normalizedValue.isEmpty())
return false;
RefPtr<MutableStylePropertySet> dummyStyle = MutableStylePropertySet::create();
- return BisonCSSParser::parseValue(dummyStyle.get(), propertyID, normalizedValue, false, HTMLStandardMode, 0);
+ return BisonCSSParser::parseValue(dummyStyle.get(), propertyID, normalizedValue, HTMLStandardMode, 0);
}
bool DOMWindowCSS::supports(const String& conditionText) const
« no previous file with comments | « sky/engine/core/css/CSSStyleDeclaration.idl ('k') | sky/engine/core/css/FontFace.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698