Chromium Code Reviews| 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 425 if (!htmlDocument->hasNamedItem(key) && !htmlDocument->hasExtraNamedItem(key )) | 425 if (!htmlDocument->hasNamedItem(key) && !htmlDocument->hasExtraNamedItem(key )) |
| 426 return v8Undefined(); | 426 return v8Undefined(); |
| 427 | 427 |
| 428 RefPtr<HTMLCollection> items = htmlDocument->documentNamedItems(key); | 428 RefPtr<HTMLCollection> items = htmlDocument->documentNamedItems(key); |
| 429 if (items->isEmpty()) | 429 if (items->isEmpty()) |
| 430 return v8Undefined(); | 430 return v8Undefined(); |
| 431 | 431 |
| 432 if (items->hasExactlyOneItem()) { | 432 if (items->hasExactlyOneItem()) { |
| 433 Element* element = items->item(0); | 433 Element* element = items->item(0); |
| 434 LocalFrame* frame = 0; | 434 LocalFrame* frame = 0; |
| 435 if (element->hasTagName(HTMLNames::iframeTag) && (frame = toHTMLIFrameEl ement(element)->contentFrame())) | 435 if (element->hasTagName(HTMLNames::iframeTag) && (frame = toLocalFrame(t oHTMLIFrameElement(element)->contentFrame()))) |
|
eseidel
2014/03/07 22:42:53
Confused. This isn't always true, is it? Shouldn
kenrb
2014/03/07 23:56:45
Sorry about that, I had added a bunch of checks bu
| |
| 436 return toV8(frame->domWindow(), creationContext, isolate); | 436 return toV8(frame->domWindow(), creationContext, isolate); |
| 437 return toV8(element, creationContext, isolate); | 437 return toV8(element, creationContext, isolate); |
| 438 } | 438 } |
| 439 return toV8(items.release(), creationContext, isolate); | 439 return toV8(items.release(), creationContext, isolate); |
| 440 } | 440 } |
| 441 | 441 |
| 442 static void getter(v8::Local<v8::String> property, const v8::PropertyCallbackInf o<v8::Value>& info) | 442 static void getter(v8::Local<v8::String> property, const v8::PropertyCallbackInf o<v8::Value>& info) |
| 443 { | 443 { |
| 444 // FIXME: Consider passing StringImpl directly. | 444 // FIXME: Consider passing StringImpl directly. |
| 445 AtomicString name = toCoreAtomicString(property); | 445 AtomicString name = toCoreAtomicString(property); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 506 if (!isMainThread()) | 506 if (!isMainThread()) |
| 507 return true; | 507 return true; |
| 508 // We're initializing the context, so it is not yet in a status where we can | 508 // We're initializing the context, so it is not yet in a status where we can |
| 509 // validate the context. | 509 // validate the context. |
| 510 if (contextBeingInitialized) | 510 if (contextBeingInitialized) |
| 511 return true; | 511 return true; |
| 512 return !!toDOMWindow(context); | 512 return !!toDOMWindow(context); |
| 513 } | 513 } |
| 514 | 514 |
| 515 } // WebCore | 515 } // WebCore |
| OLD | NEW |