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

Side by Side Diff: Source/core/rendering/RenderPart.cpp

Issue 842033003: Cleanup RemotePlatformLayer when disconnecting RemoteFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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) 2000 Simon Hausmann <hausmann@kde.org> 3 * (C) 2000 Simon Hausmann <hausmann@kde.org>
4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de)
5 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2011. 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // renderer and the plugin has a layer, then we need a layer. Second, if thi s is 125 // renderer and the plugin has a layer, then we need a layer. Second, if thi s is
126 // a renderer with a contentDocument and that document needs a layer, then w e need 126 // a renderer with a contentDocument and that document needs a layer, then w e need
127 // a layer. 127 // a layer.
128 if (widget() && widget()->isPluginView() && toPluginView(widget())->platform Layer()) 128 if (widget() && widget()->isPluginView() && toPluginView(widget())->platform Layer())
129 return true; 129 return true;
130 130
131 if (!node() || !node()->isFrameOwnerElement()) 131 if (!node() || !node()->isFrameOwnerElement())
132 return false; 132 return false;
133 133
134 HTMLFrameOwnerElement* element = toHTMLFrameOwnerElement(node()); 134 HTMLFrameOwnerElement* element = toHTMLFrameOwnerElement(node());
135 if (element->contentFrame() && element->contentFrame()->remotePlatformLayer( )) 135 if (element->contentFrame() && element->contentFrame()->isRemoteFrame())
136 return true; 136 return true;
137 137
138 if (Document* contentDocument = element->contentDocument()) { 138 if (Document* contentDocument = element->contentDocument()) {
139 if (RenderView* view = contentDocument->renderView()) 139 if (RenderView* view = contentDocument->renderView())
140 return view->usesCompositing(); 140 return view->usesCompositing();
141 } 141 }
142 142
143 return false; 143 return false;
144 } 144 }
145 145
(...skipping 13 matching lines...) Expand all
159 if ((inside || result.isRectBasedTest()) && !hadResult && result.innerNode() == node()) 159 if ((inside || result.isRectBasedTest()) && !hadResult && result.innerNode() == node())
160 result.setIsOverWidget(contentBoxRect().contains(result.localPoint())); 160 result.setIsOverWidget(contentBoxRect().contains(result.localPoint()));
161 return inside; 161 return inside;
162 } 162 }
163 163
164 bool RenderPart::nodeAtPoint(const HitTestRequest& request, HitTestResult& resul t, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOff set, HitTestAction action) 164 bool RenderPart::nodeAtPoint(const HitTestRequest& request, HitTestResult& resul t, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOff set, HitTestAction action)
165 { 165 {
166 if (!widget() || !widget()->isFrameView() || !request.allowsChildFrameConten t()) 166 if (!widget() || !widget()->isFrameView() || !request.allowsChildFrameConten t())
167 return nodeAtPointOverWidget(request, result, locationInContainer, accum ulatedOffset, action); 167 return nodeAtPointOverWidget(request, result, locationInContainer, accum ulatedOffset, action);
168 168
169 // FIXME: Until RemoteFrames use RemoteFrameViews, we need an explicit check here.
170 if (toFrameView(widget())->frame().isRemoteFrameTemporary())
kenrb 2015/01/23 18:31:02 I am surprised if this does not break input events
lfg 2015/02/03 03:43:46 RemoteFrameViews return false to isFrameView(), so
171 return nodeAtPointOverWidget(request, result, locationInContainer, accum ulatedOffset, action);
172
173 FrameView* childFrameView = toFrameView(widget()); 169 FrameView* childFrameView = toFrameView(widget());
174 RenderView* childRoot = childFrameView->renderView(); 170 RenderView* childRoot = childFrameView->renderView();
175 171
176 if (visibleToHitTestRequest(request) && childRoot) { 172 if (visibleToHitTestRequest(request) && childRoot) {
177 LayoutPoint adjustedLocation = accumulatedOffset + location(); 173 LayoutPoint adjustedLocation = accumulatedOffset + location();
178 LayoutPoint contentOffset = LayoutPoint(borderLeft() + paddingLeft(), bo rderTop() + paddingTop()) - LayoutSize(childFrameView->scrollOffset()); 174 LayoutPoint contentOffset = LayoutPoint(borderLeft() + paddingLeft(), bo rderTop() + paddingTop()) - LayoutSize(childFrameView->scrollOffset());
179 HitTestLocation newHitTestLocation(locationInContainer, -adjustedLocatio n - contentOffset); 175 HitTestLocation newHitTestLocation(locationInContainer, -adjustedLocatio n - contentOffset);
180 HitTestRequest newHitTestRequest(request.type() | HitTestRequest::ChildF rameHitTest); 176 HitTestRequest newHitTestRequest(request.type() | HitTestRequest::ChildF rameHitTest);
181 HitTestResult childFrameResult(newHitTestLocation); 177 HitTestResult childFrameResult(newHitTestLocation);
182 178
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 if (widget->frameRect() == newFrame) 325 if (widget->frameRect() == newFrame)
330 return false; 326 return false;
331 327
332 RefPtrWillBeRawPtr<RenderPart> protector(this); 328 RefPtrWillBeRawPtr<RenderPart> protector(this);
333 RefPtrWillBeRawPtr<Node> protectedNode(node()); 329 RefPtrWillBeRawPtr<Node> protectedNode(node());
334 widget->setFrameRect(newFrame); 330 widget->setFrameRect(newFrame);
335 return widget->frameRect().size() != newFrame.size(); 331 return widget->frameRect().size() != newFrame.size();
336 } 332 }
337 333
338 } 334 }
OLDNEW
« no previous file with comments | « Source/core/page/EventHandler.cpp ('k') | Source/core/rendering/compositing/CompositedLayerMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698