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

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

Issue 2065523002: binding: Fixes the fallback mechanism of Document's named properties. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Synced. 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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 return; 514 return;
515 // FIXME: Consider passing StringImpl directly. 515 // FIXME: Consider passing StringImpl directly.
516 AtomicString name = toCoreAtomicString(property.As<v8::String>()); 516 AtomicString name = toCoreAtomicString(property.As<v8::String>());
517 HTMLDocument* htmlDocument = V8HTMLDocument::toImpl(info.Holder()); 517 HTMLDocument* htmlDocument = V8HTMLDocument::toImpl(info.Holder());
518 ASSERT(htmlDocument); 518 ASSERT(htmlDocument);
519 v8::Local<v8::Value> result = getNamedProperty(htmlDocument, name, info.Hold er(), info.GetIsolate()); 519 v8::Local<v8::Value> result = getNamedProperty(htmlDocument, name, info.Hold er(), info.GetIsolate());
520 if (!result.IsEmpty()) { 520 if (!result.IsEmpty()) {
521 v8SetReturnValue(info, result); 521 v8SetReturnValue(info, result);
522 return; 522 return;
523 } 523 }
524 v8::Local<v8::Value> prototype = info.Holder()->GetPrototype(); 524 v8::Local<v8::Value> value;
525 if (prototype->IsObject()) { 525 if (info.Holder()->GetRealNamedPropertyInPrototypeChain(info.GetIsolate()->G etCurrentContext(), property.As<v8::String>()).ToLocal(&value))
526 v8::Local<v8::Value> value; 526 v8SetReturnValue(info, value);
527 if (prototype.As<v8::Object>()->Get(info.GetIsolate()->GetCurrentContext (), property).ToLocal(&value))
528 v8SetReturnValue(info, value);
529 }
530 } 527 }
531 528
532 void WindowProxy::namedItemAdded(HTMLDocument* document, const AtomicString& nam e) 529 void WindowProxy::namedItemAdded(HTMLDocument* document, const AtomicString& nam e)
533 { 530 {
534 ASSERT(m_world->isMainWorld()); 531 ASSERT(m_world->isMainWorld());
535 532
536 if (!isContextInitialized() || !m_scriptState->contextIsValid()) 533 if (!isContextInitialized() || !m_scriptState->contextIsValid())
537 return; 534 return;
538 535
539 ScriptState::Scope scope(m_scriptState.get()); 536 ScriptState::Scope scope(m_scriptState.get());
(...skipping 22 matching lines...) Expand all
562 } 559 }
563 560
564 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) 561 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin)
565 { 562 {
566 if (!isContextInitialized()) 563 if (!isContextInitialized())
567 return; 564 return;
568 setSecurityToken(origin); 565 setSecurityToken(origin);
569 } 566 }
570 567
571 } // namespace blink 568 } // 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