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

Unified Diff: Source/core/paint/DeprecatedPaintLayer.cpp

Issue 1289753006: Fallback to root layer if hit-testing does not hit anything in iframe (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/events/resources/body-overflow-iframe.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/DeprecatedPaintLayer.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayer.cpp b/Source/core/paint/DeprecatedPaintLayer.cpp
index e959ac12c71119335e8658c459a34e4855746927..ed879ff8d76b99b1e901582a5e70746d6c722a5c 100644
--- a/Source/core/paint/DeprecatedPaintLayer.cpp
+++ b/Source/core/paint/DeprecatedPaintLayer.cpp
@@ -1503,7 +1503,20 @@ bool DeprecatedPaintLayer::hitTest(HitTestResult& result)
// should not use RequestType for it. Perhaps best for it to be done at a higher level. See
// http://crbug.com/505825
LayoutPoint hitPoint = hitTestLocation.point();
- if (!request.isChildFrameHitTest() && ((request.active() || request.release()) || (request.move() && hitTestArea.contains(hitPoint.x(), hitPoint.y()))) && isRootLayer()) {
+ bool fallback = false;
+ if (!request.isChildFrameHitTest()) {
+ if (((request.active() || request.release()) || (request.move() && hitTestArea.contains(hitPoint.x(), hitPoint.y()))) && isRootLayer())
+ fallback = true;
+ } else {
+ // Falling back to iframe's root layer is more restrict:
+ // 1) It can't be rect based test. Rect based test is list based hit-testing, which should search
+ // all the elements overlapping the test rect. If we set iframe is hit due to fallback, main frame
+ // will stop hit testing search, and the result list will be incomplete.
Rick Byers 2015/08/17 15:18:29 So what does this mean for a tap that occurs entir
Yufeng Shen (Slow to review) 2015/08/18 16:05:21 ah, right, if the hit-rect (for tap) is totally wi
+ // 2) The hitPoint must be within the visible rect of the iframe.
+ if (!hitTestLocation.isRectBasedTest() && (request.active() || request.release() || request.move()) && hitTestArea.contains(hitPoint.x(), hitPoint.y()) && isRootLayer())
Rick Byers 2015/08/17 15:18:29 Can you just avoid checking the hit test flags (re
Yufeng Shen (Slow to review) 2015/08/18 16:05:21 Done.
+ fallback = true;
+ }
Rick Byers 2015/08/17 15:18:29 I think you could more clearly separate the confus
Yufeng Shen (Slow to review) 2015/08/18 16:05:21 done.
Rick Byers 2015/08/19 19:23:19 I don't think part of the test is important, in fa
majidvp 2015/08/19 21:02:30 Actually, it is there for cases where the event is
majidvp 2015/08/20 16:29:35 I took a second look and I think Rick is correct a
+ if (fallback) {
layoutObject()->updateHitTestResult(result, toLayoutView(layoutObject())->flipForWritingMode(hitTestLocation.point()));
insideLayer = this;
« no previous file with comments | « LayoutTests/fast/events/resources/body-overflow-iframe.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698