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

Side by Side Diff: Source/core/layout/LayoutPart.cpp

Issue 1308173007: Correct touch rect hit-test against iframe with scrolled content (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « LayoutTests/fast/dom/nodesFromRect/resources/child-frame-scrolled.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 if (result.hitTestRequest().listBased()) { 177 if (result.hitTestRequest().listBased()) {
178 result.append(childFrameResult); 178 result.append(childFrameResult);
179 } else if (isInsideChildFrame) { 179 } else if (isInsideChildFrame) {
180 // Force the result not to be cacheable because the parent 180 // Force the result not to be cacheable because the parent
181 // frame should not cache this result; as it won't be notified o f 181 // frame should not cache this result; as it won't be notified o f
182 // changes in the child. 182 // changes in the child.
183 childFrameResult.setCacheable(false); 183 childFrameResult.setCacheable(false);
184 result = childFrameResult; 184 result = childFrameResult;
185 } 185 }
186 186
187 if (isInsideChildFrame) 187 // Don't trust |isInsideChildFrame|. Returns true only when the hit test
188 // point/rect is totally within the iframe, i.e. nodeAtPointOverWidg et()
189 // also returns true.
190 // Use a temparory HitTestResult because we don't want to collect th e
191 // iframe element itself if the hit-test rect is totally within the iframe.
192 HitTestResult pointOverWidgetResult = result;
193 if (isInsideChildFrame
194 && nodeAtPointOverWidget(pointOverWidgetResult, locationInContai ner, accumulatedOffset, action))
Rick Byers 2015/09/08 15:12:33 If this returns false, we'll run it again below.
Yufeng Shen (Slow to review) 2015/09/08 18:44:53 right, optimized so that nodeAtPointOverWidget() w
188 return true; 195 return true;
196
189 } 197 }
190 } 198 }
191 199
192 return nodeAtPointOverWidget(result, locationInContainer, accumulatedOffset, action); 200 return nodeAtPointOverWidget(result, locationInContainer, accumulatedOffset, action);
193 } 201 }
194 202
195 CompositingReasons LayoutPart::additionalCompositingReasons() const 203 CompositingReasons LayoutPart::additionalCompositingReasons() const
196 { 204 {
197 if (requiresAcceleratedCompositing()) 205 if (requiresAcceleratedCompositing())
198 return CompositingReasonIFrame; 206 return CompositingReasonIFrame;
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 if (widget() && widget()->isFrameView()) { 346 if (widget() && widget()->isFrameView()) {
339 FrameView* childFrameView = toFrameView(widget()); 347 FrameView* childFrameView = toFrameView(widget());
340 PaintInvalidationState childViewPaintInvalidationState(*childFrameView-> layoutView(), paintInvalidationState); 348 PaintInvalidationState childViewPaintInvalidationState(*childFrameView-> layoutView(), paintInvalidationState);
341 toFrameView(widget())->invalidateTreeIfNeeded(childViewPaintInvalidation State); 349 toFrameView(widget())->invalidateTreeIfNeeded(childViewPaintInvalidation State);
342 } 350 }
343 351
344 LayoutReplaced::invalidatePaintOfSubtreesIfNeeded(paintInvalidationState); 352 LayoutReplaced::invalidatePaintOfSubtreesIfNeeded(paintInvalidationState);
345 } 353 }
346 354
347 } 355 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/nodesFromRect/resources/child-frame-scrolled.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698