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

Unified Diff: LayoutTests/fast/events/hit-test-counts.html

Issue 1142283004: Implement a Hit Test Cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix git cl format mangling Created 5 years, 7 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
Index: LayoutTests/fast/events/hit-test-counts.html
diff --git a/LayoutTests/fast/events/hit-test-counts.html b/LayoutTests/fast/events/hit-test-counts.html
index cfef9cf58136aab4bdc53b2c9fd47f0be9a6635e..4e39d6d9fba12e0feb2929439384ecdbec356cee 100644
--- a/LayoutTests/fast/events/hit-test-counts.html
+++ b/LayoutTests/fast/events/hit-test-counts.html
@@ -43,6 +43,16 @@ function hitTestCountDelta(doc)
return newCount - lastCount;
}
+function hitTestCacheHitsDelta(doc)
+{
+ var lastCount = 0;
+ if ('lastHitTestCacheHits' in doc)
+ lastCount = doc.lastHitTestCacheHits;
+ var newCount = internals.hitTestCacheHits(doc);
+ doc.lastHitTestCacheHits = newCount;
+ return newCount - lastCount;
+}
+
function logCounts(label, documents, multiTapNotification, eventSenderFunction)
{
if (eventSenderFunction)
@@ -50,7 +60,7 @@ function logCounts(label, documents, multiTapNotification, eventSenderFunction)
var countStr = '';
for(var i = 0; i < documents.length; i++)
- countStr += ' ' + hitTestCountDelta(documents[i]);
+ countStr += ' ' + hitTestCountDelta(documents[i]) + "/" + hitTestCacheHitsDelta(documents[i]);
Rick Byers 2015/06/05 20:48:59 nit: I'd find this more readable if it was "<misse
dtapuska 2015/06/09 18:21:23 Done.
if (multiTapNotification) {
debug(label + ':' + eventCounts[label]
@@ -64,8 +74,10 @@ function logCounts(label, documents, multiTapNotification, eventSenderFunction)
function clearCounts(documents)
{
- for(var i = 0; i < documents.length; i++)
+ for(var i = 0; i < documents.length; i++) {
documents[i].lastHitTestCount = internals.hitTestCount(documents[i]);
+ documents[i].lastHitTestCacheHits = internals.hitTestCacheHits(documents[i]);
+ }
}
function sendEvents(targetX, targetY, documents, multiTapNotification)

Powered by Google App Engine
This is Rietveld 408576698