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

Side by Side Diff: third_party/WebKit/Source/web/WebFrame.cpp

Issue 2564633002: Don't create layout objects for children of display-none iframes. (Closed)
Patch Set: . 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "public/web/WebFrame.h" 5 #include "public/web/WebFrame.h"
6 6
7 #include "bindings/core/v8/WindowProxyManager.h" 7 #include "bindings/core/v8/WindowProxyManager.h"
8 #include "core/HTMLNames.h" 8 #include "core/HTMLNames.h"
9 #include "core/frame/FrameHost.h" 9 #include "core/frame/FrameHost.h"
10 #include "core/frame/FrameView.h" 10 #include "core/frame/FrameView.h"
11 #include "core/frame/LocalFrame.h" 11 #include "core/frame/LocalFrame.h"
12 #include "core/frame/RemoteFrame.h" 12 #include "core/frame/RemoteFrame.h"
13 #include "core/html/HTMLFrameElementBase.h" 13 #include "core/html/HTMLFrameElementBase.h"
14 #include "core/html/HTMLFrameOwnerElement.h" 14 #include "core/html/HTMLFrameOwnerElement.h"
15 #include "core/page/Page.h" 15 #include "core/page/Page.h"
16 #include "platform/UserGestureIndicator.h" 16 #include "platform/UserGestureIndicator.h"
17 #include "platform/heap/Handle.h" 17 #include "platform/heap/Handle.h"
18 #include "public/web/WebElement.h" 18 #include "public/web/WebElement.h"
19 #include "public/web/WebFrameOwnerProperties.h" 19 #include "public/web/WebFrameOwnerProperties.h"
20 #include "public/web/WebSandboxFlags.h" 20 #include "public/web/WebSandboxFlags.h"
21 #include "web/OpenedFrameTracker.h" 21 #include "web/OpenedFrameTracker.h"
22 #include "web/RemoteFrameOwner.h" 22 #include "web/RemoteFrameOwner.h"
23 #include "web/WebLocalFrameImpl.h" 23 #include "web/WebLocalFrameImpl.h"
24 #include "web/WebRemoteFrameImpl.h" 24 #include "web/WebRemoteFrameImpl.h"
25 #include <algorithm> 25 #include <algorithm>
26
27 namespace blink { 26 namespace blink {
28 27
29 bool WebFrame::swap(WebFrame* frame) { 28 bool WebFrame::swap(WebFrame* frame) {
30 using std::swap; 29 using std::swap;
31 Frame* oldFrame = toImplBase()->frame(); 30 Frame* oldFrame = toImplBase()->frame();
32 if (oldFrame->isDetaching()) 31 if (oldFrame->isDetaching())
33 return false; 32 return false;
34 33
35 // Unload the current Document in this frame: this calls unload handlers, 34 // Unload the current Document in this frame: this calls unload handlers,
36 // detaches child frames, etc. Since this runs script, make sure this frame 35 // detaches child frames, etc. Since this runs script, make sure this frame
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // for frames with a remote owner. 138 // for frames with a remote owner.
140 RemoteFrameOwner* owner = toRemoteFrameOwner(toImplBase()->frame()->owner()); 139 RemoteFrameOwner* owner = toRemoteFrameOwner(toImplBase()->frame()->owner());
141 DCHECK(owner); 140 DCHECK(owner);
142 141
143 Frame* frame = toImplBase()->frame(); 142 Frame* frame = toImplBase()->frame();
144 DCHECK(frame); 143 DCHECK(frame);
145 144
146 if (frame->isLocalFrame()) { 145 if (frame->isLocalFrame()) {
147 toLocalFrame(frame)->document()->willChangeFrameOwnerProperties( 146 toLocalFrame(frame)->document()->willChangeFrameOwnerProperties(
148 properties.marginWidth, properties.marginHeight, 147 properties.marginWidth, properties.marginHeight,
149 static_cast<ScrollbarMode>(properties.scrollingMode)); 148 static_cast<ScrollbarMode>(properties.scrollingMode),
149 properties.isDisplayNone);
150 } 150 }
151 151
152 owner->setScrollingMode(properties.scrollingMode); 152 owner->setScrollingMode(properties.scrollingMode);
153 owner->setMarginWidth(properties.marginWidth); 153 owner->setMarginWidth(properties.marginWidth);
154 owner->setMarginHeight(properties.marginHeight); 154 owner->setMarginHeight(properties.marginHeight);
155 owner->setAllowFullscreen(properties.allowFullscreen); 155 owner->setAllowFullscreen(properties.allowFullscreen);
156 owner->setIsDisplayNone(properties.isDisplayNone);
156 owner->setCsp(properties.requiredCsp); 157 owner->setCsp(properties.requiredCsp);
157 owner->setDelegatedpermissions(properties.delegatedPermissions); 158 owner->setDelegatedpermissions(properties.delegatedPermissions);
158 } 159 }
159 160
160 WebFrame* WebFrame::opener() const { 161 WebFrame* WebFrame::opener() const {
161 return m_opener; 162 return m_opener;
162 } 163 }
163 164
164 void WebFrame::setOpener(WebFrame* opener) { 165 void WebFrame::setOpener(WebFrame* opener) {
165 if (m_opener) 166 if (m_opener)
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 void WebFrame::clearWeakFrames(VisitorDispatcher visitor) { \ 337 void WebFrame::clearWeakFrames(VisitorDispatcher visitor) { \
337 clearWeakFramesImpl(visitor); \ 338 clearWeakFramesImpl(visitor); \
338 } 339 }
339 340
340 DEFINE_VISITOR_METHOD(Visitor*) 341 DEFINE_VISITOR_METHOD(Visitor*)
341 DEFINE_VISITOR_METHOD(InlinedGlobalMarkingVisitor) 342 DEFINE_VISITOR_METHOD(InlinedGlobalMarkingVisitor)
342 343
343 #undef DEFINE_VISITOR_METHOD 344 #undef DEFINE_VISITOR_METHOD
344 345
345 } // namespace blink 346 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698