Changeset 237658 in webkit
- Timestamp:
- Oct 31, 2018, 3:44:27 PM (8 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/ios/WKContentViewInteraction.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r237648 r237658 1 2018-10-31 Zalan Bujtas <zalan@apple.com> 2 3 [iOS] Do not paint tap highlight unless it is above a certain threshold 4 https://bugs.webkit.org/show_bug.cgi?id=191134 5 <rdar://problem/43615142> 6 7 Flashing a large portion of the screen on every tap looks unpleasant. 8 This patch impoves the existing heuristic by adding area check and a % threshold. 9 10 Reviewed by Tim Horton. 11 12 * UIProcess/ios/WKContentViewInteraction.mm: 13 (-[WKContentView _showTapHighlight]): 14 (highlightedQuadsAreSmallerThanRect): Deleted. 15 1 16 2018-10-31 Wenson Hsieh <wenson_hsieh@apple.com> 2 17 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r237607 r237658 1152 1152 #endif 1153 1153 1154 static inline bool highlightedQuadsAreSmallerThanRect(const Vector<FloatQuad>& quads, const FloatRect& rect)1155 {1156 for (size_t i = 0; i < quads.size(); ++i) {1157 FloatRect boundingBox = quads[i].boundingBox();1158 if (boundingBox.width() > rect.width() || boundingBox.height() > rect.height())1159 return false;1160 }1161 return true;1162 }1163 1164 1154 static NSValue *nsSizeForTapHighlightBorderRadius(WebCore::IntSize borderRadius, CGFloat borderRadiusScale) 1165 1155 { … … 1224 1214 - (void)_showTapHighlight 1225 1215 { 1226 if (!highlightedQuadsAreSmallerThanRect(_tapHighlightInformation.quads, _page->unobscuredContentRect()) && !_showDebugTapHighlightsForFastClicking) 1216 auto shouldPaintTapHighlight = [&](const FloatRect& rect) { 1217 static const float highlightPaintThreshold = 0.3; // 30% 1218 float highlightArea = 0; 1219 for (auto highlightQuad : _tapHighlightInformation.quads) { 1220 auto boundingBox = highlightQuad.boundingBox(); 1221 highlightArea += boundingBox.area(); 1222 if (boundingBox.width() > (rect.width() * highlightPaintThreshold) || boundingBox.height() > (rect.height() * highlightPaintThreshold)) 1223 return false; 1224 } 1225 return highlightArea < rect.area() * highlightPaintThreshold; 1226 }; 1227 1228 if (!shouldPaintTapHighlight(_page->unobscuredContentRect()) && !_showDebugTapHighlightsForFastClicking) 1227 1229 return; 1228 1230
Note:
See TracChangeset
for help on using the changeset viewer.