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

Unified Diff: Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp

Issue 141693002: Don't support mixed dashed/camel-cased CSS property names (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 | « LayoutTests/fast/dom/CSSStyleDeclaration/css-style-declaration-named-getter-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp
diff --git a/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp b/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp
index b15f88962e85c80ec242e505f853125f9b993dc7..dd2411023c388dd70e31efb7bfaf74e60c5482e2 100644
--- a/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp
+++ b/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp
@@ -131,6 +131,8 @@ static CSSPropertyInfo* cssPropertyInfo(v8::Handle<v8::String> v8PropertyName)
return 0;
}
+ bool hasSeenUpper = isASCIIUpper(propertyName[i]);
+
builder.append(toASCIILower(propertyName[i++]));
for (; i < length; ++i) {
@@ -141,11 +143,16 @@ static CSSPropertyInfo* cssPropertyInfo(v8::Handle<v8::String> v8PropertyName)
builder.append(c);
}
else {
+ hasSeenUpper = true;
builder.append('-');
builder.append(toASCIILower(c));
}
}
+ // Reject names containing both dashes and upper-case characters, such as "border-rightColor".
+ if (hasSeenDash && hasSeenUpper)
+ return 0;
+
String propName = builder.toString();
CSSPropertyID propertyID = cssPropertyID(propName);
if (propertyID && RuntimeCSSEnabled::isCSSPropertyEnabled(propertyID)) {
« no previous file with comments | « LayoutTests/fast/dom/CSSStyleDeclaration/css-style-declaration-named-getter-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698