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

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

Issue 2308373002: Fix assertion when trying to set custom properties as named properties (Closed)
Patch Set: Created 4 years, 3 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 | « third_party/WebKit/LayoutTests/fast/css/variables/accessing-variable-as-named-property.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp
index 8a2ecd4faf022a7fd1b2144e44c82f976d2cab6b..2a7174787f9535f29f5b220d36a250e265fb8185 100644
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp
@@ -141,6 +141,8 @@ static CSSPropertyID cssPropertyInfo(v8::Local<v8::String> v8PropertyName)
return iter->value;
CSSPropertyID unresolvedProperty = parseCSSPropertyID(propertyName);
+ if (unresolvedProperty == CSSPropertyVariable)
+ unresolvedProperty = CSSPropertyInvalid;
map.add(propertyName, unresolvedProperty);
ASSERT(!unresolvedProperty || CSSPropertyMetadata::isEnabledProperty(unresolvedProperty));
return unresolvedProperty;
@@ -195,7 +197,6 @@ void V8CSSStyleDeclaration::namedPropertyGetterCustom(v8::Local<v8::Name> name,
CSSPropertyID resolvedProperty = resolveCSSPropertyID(unresolvedProperty);
CSSStyleDeclaration* impl = V8CSSStyleDeclaration::toImpl(info.Holder());
- // TODO(leviw): This API doesn't support custom properties.
const CSSValue* cssValue = impl->getPropertyCSSValueInternal(resolvedProperty);
if (cssValue) {
v8SetReturnValueStringOrNull(info, cssValue->cssText(), info.GetIsolate());
@@ -217,7 +218,6 @@ void V8CSSStyleDeclaration::namedPropertySetterCustom(v8::Local<v8::Name> name,
TOSTRING_VOID(V8StringResource<TreatNullAsNullString>, propertyValue, value);
ExceptionState exceptionState(ExceptionState::SetterContext, getPropertyName(resolveCSSPropertyID(unresolvedProperty)), "CSSStyleDeclaration", info.Holder(), info.GetIsolate());
- // TODO(leviw): This API doesn't support custom properties.
impl->setPropertyInternal(unresolvedProperty, String(), propertyValue, false, exceptionState);
v8SetReturnValue(info, value);
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/variables/accessing-variable-as-named-property.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698