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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp

Issue 2069953002: binding: Fixes the fallback mechanism of Document's named properties. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/named-item-not-found.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 return; 533 return;
534 // FIXME: Consider passing StringImpl directly. 534 // FIXME: Consider passing StringImpl directly.
535 AtomicString name = toCoreAtomicString(property.As<v8::String>()); 535 AtomicString name = toCoreAtomicString(property.As<v8::String>());
536 HTMLDocument* htmlDocument = V8HTMLDocument::toImpl(info.Holder()); 536 HTMLDocument* htmlDocument = V8HTMLDocument::toImpl(info.Holder());
537 ASSERT(htmlDocument); 537 ASSERT(htmlDocument);
538 v8::Local<v8::Value> result = getNamedProperty(htmlDocument, name, info.Hold er(), info.GetIsolate()); 538 v8::Local<v8::Value> result = getNamedProperty(htmlDocument, name, info.Hold er(), info.GetIsolate());
539 if (!result.IsEmpty()) { 539 if (!result.IsEmpty()) {
540 v8SetReturnValue(info, result); 540 v8SetReturnValue(info, result);
541 return; 541 return;
542 } 542 }
543 v8::Local<v8::Value> prototype = info.Holder()->GetPrototype(); 543 v8::Local<v8::Value> value;
544 if (prototype->IsObject()) { 544 if (info.Holder()->GetRealNamedPropertyInPrototypeChain(info.GetIsolate()->G etCurrentContext(), property.As<v8::String>()).ToLocal(&value))
545 v8::Local<v8::Value> value; 545 v8SetReturnValue(info, value);
546 if (prototype.As<v8::Object>()->Get(info.GetIsolate()->GetCurrentContext (), property).ToLocal(&value))
547 v8SetReturnValue(info, value);
548 }
549 } 546 }
550 547
551 void WindowProxy::namedItemAdded(HTMLDocument* document, const AtomicString& nam e) 548 void WindowProxy::namedItemAdded(HTMLDocument* document, const AtomicString& nam e)
552 { 549 {
553 ASSERT(m_world->isMainWorld()); 550 ASSERT(m_world->isMainWorld());
554 551
555 if (!isContextInitialized() || !m_scriptState->contextIsValid()) 552 if (!isContextInitialized() || !m_scriptState->contextIsValid())
556 return; 553 return;
557 554
558 ScriptState::Scope scope(m_scriptState.get()); 555 ScriptState::Scope scope(m_scriptState.get());
(...skipping 22 matching lines...) Expand all
581 } 578 }
582 579
583 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) 580 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin)
584 { 581 {
585 if (!isContextInitialized()) 582 if (!isContextInitialized())
586 return; 583 return;
587 setSecurityToken(origin); 584 setSecurityToken(origin);
588 } 585 }
589 586
590 } // namespace blink 587 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/named-item-not-found.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698