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

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

Issue 219903002: Revert 170347 "Convert HTMLFrameOwnerElement and FocusController..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1917/
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/LocalFrame.h ('k') | Source/core/html/HTMLFrameElementBase.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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 , m_editor(Editor::create(*this)) 95 , m_editor(Editor::create(*this))
96 , m_spellChecker(SpellChecker::create(*this)) 96 , m_spellChecker(SpellChecker::create(*this))
97 , m_selection(adoptPtr(new FrameSelection(this))) 97 , m_selection(adoptPtr(new FrameSelection(this)))
98 , m_eventHandler(adoptPtr(new EventHandler(this))) 98 , m_eventHandler(adoptPtr(new EventHandler(this)))
99 , m_inputMethodController(InputMethodController::create(*this)) 99 , m_inputMethodController(InputMethodController::create(*this))
100 , m_pageZoomFactor(parentPageZoomFactor(this)) 100 , m_pageZoomFactor(parentPageZoomFactor(this))
101 , m_textZoomFactor(parentTextZoomFactor(this)) 101 , m_textZoomFactor(parentTextZoomFactor(this))
102 , m_orientation(0) 102 , m_orientation(0)
103 , m_inViewSourceMode(false) 103 , m_inViewSourceMode(false)
104 { 104 {
105 if (this->ownerElement()) {
106 page()->incrementSubframeCount();
107 this->ownerElement()->setContentFrame(*this);
108 }
105 } 109 }
106 110
107 PassRefPtr<LocalFrame> LocalFrame::create(FrameLoaderClient* client, FrameHost* host, HTMLFrameOwnerElement* ownerElement) 111 PassRefPtr<LocalFrame> LocalFrame::create(FrameLoaderClient* client, FrameHost* host, HTMLFrameOwnerElement* ownerElement)
108 { 112 {
109 RefPtr<LocalFrame> frame = adoptRef(new LocalFrame(client, host, ownerElemen t)); 113 RefPtr<LocalFrame> frame = adoptRef(new LocalFrame(client, host, ownerElemen t));
110 if (!frame->ownerElement()) 114 if (!frame->ownerElement())
111 frame->page()->setMainFrame(frame); 115 frame->page()->setMainFrame(frame);
112 InspectorInstrumentation::frameAttachedToParent(frame.get()); 116 InspectorInstrumentation::frameAttachedToParent(frame.get());
113 return frame.release(); 117 return frame.release();
114 } 118 }
115 119
116 LocalFrame::~LocalFrame() 120 LocalFrame::~LocalFrame()
117 { 121 {
118 setView(nullptr); 122 setView(nullptr);
119 loader().clear(); 123 loader().clear();
120 setDOMWindow(nullptr); 124 setDOMWindow(nullptr);
125
126 disconnectOwnerElement();
121 } 127 }
122 128
123 bool LocalFrame::inScope(TreeScope* scope) const 129 bool LocalFrame::inScope(TreeScope* scope) const
124 { 130 {
125 ASSERT(scope); 131 ASSERT(scope);
126 Document* doc = document(); 132 Document* doc = document();
127 if (!doc) 133 if (!doc)
128 return false; 134 return false;
129 HTMLFrameOwnerElement* owner = doc->ownerElement(); 135 HTMLFrameOwnerElement* owner = doc->ownerElement();
130 if (!owner) 136 if (!owner)
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 page()->scrollingCoordinator()->willDestroyScrollableArea(m_view.get()); 257 page()->scrollingCoordinator()->willDestroyScrollableArea(m_view.get());
252 } 258 }
253 259
254 void LocalFrame::detachFromFrameHost() 260 void LocalFrame::detachFromFrameHost()
255 { 261 {
256 // We should never be detatching the page during a Layout. 262 // We should never be detatching the page during a Layout.
257 RELEASE_ASSERT(!m_view || !m_view->isInPerformLayout()); 263 RELEASE_ASSERT(!m_view || !m_view->isInPerformLayout());
258 Frame::detachFromFrameHost(); 264 Frame::detachFromFrameHost();
259 } 265 }
260 266
267 void LocalFrame::disconnectOwnerElement()
268 {
269 if (ownerElement()) {
270 if (Document* doc = document())
271 doc->topDocument().clearAXObjectCache();
272 ownerElement()->clearContentFrame();
273 if (page())
274 page()->decrementSubframeCount();
275 }
276 m_ownerElement = 0;
277 }
278
261 String LocalFrame::documentTypeString() const 279 String LocalFrame::documentTypeString() const
262 { 280 {
263 if (DocumentType* doctype = document()->doctype()) 281 if (DocumentType* doctype = document()->doctype())
264 return createMarkup(doctype); 282 return createMarkup(doctype);
265 283
266 return String(); 284 return String();
267 } 285 }
268 286
269 String LocalFrame::selectedText() const 287 String LocalFrame::selectedText() const
270 { 288 {
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 { 612 {
595 if (!m_host) 613 if (!m_host)
596 return 0; 614 return 0;
597 615
598 double ratio = m_host->deviceScaleFactor(); 616 double ratio = m_host->deviceScaleFactor();
599 ratio *= pageZoomFactor(); 617 ratio *= pageZoomFactor();
600 return ratio; 618 return ratio;
601 } 619 }
602 620
603 } // namespace WebCore 621 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/LocalFrame.h ('k') | Source/core/html/HTMLFrameElementBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698