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

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

Issue 2564633002: Don't create layout objects for children of display-none iframes. (Closed)
Patch Set: Add new layout tests. Created 4 years 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 return; 107 return;
108 if (!contentFrame() || scriptURL.isEmpty() || !contentFrame()->isLocalFrame()) 108 if (!contentFrame() || scriptURL.isEmpty() || !contentFrame()->isLocalFrame())
109 return; 109 return;
110 if (contentFrame()->owner()->getSandboxFlags() & SandboxOrigin) 110 if (contentFrame()->owner()->getSandboxFlags() & SandboxOrigin)
111 return; 111 return;
112 toLocalFrame(contentFrame()) 112 toLocalFrame(contentFrame())
113 ->script() 113 ->script()
114 .executeScriptIfJavaScriptURL(scriptURL, this); 114 .executeScriptIfJavaScriptURL(scriptURL, this);
115 } 115 }
116 116
117 void HTMLFrameElementBase::frameOwnerPropertiesChanged() {
118 // Don't notify about updates if contentFrame() is null, for example when
119 // the subframe hasn't been created yet.
120 if (contentFrame())
121 document().frame()->loader().client()->didChangeFrameOwnerProperties(this);
122 }
123
124 void HTMLFrameElementBase::parseAttribute(const QualifiedName& name, 117 void HTMLFrameElementBase::parseAttribute(const QualifiedName& name,
125 const AtomicString& oldValue, 118 const AtomicString& oldValue,
126 const AtomicString& value) { 119 const AtomicString& value) {
127 if (name == srcdocAttr) { 120 if (name == srcdocAttr) {
128 if (!value.isNull()) { 121 if (!value.isNull()) {
129 setLocation(srcdocURL().getString()); 122 setLocation(srcdocURL().getString());
130 } else { 123 } else {
131 const AtomicString& srcValue = fastGetAttribute(srcAttr); 124 const AtomicString& srcValue = fastGetAttribute(srcAttr);
132 if (!srcValue.isNull()) 125 if (!srcValue.isNull())
133 setLocation(stripLeadingAndTrailingHTMLSpaces(srcValue)); 126 setLocation(stripLeadingAndTrailingHTMLSpaces(srcValue));
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 } 237 }
245 HTMLFrameOwnerElement::defaultEventHandler(event); 238 HTMLFrameOwnerElement::defaultEventHandler(event);
246 } 239 }
247 240
248 void HTMLFrameElementBase::setScrollingMode(ScrollbarMode scrollbarMode) { 241 void HTMLFrameElementBase::setScrollingMode(ScrollbarMode scrollbarMode) {
249 if (m_scrollingMode == scrollbarMode) 242 if (m_scrollingMode == scrollbarMode)
250 return; 243 return;
251 244
252 if (contentDocument()) { 245 if (contentDocument()) {
253 contentDocument()->willChangeFrameOwnerProperties( 246 contentDocument()->willChangeFrameOwnerProperties(
254 m_marginWidth, m_marginHeight, scrollbarMode); 247 m_marginWidth, m_marginHeight, scrollbarMode, isDisplayNone());
255 } 248 }
256 m_scrollingMode = scrollbarMode; 249 m_scrollingMode = scrollbarMode;
257 frameOwnerPropertiesChanged(); 250 frameOwnerPropertiesChanged();
258 } 251 }
259 252
260 void HTMLFrameElementBase::setMarginWidth(int marginWidth) { 253 void HTMLFrameElementBase::setMarginWidth(int marginWidth) {
261 if (m_marginWidth == marginWidth) 254 if (m_marginWidth == marginWidth)
262 return; 255 return;
263 256
264 if (contentDocument()) { 257 if (contentDocument()) {
265 contentDocument()->willChangeFrameOwnerProperties( 258 contentDocument()->willChangeFrameOwnerProperties(
266 marginWidth, m_marginHeight, m_scrollingMode); 259 marginWidth, m_marginHeight, m_scrollingMode, isDisplayNone());
267 } 260 }
268 m_marginWidth = marginWidth; 261 m_marginWidth = marginWidth;
269 frameOwnerPropertiesChanged(); 262 frameOwnerPropertiesChanged();
270 } 263 }
271 264
272 void HTMLFrameElementBase::setMarginHeight(int marginHeight) { 265 void HTMLFrameElementBase::setMarginHeight(int marginHeight) {
273 if (m_marginHeight == marginHeight) 266 if (m_marginHeight == marginHeight)
274 return; 267 return;
275 268
276 if (contentDocument()) { 269 if (contentDocument()) {
277 contentDocument()->willChangeFrameOwnerProperties( 270 contentDocument()->willChangeFrameOwnerProperties(
278 m_marginWidth, marginHeight, m_scrollingMode); 271 m_marginWidth, marginHeight, m_scrollingMode, isDisplayNone());
279 } 272 }
280 m_marginHeight = marginHeight; 273 m_marginHeight = marginHeight;
281 frameOwnerPropertiesChanged(); 274 frameOwnerPropertiesChanged();
282 } 275 }
283 276
284 } // namespace blink 277 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698