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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 } | 415 } |
416 | 416 |
417 // Search IDL functions defined in the prototype | 417 // Search IDL functions defined in the prototype |
418 if (!info.Holder()->GetRealNamedProperty(name).IsEmpty()) | 418 if (!info.Holder()->GetRealNamedProperty(name).IsEmpty()) |
419 return; | 419 return; |
420 | 420 |
421 // Search named items in the document. | 421 // Search named items in the document. |
422 Document* doc = frame->document(); | 422 Document* doc = frame->document(); |
423 | 423 |
424 if (doc && doc->isHTMLDocument()) { | 424 if (doc && doc->isHTMLDocument()) { |
425 if (toHTMLDocument(doc)->hasNamedItem(propName) || doc->hasElementWithId
(propName.impl())) { | 425 if (toHTMLDocument(doc)->hasNamedItem(propName) || doc->hasElementWithId
(propName)) { |
426 RefPtrWillBeRawPtr<HTMLCollection> items = doc->windowNamedItems(pro
pName); | 426 RefPtrWillBeRawPtr<HTMLCollection> items = doc->windowNamedItems(pro
pName); |
427 if (!items->isEmpty()) { | 427 if (!items->isEmpty()) { |
428 if (items->hasExactlyOneItem()) { | 428 if (items->hasExactlyOneItem()) { |
429 v8SetReturnValueFast(info, items->item(0), window); | 429 v8SetReturnValueFast(info, items->item(0), window); |
430 return; | 430 return; |
431 } | 431 } |
432 v8SetReturnValueFast(info, items.release(), window); | 432 v8SetReturnValueFast(info, items.release(), window); |
433 return; | 433 return; |
434 } | 434 } |
435 } | 435 } |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::curren
t(isolate)); | 544 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::curren
t(isolate)); |
545 if (context.IsEmpty()) | 545 if (context.IsEmpty()) |
546 return v8Undefined(); | 546 return v8Undefined(); |
547 | 547 |
548 v8::Handle<v8::Object> global = context->Global(); | 548 v8::Handle<v8::Object> global = context->Global(); |
549 ASSERT(!global.IsEmpty()); | 549 ASSERT(!global.IsEmpty()); |
550 return global; | 550 return global; |
551 } | 551 } |
552 | 552 |
553 } // namespace blink | 553 } // namespace blink |
OLD | NEW |