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

Unified Diff: third_party/WebKit/Source/core/page/TouchDisambiguation.cpp

Issue 2950553003: Tune tap disambiguation triggering threshold. (Closed)
Patch Set: Fix tests Created 3 years, 6 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 | « no previous file | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/page/TouchDisambiguation.cpp
diff --git a/third_party/WebKit/Source/core/page/TouchDisambiguation.cpp b/third_party/WebKit/Source/core/page/TouchDisambiguation.cpp
index c32d42c10ba4730d3774facaa5bf0749c6c80a2a..557f059c01b0fbb4087aa349d66b6bca1bb42185 100644
--- a/third_party/WebKit/Source/core/page/TouchDisambiguation.cpp
+++ b/third_party/WebKit/Source/core/page/TouchDisambiguation.cpp
@@ -152,12 +152,18 @@ void FindGoodTouchTargets(const IntRect& touch_box_in_root_frame,
}
}
+ // The scoring function uses the overlap area with the fat point as the score.
+ // We ignore the candidates that have less than this (empirically tuned)
+ // fraction of overlap than the best candidate to avoid excessive popups.
+ //
+ // If this value were 1, then the disambiguation feature would only be seen
+ // when two nodes have precisely the same overlap with the touch radius. If
+ // it were 0, then any miniscule overlap with the edge of another node would
+ // trigger it.
+ const float kRelativeAmbiguityThreshold = 0.75f;
+
for (const auto& touch_target : touch_targets) {
- // Currently the scoring function uses the overlap area with the fat point
- // as the score. We ignore the candidates that has less than 1/2 overlap
- // (we consider not really ambiguous enough) than the best candidate to
- // avoid excessive popups.
- if (touch_target.value.score < best_score * 0.5)
+ if (touch_target.value.score < best_score * kRelativeAmbiguityThreshold)
continue;
good_targets.push_back(touch_target.value.window_bounding_box);
highlight_nodes.push_back(touch_target.key);
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698