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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutInlineTest.cpp

Issue 2616483002: Reduce rectangle merges when doing region-based hit test on text boxes (Closed)
Patch Set: Improve test to be platform agnostic. Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutInline.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutInlineTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutInlineTest.cpp b/third_party/WebKit/Source/core/layout/LayoutInlineTest.cpp
index d9ac2f1f3cb2fba33dce320c1291509b87046b40..9e0287f890af5c2ed09f1fda4a038b50eeda4fd8 100644
--- a/third_party/WebKit/Source/core/layout/LayoutInlineTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutInlineTest.cpp
@@ -40,4 +40,34 @@ TEST_F(LayoutInlineTest, SimpleContinuation) {
EXPECT_FALSE(splitInlinePart2->continuation());
}
+TEST_F(LayoutInlineTest, RegionHitTest) {
+ setBodyInnerHTML(
+ "<div><span id='lotsOfBoxes'>"
+ "This is a test line<br>This is a test line<br>This is a test line<br>"
+ "This is a test line<br>This is a test line<br>This is a test line<br>"
+ "This is a test line<br>This is a test line<br>This is a test line<br>"
+ "This is a test line<br>This is a test line<br>This is a test line<br>"
+ "This is a test line<br>This is a test line<br>This is a test line<br>"
+ "This is a test line<br>This is a test line<br>This is a test line<br>"
+ "</span></div>");
+
+ document().view()->updateAllLifecyclePhases();
+
+ LayoutInline* lotsOfBoxes =
+ toLayoutInline(getLayoutObjectByElementId("lotsOfBoxes"));
+ ASSERT_TRUE(lotsOfBoxes);
+
+ HitTestRequest hitRequest(HitTestRequest::TouchEvent |
+ HitTestRequest::ListBased);
+ LayoutPoint hitLocation(2, 5);
+ HitTestResult hitResult(hitRequest, hitLocation, 2, 1, 2, 1);
+ LayoutPoint hitOffset;
+
+ bool hitOutcome = lotsOfBoxes->hitTestCulledInline(
+ hitResult, hitResult.hitTestLocation(), hitOffset);
+ // Assert checks that we both hit something and that the area covered
+ // by "something" totally contains the hit region.
+ EXPECT_TRUE(hitOutcome);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutInline.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698