OLD | NEW |
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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 static v8::Handle<v8::Value> getNamedProperty(HTMLDocument* htmlDocument, const
AtomicString& key, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 437 static v8::Handle<v8::Value> getNamedProperty(HTMLDocument* htmlDocument, const
AtomicString& key, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
438 { | 438 { |
439 if (!htmlDocument->hasNamedItem(key) && !htmlDocument->hasExtraNamedItem(key
)) | 439 if (!htmlDocument->hasNamedItem(key) && !htmlDocument->hasExtraNamedItem(key
)) |
440 return v8Undefined(); | 440 return v8Undefined(); |
441 | 441 |
442 RefPtr<HTMLCollection> items = htmlDocument->documentNamedItems(key); | 442 RefPtr<HTMLCollection> items = htmlDocument->documentNamedItems(key); |
443 if (items->isEmpty()) | 443 if (items->isEmpty()) |
444 return v8Undefined(); | 444 return v8Undefined(); |
445 | 445 |
446 if (items->hasExactlyOneItem()) { | 446 if (items->hasExactlyOneItem()) { |
447 Node* node = items->item(0); | 447 Element* element = items->item(0); |
448 Frame* frame = 0; | 448 Frame* frame = 0; |
449 if (node->hasTagName(HTMLNames::iframeTag) && (frame = toHTMLIFrameEleme
nt(node)->contentFrame())) | 449 if (element->hasTagName(HTMLNames::iframeTag) && (frame = toHTMLIFrameEl
ement(element)->contentFrame())) |
450 return toV8(frame->domWindow(), creationContext, isolate); | 450 return toV8(frame->domWindow(), creationContext, isolate); |
451 return toV8(node, creationContext, isolate); | 451 return toV8(element, creationContext, isolate); |
452 } | 452 } |
453 return toV8(items.release(), creationContext, isolate); | 453 return toV8(items.release(), creationContext, isolate); |
454 } | 454 } |
455 | 455 |
456 static void getter(v8::Local<v8::String> property, const v8::PropertyCallbackInf
o<v8::Value>& info) | 456 static void getter(v8::Local<v8::String> property, const v8::PropertyCallbackInf
o<v8::Value>& info) |
457 { | 457 { |
458 // FIXME: Consider passing StringImpl directly. | 458 // FIXME: Consider passing StringImpl directly. |
459 AtomicString name = toCoreAtomicString(property); | 459 AtomicString name = toCoreAtomicString(property); |
460 HTMLDocument* htmlDocument = V8HTMLDocument::toNative(info.Holder()); | 460 HTMLDocument* htmlDocument = V8HTMLDocument::toNative(info.Holder()); |
461 ASSERT(htmlDocument); | 461 ASSERT(htmlDocument); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 { | 519 { |
520 ASSERT(isMainThread()); | 520 ASSERT(isMainThread()); |
521 // We're initializing the context, so it is not yet in a status where we can | 521 // We're initializing the context, so it is not yet in a status where we can |
522 // validate the context. | 522 // validate the context. |
523 if (contextBeingInitialized) | 523 if (contextBeingInitialized) |
524 return true; | 524 return true; |
525 return !!toDOMWindow(context); | 525 return !!toDOMWindow(context); |
526 } | 526 } |
527 | 527 |
528 } // WebCore | 528 } // WebCore |
OLD | NEW |