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

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

Issue 1096963002: Make UseCounters work on aliased properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 | « no previous file | Source/build/scripts/css_properties.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp
diff --git a/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp b/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp
index 218d80585ba34f858c25d0b2cf5f359ad73417f8..8ed315388fd5083ee325110312aa1a2eac9f0fb3 100644
--- a/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp
+++ b/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp
@@ -84,7 +84,7 @@ struct CSSPropertyInfo {
CSSPropertyID propID;
};
-static CSSPropertyID cssResolvedPropertyID(const String& propertyName, v8::Isolate* isolate)
+static CSSPropertyID parseCSSPropertyID(const String& propertyName, v8::Isolate* isolate)
{
unsigned length = propertyName.length();
if (!length)
@@ -128,7 +128,7 @@ static CSSPropertyID cssResolvedPropertyID(const String& propertyName, v8::Isola
return CSSPropertyInvalid;
String propName = builder.toString();
- return cssPropertyID(propName);
+ return unresolvedCSSPropertyID(propName);
}
// When getting properties on CSSStyleDeclarations, the name used from
@@ -148,7 +148,7 @@ static CSSPropertyInfo* cssPropertyInfo(v8::Local<v8::String> v8PropertyName, v8
CSSPropertyInfo* propInfo = map.get(propertyName);
if (!propInfo) {
propInfo = new CSSPropertyInfo();
- propInfo->propID = cssResolvedPropertyID(propertyName, isolate);
+ propInfo->propID = parseCSSPropertyID(propertyName, isolate);
map.add(propertyName, propInfo);
}
if (!propInfo->propID)
@@ -203,15 +203,16 @@ void V8CSSStyleDeclaration::namedPropertyGetterCustom(v8::Local<v8::Name> name,
// Do not handle non-property names.
if (!propInfo)
return;
+ CSSPropertyID resolvedProperty = resolveCSSPropertyID(propInfo->propID);
CSSStyleDeclaration* impl = V8CSSStyleDeclaration::toImpl(info.Holder());
- RefPtrWillBeRawPtr<CSSValue> cssValue = impl->getPropertyCSSValueInternal(static_cast<CSSPropertyID>(propInfo->propID));
+ RefPtrWillBeRawPtr<CSSValue> cssValue = impl->getPropertyCSSValueInternal(resolvedProperty);
if (cssValue) {
v8SetReturnValueStringOrNull(info, cssValue->cssText(), info.GetIsolate());
return;
}
- String result = impl->getPropertyValueInternal(static_cast<CSSPropertyID>(propInfo->propID));
+ String result = impl->getPropertyValueInternal(resolvedProperty);
v8SetReturnValueString(info, result, info.GetIsolate());
}
@@ -225,7 +226,7 @@ void V8CSSStyleDeclaration::namedPropertySetterCustom(v8::Local<v8::Name> name,
return;
TOSTRING_VOID(V8StringResource<TreatNullAsNullString>, propertyValue, value);
- ExceptionState exceptionState(ExceptionState::SetterContext, getPropertyName(static_cast<CSSPropertyID>(propInfo->propID)), "CSSStyleDeclaration", info.Holder(), info.GetIsolate());
+ ExceptionState exceptionState(ExceptionState::SetterContext, getPropertyName(resolveCSSPropertyID(propInfo->propID)), "CSSStyleDeclaration", info.Holder(), info.GetIsolate());
impl->setPropertyInternal(static_cast<CSSPropertyID>(propInfo->propID), propertyValue, false, exceptionState);
if (exceptionState.throwIfNeeded())
« no previous file with comments | « no previous file | Source/build/scripts/css_properties.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698