| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 if (!window) | 389 if (!window) |
| 390 return; | 390 return; |
| 391 | 391 |
| 392 LocalFrame* frame = window->frame(); | 392 LocalFrame* frame = window->frame(); |
| 393 // window is detached from a frame. | 393 // window is detached from a frame. |
| 394 if (!frame) | 394 if (!frame) |
| 395 return; | 395 return; |
| 396 | 396 |
| 397 // Search sub-frames. | 397 // Search sub-frames. |
| 398 AtomicString propName = toCoreAtomicString(name); | 398 AtomicString propName = toCoreAtomicString(name); |
| 399 LocalFrame* child = frame->tree().scopedChild(propName); | 399 Frame* child = frame->tree().scopedChild(propName); |
| 400 if (child) { | 400 if (child) { |
| 401 v8SetReturnValueFast(info, child->domWindow(), window); | 401 v8SetReturnValueFast(info, child->domWindow(), window); |
| 402 return; | 402 return; |
| 403 } | 403 } |
| 404 | 404 |
| 405 // Search IDL functions defined in the prototype | 405 // Search IDL functions defined in the prototype |
| 406 if (!info.Holder()->GetRealNamedProperty(name).IsEmpty()) | 406 if (!info.Holder()->GetRealNamedProperty(name).IsEmpty()) |
| 407 return; | 407 return; |
| 408 | 408 |
| 409 // Search named items in the document. | 409 // Search named items in the document. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 return false; | 456 return false; |
| 457 | 457 |
| 458 // Notify the loader's client if the initial document has been accessed. | 458 // Notify the loader's client if the initial document has been accessed. |
| 459 if (target->loader().stateMachine()->isDisplayingInitialEmptyDocument()) | 459 if (target->loader().stateMachine()->isDisplayingInitialEmptyDocument()) |
| 460 target->loader().didAccessInitialDocument(); | 460 target->loader().didAccessInitialDocument(); |
| 461 | 461 |
| 462 if (key->IsString()) { | 462 if (key->IsString()) { |
| 463 DEFINE_STATIC_LOCAL(const AtomicString, nameOfProtoProperty, ("__proto__
", AtomicString::ConstructFromLiteral)); | 463 DEFINE_STATIC_LOCAL(const AtomicString, nameOfProtoProperty, ("__proto__
", AtomicString::ConstructFromLiteral)); |
| 464 | 464 |
| 465 AtomicString name = toCoreAtomicString(key.As<v8::String>()); | 465 AtomicString name = toCoreAtomicString(key.As<v8::String>()); |
| 466 LocalFrame* childFrame = target->tree().scopedChild(name); | 466 Frame* childFrame = target->tree().scopedChild(name); |
| 467 // Notice that we can't call HasRealNamedProperty for ACCESS_HAS | 467 // Notice that we can't call HasRealNamedProperty for ACCESS_HAS |
| 468 // because that would generate infinite recursion. | 468 // because that would generate infinite recursion. |
| 469 if (type == v8::ACCESS_HAS && childFrame) | 469 if (type == v8::ACCESS_HAS && childFrame) |
| 470 return true; | 470 return true; |
| 471 // We need to explicitly compare against nameOfProtoProperty because | 471 // We need to explicitly compare against nameOfProtoProperty because |
| 472 // V8's JSObject::LocalLookup finds __proto__ before | 472 // V8's JSObject::LocalLookup finds __proto__ before |
| 473 // interceptors and even when __proto__ isn't a "real named property". | 473 // interceptors and even when __proto__ isn't a "real named property". |
| 474 v8::Handle<v8::String> keyString = key.As<v8::String>(); | 474 v8::Handle<v8::String> keyString = key.As<v8::String>(); |
| 475 if (type == v8::ACCESS_GET | 475 if (type == v8::ACCESS_GET |
| 476 && childFrame | 476 && childFrame |
| (...skipping 18 matching lines...) Expand all Loading... |
| 495 ASSERT(targetWindow); | 495 ASSERT(targetWindow); |
| 496 | 496 |
| 497 LocalFrame* target = targetWindow->frame(); | 497 LocalFrame* target = targetWindow->frame(); |
| 498 if (!target) | 498 if (!target) |
| 499 return false; | 499 return false; |
| 500 | 500 |
| 501 // Notify the loader's client if the initial document has been accessed. | 501 // Notify the loader's client if the initial document has been accessed. |
| 502 if (target->loader().stateMachine()->isDisplayingInitialEmptyDocument()) | 502 if (target->loader().stateMachine()->isDisplayingInitialEmptyDocument()) |
| 503 target->loader().didAccessInitialDocument(); | 503 target->loader().didAccessInitialDocument(); |
| 504 | 504 |
| 505 LocalFrame* childFrame = target->tree().scopedChild(index); | 505 Frame* childFrame = target->tree().scopedChild(index); |
| 506 | 506 |
| 507 // Notice that we can't call HasRealNamedProperty for ACCESS_HAS | 507 // Notice that we can't call HasRealNamedProperty for ACCESS_HAS |
| 508 // because that would generate infinite recursion. | 508 // because that would generate infinite recursion. |
| 509 if (type == v8::ACCESS_HAS && childFrame) | 509 if (type == v8::ACCESS_HAS && childFrame) |
| 510 return true; | 510 return true; |
| 511 if (type == v8::ACCESS_GET | 511 if (type == v8::ACCESS_GET |
| 512 && childFrame | 512 && childFrame |
| 513 && !host->HasRealIndexedProperty(index) | 513 && !host->HasRealIndexedProperty(index) |
| 514 && !window->HasRealIndexedProperty(index)) | 514 && !window->HasRealIndexedProperty(index)) |
| 515 return true; | 515 return true; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 532 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::curren
t(isolate)); | 532 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::curren
t(isolate)); |
| 533 if (context.IsEmpty()) | 533 if (context.IsEmpty()) |
| 534 return v8Undefined(); | 534 return v8Undefined(); |
| 535 | 535 |
| 536 v8::Handle<v8::Object> global = context->Global(); | 536 v8::Handle<v8::Object> global = context->Global(); |
| 537 ASSERT(!global.IsEmpty()); | 537 ASSERT(!global.IsEmpty()); |
| 538 return global; | 538 return global; |
| 539 } | 539 } |
| 540 | 540 |
| 541 } // namespace WebCore | 541 } // namespace WebCore |
| OLD | NEW |