Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(700)

Side by Side Diff: Source/bindings/v8/V8WindowShell.cpp

Issue 19155002: Introduce toHTMLIFrameElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 if (!htmlDocument->hasNamedItem(key.impl()) && !htmlDocument->hasExtraNamedI tem(key.impl())) 432 if (!htmlDocument->hasNamedItem(key.impl()) && !htmlDocument->hasExtraNamedI tem(key.impl()))
433 return v8Undefined(); 433 return v8Undefined();
434 434
435 RefPtr<HTMLCollection> items = htmlDocument->documentNamedItems(key); 435 RefPtr<HTMLCollection> items = htmlDocument->documentNamedItems(key);
436 if (items->isEmpty()) 436 if (items->isEmpty())
437 return v8Undefined(); 437 return v8Undefined();
438 438
439 if (items->hasExactlyOneItem()) { 439 if (items->hasExactlyOneItem()) {
440 Node* node = items->item(0); 440 Node* node = items->item(0);
441 Frame* frame = 0; 441 Frame* frame = 0;
442 if (node->hasTagName(HTMLNames::iframeTag) && (frame = static_cast<HTMLI FrameElement*>(node)->contentFrame())) 442 if (node->hasTagName(HTMLNames::iframeTag) && (frame = toHTMLIFrameEleme nt(node)->contentFrame()))
443 return toV8(frame->document()->domWindow(), creationContext, isolate ); 443 return toV8(frame->document()->domWindow(), creationContext, isolate );
444 return toV8(node, creationContext, isolate); 444 return toV8(node, creationContext, isolate);
445 } 445 }
446 return toV8(items.release(), creationContext, isolate); 446 return toV8(items.release(), creationContext, isolate);
447 } 447 }
448 448
449 static void getter(v8::Local<v8::String> property, const v8::PropertyCallbackInf o<v8::Value>& info) 449 static void getter(v8::Local<v8::String> property, const v8::PropertyCallbackInf o<v8::Value>& info)
450 { 450 {
451 // FIXME: Consider passing AtomicStringImpl directly. 451 // FIXME: Consider passing AtomicStringImpl directly.
452 AtomicString name = toWebCoreAtomicString(property); 452 AtomicString name = toWebCoreAtomicString(property);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 void V8WindowShell::updateSecurityOrigin() 502 void V8WindowShell::updateSecurityOrigin()
503 { 503 {
504 ASSERT(m_world->isMainWorld()); 504 ASSERT(m_world->isMainWorld());
505 if (m_context.isEmpty()) 505 if (m_context.isEmpty())
506 return; 506 return;
507 v8::HandleScope handleScope; 507 v8::HandleScope handleScope;
508 setSecurityToken(); 508 setSecurityToken();
509 } 509 }
510 510
511 } // WebCore 511 } // WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698