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

Side by Side Diff: Source/core/frame/LocalDOMWindow.cpp

Issue 1112843007: Fix frameElement for frames with a remote parent. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address Daniel's comment Created 5 years, 7 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 | « Source/bindings/core/v8/custom/V8WindowCustom.cpp ('k') | Source/web/tests/WebFrameTest.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) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 730
731 return frame()->document()->getSelection(); 731 return frame()->document()->getSelection();
732 } 732 }
733 733
734 Element* LocalDOMWindow::frameElement() const 734 Element* LocalDOMWindow::frameElement() const
735 { 735 {
736 if (!frame()) 736 if (!frame())
737 return nullptr; 737 return nullptr;
738 738
739 // The bindings security check should ensure we're same origin... 739 // The bindings security check should ensure we're same origin...
740 ASSERT(!frame()->owner() || frame()->owner()->isLocal()); 740 ASSERT(!frame()->owner() || frame()->owner()->isLocal());
dcheng 2015/04/30 21:18:13 Minor nit: the isLocal() becomes redundant here.
alexmos 2015/04/30 22:29:57 Yeah, I suppose this whole ASSERT is now redundant
741 return frame()->deprecatedLocalOwner(); 741 return toHTMLFrameOwnerElement(frame()->owner());
742 } 742 }
743 743
744 void LocalDOMWindow::focus(ExecutionContext* context) 744 void LocalDOMWindow::focus(ExecutionContext* context)
745 { 745 {
746 if (!frame()) 746 if (!frame())
747 return; 747 return;
748 748
749 FrameHost* host = frame()->host(); 749 FrameHost* host = frame()->host();
750 if (!host) 750 if (!host)
751 return; 751 return;
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
1571 DOMWindow::trace(visitor); 1571 DOMWindow::trace(visitor);
1572 DOMWindowLifecycleNotifier::trace(visitor); 1572 DOMWindowLifecycleNotifier::trace(visitor);
1573 } 1573 }
1574 1574
1575 LocalFrame* LocalDOMWindow::frame() const 1575 LocalFrame* LocalDOMWindow::frame() const
1576 { 1576 {
1577 return m_frameObserver->frame(); 1577 return m_frameObserver->frame();
1578 } 1578 }
1579 1579
1580 } // namespace blink 1580 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/custom/V8WindowCustom.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698