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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutPart.cpp
diff --git a/Source/core/layout/LayoutPart.cpp b/Source/core/layout/LayoutPart.cpp
index 81cd54bf1e1324ecab7af1dc2023757b8c868bea..c811419bd389d072f80ca40667429862e72b5e86 100644
--- a/Source/core/layout/LayoutPart.cpp
+++ b/Source/core/layout/LayoutPart.cpp
@@ -184,8 +184,16 @@ bool LayoutPart::nodeAtPoint(HitTestResult& result, const HitTestLocation& locat
result = childFrameResult;
}
- if (isInsideChildFrame)
+ // Don't trust |isInsideChildFrame|. Returns true only when the hit test
+ // point/rect is totally within the iframe, i.e. nodeAtPointOverWidget()
+ // also returns true.
+ // Use a temparory HitTestResult because we don't want to collect the
+ // iframe element itself if the hit-test rect is totally within the iframe.
+ HitTestResult pointOverWidgetResult = result;
+ if (isInsideChildFrame
+ && nodeAtPointOverWidget(pointOverWidgetResult, locationInContainer, 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
return true;
+
}
}
« 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