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

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

Issue 2743053003: [Reland #1] Don't create layout objects for children of display-none iframes. (Closed)
Patch Set: Fix DOM object leaks. Diff this against Patch Set 10. Created 3 years, 9 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
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 return; 112 return;
113 if (!contentFrame() || scriptURL.isEmpty() || !contentFrame()->isLocalFrame()) 113 if (!contentFrame() || scriptURL.isEmpty() || !contentFrame()->isLocalFrame())
114 return; 114 return;
115 if (contentFrame()->owner()->getSandboxFlags() & SandboxOrigin) 115 if (contentFrame()->owner()->getSandboxFlags() & SandboxOrigin)
116 return; 116 return;
117 toLocalFrame(contentFrame()) 117 toLocalFrame(contentFrame())
118 ->script() 118 ->script()
119 .executeScriptIfJavaScriptURL(scriptURL, this); 119 .executeScriptIfJavaScriptURL(scriptURL, this);
120 } 120 }
121 121
122 void HTMLFrameElementBase::frameOwnerPropertiesChanged() {
123 // Don't notify about updates if contentFrame() is null, for example when
124 // the subframe hasn't been created yet.
125 if (contentFrame())
126 document().frame()->loader().client()->didChangeFrameOwnerProperties(this);
127 }
128
129 void HTMLFrameElementBase::parseAttribute( 122 void HTMLFrameElementBase::parseAttribute(
130 const AttributeModificationParams& params) { 123 const AttributeModificationParams& params) {
131 const QualifiedName& name = params.name; 124 const QualifiedName& name = params.name;
132 const AtomicString& value = params.newValue; 125 const AtomicString& value = params.newValue;
133 if (name == srcdocAttr) { 126 if (name == srcdocAttr) {
134 if (!value.isNull()) { 127 if (!value.isNull()) {
135 setLocation(srcdocURL().getString()); 128 setLocation(srcdocURL().getString());
136 } else { 129 } else {
137 const AtomicString& srcValue = fastGetAttribute(srcAttr); 130 const AtomicString& srcValue = fastGetAttribute(srcAttr);
138 if (!srcValue.isNull()) 131 if (!srcValue.isNull())
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 } 247 }
255 HTMLFrameOwnerElement::defaultEventHandler(event); 248 HTMLFrameOwnerElement::defaultEventHandler(event);
256 } 249 }
257 250
258 void HTMLFrameElementBase::setScrollingMode(ScrollbarMode scrollbarMode) { 251 void HTMLFrameElementBase::setScrollingMode(ScrollbarMode scrollbarMode) {
259 if (m_scrollingMode == scrollbarMode) 252 if (m_scrollingMode == scrollbarMode)
260 return; 253 return;
261 254
262 if (contentDocument()) { 255 if (contentDocument()) {
263 contentDocument()->willChangeFrameOwnerProperties( 256 contentDocument()->willChangeFrameOwnerProperties(
264 m_marginWidth, m_marginHeight, scrollbarMode); 257 m_marginWidth, m_marginHeight, scrollbarMode, isDisplayNone());
265 } 258 }
266 m_scrollingMode = scrollbarMode; 259 m_scrollingMode = scrollbarMode;
267 frameOwnerPropertiesChanged(); 260 frameOwnerPropertiesChanged();
268 } 261 }
269 262
270 void HTMLFrameElementBase::setMarginWidth(int marginWidth) { 263 void HTMLFrameElementBase::setMarginWidth(int marginWidth) {
271 if (m_marginWidth == marginWidth) 264 if (m_marginWidth == marginWidth)
272 return; 265 return;
273 266
274 if (contentDocument()) { 267 if (contentDocument()) {
275 contentDocument()->willChangeFrameOwnerProperties( 268 contentDocument()->willChangeFrameOwnerProperties(
276 marginWidth, m_marginHeight, m_scrollingMode); 269 marginWidth, m_marginHeight, m_scrollingMode, isDisplayNone());
277 } 270 }
278 m_marginWidth = marginWidth; 271 m_marginWidth = marginWidth;
279 frameOwnerPropertiesChanged(); 272 frameOwnerPropertiesChanged();
280 } 273 }
281 274
282 void HTMLFrameElementBase::setMarginHeight(int marginHeight) { 275 void HTMLFrameElementBase::setMarginHeight(int marginHeight) {
283 if (m_marginHeight == marginHeight) 276 if (m_marginHeight == marginHeight)
284 return; 277 return;
285 278
286 if (contentDocument()) { 279 if (contentDocument()) {
287 contentDocument()->willChangeFrameOwnerProperties( 280 contentDocument()->willChangeFrameOwnerProperties(
288 m_marginWidth, marginHeight, m_scrollingMode); 281 m_marginWidth, marginHeight, m_scrollingMode, isDisplayNone());
289 } 282 }
290 m_marginHeight = marginHeight; 283 m_marginHeight = marginHeight;
291 frameOwnerPropertiesChanged(); 284 frameOwnerPropertiesChanged();
292 } 285 }
293 286
294 } // namespace blink 287 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698