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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp

Issue 2513153002: Don't create boxes for the contents of display: none iframes. (Closed)
Patch Set: Handle dynamic changes properly. Created 4 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Simon Hausmann (hausmann@kde.org) 4 * (C) 2000 Simon Hausmann (hausmann@kde.org)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2006, 2008, 2009 Apple Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 10 matching lines...) Expand all
21 * Boston, MA 02110-1301, USA. 21 * Boston, MA 02110-1301, USA.
22 */ 22 */
23 23
24 #include "core/html/HTMLFrameElementBase.h" 24 #include "core/html/HTMLFrameElementBase.h"
25 25
26 #include "bindings/core/v8/ScriptController.h" 26 #include "bindings/core/v8/ScriptController.h"
27 #include "bindings/core/v8/ScriptEventListener.h" 27 #include "bindings/core/v8/ScriptEventListener.h"
28 #include "core/HTMLNames.h" 28 #include "core/HTMLNames.h"
29 #include "core/dom/Attribute.h" 29 #include "core/dom/Attribute.h"
30 #include "core/dom/Document.h" 30 #include "core/dom/Document.h"
31 #include "core/dom/StyleChangeReason.h"
31 #include "core/frame/FrameView.h" 32 #include "core/frame/FrameView.h"
32 #include "core/frame/LocalFrame.h" 33 #include "core/frame/LocalFrame.h"
33 #include "core/frame/RemoteFrame.h" 34 #include "core/frame/RemoteFrame.h"
34 #include "core/frame/RemoteFrameView.h" 35 #include "core/frame/RemoteFrameView.h"
35 #include "core/frame/csp/ContentSecurityPolicy.h" 36 #include "core/frame/csp/ContentSecurityPolicy.h"
36 #include "core/html/parser/HTMLParserIdioms.h" 37 #include "core/html/parser/HTMLParserIdioms.h"
37 #include "core/loader/FrameLoader.h" 38 #include "core/loader/FrameLoader.h"
38 #include "core/loader/FrameLoaderClient.h" 39 #include "core/loader/FrameLoaderClient.h"
39 #include "core/page/FocusController.h" 40 #include "core/page/FocusController.h"
40 #include "core/page/Page.h" 41 #include "core/page/Page.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 187
187 if (!SubframeLoadingDisabler::canLoadFrame(*this)) 188 if (!SubframeLoadingDisabler::canLoadFrame(*this))
188 return; 189 return;
189 190
190 setNameAndOpenURL(); 191 setNameAndOpenURL();
191 } 192 }
192 193
193 void HTMLFrameElementBase::attachLayoutTree(const AttachContext& context) { 194 void HTMLFrameElementBase::attachLayoutTree(const AttachContext& context) {
194 HTMLFrameOwnerElement::attachLayoutTree(context); 195 HTMLFrameOwnerElement::attachLayoutTree(context);
195 196
196 if (layoutPart()) { 197 // TODO(esprehn): Why do we only call setWidget() if the frame is
197 if (Frame* frame = contentFrame()) { 198 // displayed?
198 if (frame->isLocalFrame()) 199
199 setWidget(toLocalFrame(frame)->view()); 200 if (Frame* frame = contentFrame()) {
200 else if (frame->isRemoteFrame()) 201 if (frame->isLocalFrame()) {
202 LocalFrame* localFrame = toLocalFrame(frame);
203 if (layoutPart())
204 setWidget(localFrame->view());
205 if (Element* documentElement =
206 localFrame->document()->documentElement()) {
207 if (static_cast<bool>(layoutPart()) !=
208 static_cast<bool>(documentElement->layoutObject())) {
209 documentElement->lazyReattachIfAttached();
210 }
211 }
212 } else {
213 if (layoutPart())
201 setWidget(toRemoteFrame(frame)->view()); 214 setWidget(toRemoteFrame(frame)->view());
202 } 215 }
203 } 216 }
204 } 217 }
205 218
206 void HTMLFrameElementBase::setLocation(const String& str) { 219 void HTMLFrameElementBase::setLocation(const String& str) {
207 m_URL = AtomicString(str); 220 m_URL = AtomicString(str);
208 221
209 if (isConnected()) 222 if (isConnected())
210 openURL(false); 223 openURL(false);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 m_marginWidth = marginWidth; 274 m_marginWidth = marginWidth;
262 frameOwnerPropertiesChanged(); 275 frameOwnerPropertiesChanged();
263 } 276 }
264 277
265 void HTMLFrameElementBase::setMarginHeight(int marginHeight) { 278 void HTMLFrameElementBase::setMarginHeight(int marginHeight) {
266 m_marginHeight = marginHeight; 279 m_marginHeight = marginHeight;
267 frameOwnerPropertiesChanged(); 280 frameOwnerPropertiesChanged();
268 } 281 }
269 282
270 } // namespace blink 283 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleChangeReason.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698