| 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 | 408 |
| 409 // Search IDL functions defined in the prototype | 409 // Search IDL functions defined in the prototype |
| 410 if (!info.Holder()->GetRealNamedProperty(name).IsEmpty()) | 410 if (!info.Holder()->GetRealNamedProperty(name).IsEmpty()) |
| 411 return; | 411 return; |
| 412 | 412 |
| 413 // Search named items in the document. | 413 // Search named items in the document. |
| 414 Document* doc = frame->document(); | 414 Document* doc = frame->document(); |
| 415 | 415 |
| 416 if (doc && doc->isHTMLDocument()) { | 416 if (doc && doc->isHTMLDocument()) { |
| 417 if (toHTMLDocument(doc)->hasNamedItem(propName) || doc->hasElementWithId
(propName.impl())) { | 417 if (toHTMLDocument(doc)->hasNamedItem(propName) || doc->hasElementWithId
(propName.impl())) { |
| 418 RefPtr<HTMLCollection> items = doc->windowNamedItems(propName); | 418 RefPtrWillBeRawPtr<HTMLCollection> items = doc->windowNamedItems(pro
pName); |
| 419 if (!items->isEmpty()) { | 419 if (!items->isEmpty()) { |
| 420 if (items->hasExactlyOneItem()) { | 420 if (items->hasExactlyOneItem()) { |
| 421 v8SetReturnValueFast(info, items->item(0), window); | 421 v8SetReturnValueFast(info, items->item(0), window); |
| 422 return; | 422 return; |
| 423 } | 423 } |
| 424 v8SetReturnValueFast(info, items.release(), window); | 424 v8SetReturnValueFast(info, items.release(), window); |
| 425 return; | 425 return; |
| 426 } | 426 } |
| 427 } | 427 } |
| 428 } | 428 } |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 v8::Handle<v8::Context> context = toV8Context(isolate, frame, DOMWrapperWorl
d::current(isolate)); | 549 v8::Handle<v8::Context> context = toV8Context(isolate, frame, DOMWrapperWorl
d::current(isolate)); |
| 550 if (context.IsEmpty()) | 550 if (context.IsEmpty()) |
| 551 return v8Undefined(); | 551 return v8Undefined(); |
| 552 | 552 |
| 553 v8::Handle<v8::Object> global = context->Global(); | 553 v8::Handle<v8::Object> global = context->Global(); |
| 554 ASSERT(!global.IsEmpty()); | 554 ASSERT(!global.IsEmpty()); |
| 555 return global; | 555 return global; |
| 556 } | 556 } |
| 557 | 557 |
| 558 } // namespace WebCore | 558 } // namespace WebCore |
| OLD | NEW |