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

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

Issue 1061243002: bindings: Adds check for attributes on prototype chains in CSSStyleDeclaration. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 | no next file » | 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 b43dace9a5bbdcf09199b2a4d0ea04b6f89552b9..687473e47b45ce1300a75c6d9647f9eb88a9aad3 100644
--- a/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp
+++ b/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp
@@ -199,9 +199,23 @@ void V8CSSStyleDeclaration::namedPropertyGetterCustom(v8::Local<v8::Name> name,
{
if (!name->IsString())
return;
+ auto nameString = name.As<v8::String>();
+ auto context = info.GetIsolate()->GetCurrentContext();
// First look for API defined attributes on the style declaration object.
- if (v8CallBoolean(info.Holder()->HasRealNamedCallbackProperty(info.GetIsolate()->GetCurrentContext(), name.As<v8::String>())))
+ if (v8CallBoolean(info.Holder()->HasRealNamedCallbackProperty(context, nameString)))
return;
+ {
+ v8::Local<v8::Value> returnValue;
+ v8::TryCatch tryCatch;
+ if (v8Call(info.Holder()->GetRealNamedPropertyInPrototypeChain(context, nameString), returnValue, tryCatch)) {
bashi 2015/04/07 08:44:56 I read the following comment on GetRealNamedProper
Yuki 2015/04/07 09:29:00 I think that it is an intended behavior that GetRe
+ v8SetReturnValue(info, returnValue);
+ return;
+ }
+ if (tryCatch.HasCaught()) {
+ tryCatch.ReThrow();
+ return;
+ }
+ }
// Search the style declaration.
CSSPropertyInfo* propInfo = cssPropertyInfo(name.As<v8::String>(), info.GetIsolate());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698