| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 if (!frame) | 492 if (!frame) |
| 493 return notHandledByInterceptor(); | 493 return notHandledByInterceptor(); |
| 494 | 494 |
| 495 // Search sub-frames. | 495 // Search sub-frames. |
| 496 AtomicString propName = v8StringToAtomicWebCoreString(name); | 496 AtomicString propName = v8StringToAtomicWebCoreString(name); |
| 497 Frame* child = frame->tree()->child(propName); | 497 Frame* child = frame->tree()->child(propName); |
| 498 if (child) | 498 if (child) |
| 499 return toV8(child->domWindow()); | 499 return toV8(child->domWindow()); |
| 500 | 500 |
| 501 // Search IDL functions defined in the prototype | 501 // Search IDL functions defined in the prototype |
| 502 v8::Handle<v8::Value> result = info.Holder()->GetRealNamedProperty(name); | 502 if (!info.Holder()->GetRealNamedProperty(name).IsEmpty()) |
| 503 if (!result.IsEmpty()) | 503 return notHandledByInterceptor(); |
| 504 return result; | |
| 505 | 504 |
| 506 // Search named items in the document. | 505 // Search named items in the document. |
| 507 Document* doc = frame->document(); | 506 Document* doc = frame->document(); |
| 508 | 507 |
| 509 if (doc && doc->isHTMLDocument()) { | 508 if (doc && doc->isHTMLDocument()) { |
| 510 if (static_cast<HTMLDocument*>(doc)->hasNamedItem(propName.impl()) || do
c->hasElementWithId(propName.impl())) { | 509 if (static_cast<HTMLDocument*>(doc)->hasNamedItem(propName.impl()) || do
c->hasElementWithId(propName.impl())) { |
| 511 RefPtr<HTMLCollection> items = doc->windowNamedItems(propName); | 510 RefPtr<HTMLCollection> items = doc->windowNamedItems(propName); |
| 512 if (items->length() >= 1) { | 511 if (items->length() >= 1) { |
| 513 if (items->length() == 1) | 512 if (items->length() == 1) |
| 514 return toV8(items->firstItem()); | 513 return toV8(items->firstItem()); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 v8::Handle<v8::Context> context = V8Proxy::context(frame); | 616 v8::Handle<v8::Context> context = V8Proxy::context(frame); |
| 618 if (context.IsEmpty()) | 617 if (context.IsEmpty()) |
| 619 return v8::Handle<v8::Object>(); | 618 return v8::Handle<v8::Object>(); |
| 620 | 619 |
| 621 v8::Handle<v8::Object> global = context->Global(); | 620 v8::Handle<v8::Object> global = context->Global(); |
| 622 ASSERT(!global.IsEmpty()); | 621 ASSERT(!global.IsEmpty()); |
| 623 return global; | 622 return global; |
| 624 } | 623 } |
| 625 | 624 |
| 626 } // namespace WebCore | 625 } // namespace WebCore |
| OLD | NEW |