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

Issue 1142283004: Implement a Hit Test Cache. (Closed)

Created:
5 years, 7 months ago by dtapuska
Modified:
5 years, 6 months ago
CC:
blink-reviews, blink-reviews-paint_chromium.org, blink-reviews-rendering, Rik, danakj, dglazkov+blink, dshwang, krit, eae+blinkwatch, f(malita), fs, gyuyoung2, jbroman, jchaffraix+rendering, Justin Novosad, kouhei+svg_chromium.org, leviw+renderwatch, pdr+graphicswatchlist_chromium.org, pdr+svgwatchlist_chromium.org, pdr+renderingwatchlist_chromium.org, pdr., rwlbuis, Stephen Chennney, slimming-paint-reviews_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Implement a Hit Test Cache for same point hits. Introduce a HitTestCache which can be used to return hit tests from the cache. Currently each cache hit is verified against the true result and a UMA metric recorded. Once no false positives have been seen in UMA short circuiting the verify will be done. Rect and list based hit tests aren't cached just yet; again this will be a future improvement. Add Internals APIs to return the hit test cache hits, the ability to clear the hit test cache and make specialized requests. This commit attempt fixes two issues that appeared to cause some flaky test failures 1) List based requests were returned which it appears we can do non-rect based list requests which I didn't anticipate. 2) LayoutPart incorrected allowed the HitTestResult to be cached on the parent's frame causing a set of incorrect results. Add test to check this. BUG=398920 TEST=Tools/Scripts/run-webkit-tests Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=197233

Patch Set 1 #

Total comments: 1

Patch Set 2 : Implement single point cache #

Patch Set 3 : Adjust UMA metrics to report two different ones #

Patch Set 4 : Fix git cl format mangling #

Total comments: 66

Patch Set 5 : Address comments in patch set 4 #

Patch Set 6 : Remove stray file #

Total comments: 5

Patch Set 7 : Adjust comments in HitTestCache.h #

Total comments: 16

Patch Set 8 : Fix comments from tdresser #

Total comments: 6

Patch Set 9 : Use HeapVector with inline capacity #

Patch Set 10 : Rebase against ToT #

Patch Set 11 : Seems verify is a macro on MacOSX; change name. #

Patch Set 12 : Fix iframe caching issue; caused flaky test #

Patch Set 13 : Minor tweak when result is over widget #

Patch Set 14 : Remove validity rect as per Elliott's request #

Unified diffs Side-by-side diffs Delta from patch set Stats (+641 lines, -89 lines) Patch
A LayoutTests/fast/events/hit-test-cache.html View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +136 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/hit-test-cache-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +62 lines, -0 lines 0 comments Download
M LayoutTests/fast/events/hit-test-counts.html View 1 2 3 4 5 chunks +23 lines, -3 lines 0 comments Download
M LayoutTests/fast/events/hit-test-counts-expected.txt View 1 2 3 4 1 chunk +66 lines, -60 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/TreeScope.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +3 lines, -2 lines 0 comments Download
M Source/core/dom/TreeScope.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +7 lines, -3 lines 0 comments Download
M Source/core/frame/FrameView.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
A Source/core/layout/HitTestCache.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +96 lines, -0 lines 0 comments Download
A Source/core/layout/HitTestCache.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +87 lines, -0 lines 0 comments Download
M Source/core/layout/HitTestRequest.h View 1 2 3 4 2 chunks +12 lines, -0 lines 0 comments Download
M Source/core/layout/HitTestResult.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +27 lines, -1 line 0 comments Download
M Source/core/layout/HitTestResult.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +30 lines, -2 lines 0 comments Download
M Source/core/layout/LayoutPart.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +8 lines, -3 lines 0 comments Download
M Source/core/layout/LayoutView.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +7 lines, -1 line 0 comments Download
M Source/core/layout/LayoutView.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +17 lines, -9 lines 0 comments Download
M Source/core/paint/DeprecatedPaintLayer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +6 lines, -5 lines 0 comments Download
M Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/testing/Internals.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/testing/Internals.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +43 lines, -0 lines 0 comments Download
M Source/core/testing/Internals.idl View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 49 (14 generated)
Rick Byers
I'm impressed with how far you've gotten with a relatively small amount of additional complexity. ...
5 years, 7 months ago (2015-05-25 19:11:30 UTC) #2
esprehn
You don't need to worry about the compositor animations, the main thread is sync'ed with ...
5 years, 7 months ago (2015-05-25 21:01:45 UTC) #4
dtapuska
On 2015/05/25 21:01:45, esprehn wrote: > You don't need to worry about the compositor animations, ...
5 years, 6 months ago (2015-05-28 17:27:00 UTC) #5
dtapuska
On 2015/05/28 17:27:00, Dave Tapuska wrote: > On 2015/05/25 21:01:45, esprehn wrote: > > You ...
5 years, 6 months ago (2015-06-03 14:01:46 UTC) #7
Rick Byers
Sorry for the long delay - finally getting through my review backlog after vacation. I ...
5 years, 6 months ago (2015-06-05 20:48:59 UTC) #8
Rick Byers
Ok, all done. Looks great, just a couple more minor suggestions. https://codereview.chromium.org/1142283004/diff/60001/Source/core/layout/HitTestCache.cpp File Source/core/layout/HitTestCache.cpp (right): ...
5 years, 6 months ago (2015-06-06 16:12:54 UTC) #9
esprehn
You need to also clear the cache if there's a DOM mutation, we can do ...
5 years, 6 months ago (2015-06-06 21:14:30 UTC) #10
Rick Byers
https://codereview.chromium.org/1142283004/diff/60001/Source/core/layout/HitTestCache.h File Source/core/layout/HitTestCache.h (right): https://codereview.chromium.org/1142283004/diff/60001/Source/core/layout/HitTestCache.h#newcode57 Source/core/layout/HitTestCache.h:57: CacheItem m_items[2]; On 2015/06/06 21:14:30, esprehn wrote: > We're ...
5 years, 6 months ago (2015-06-07 04:34:46 UTC) #11
Rick Byers
https://codereview.chromium.org/1142283004/diff/60001/Source/core/layout/HitTestCache.cpp File Source/core/layout/HitTestCache.cpp (right): https://codereview.chromium.org/1142283004/diff/60001/Source/core/layout/HitTestCache.cpp#newcode9 Source/core/layout/HitTestCache.cpp:9: #include <base/macros.h> On 2015/06/06 21:14:30, esprehn wrote: > On ...
5 years, 6 months ago (2015-06-07 04:44:57 UTC) #12
dtapuska
Adding oil-pan reviews to comment on the use of the HitTestCache object off of the ...
5 years, 6 months ago (2015-06-09 18:21:25 UTC) #14
sof
https://codereview.chromium.org/1142283004/diff/100001/Source/core/layout/LayoutView.h File Source/core/layout/LayoutView.h (right): https://codereview.chromium.org/1142283004/diff/100001/Source/core/layout/LayoutView.h#newcode219 Source/core/layout/LayoutView.h:219: HitTestCache m_hitTestCache; Oilpan-wise, to make this work on LayoutView, ...
5 years, 6 months ago (2015-06-09 18:59:18 UTC) #15
dtapuska
https://codereview.chromium.org/1142283004/diff/100001/Source/core/layout/LayoutView.h File Source/core/layout/LayoutView.h (right): https://codereview.chromium.org/1142283004/diff/100001/Source/core/layout/LayoutView.h#newcode219 Source/core/layout/LayoutView.h:219: HitTestCache m_hitTestCache; On 2015/06/09 18:59:18, sof wrote: > Oilpan-wise, ...
5 years, 6 months ago (2015-06-09 19:39:15 UTC) #16
sof
On 2015/06/09 19:39:15, Dave Tapuska wrote: > https://codereview.chromium.org/1142283004/diff/100001/Source/core/layout/LayoutView.h > File Source/core/layout/LayoutView.h (right): > > https://codereview.chromium.org/1142283004/diff/100001/Source/core/layout/LayoutView.h#newcode219 ...
5 years, 6 months ago (2015-06-09 20:17:46 UTC) #17
dtapuska
> If you wanted to you could process these weak references manually with a weak ...
5 years, 6 months ago (2015-06-09 20:45:44 UTC) #18
Rick Byers
This LGTM from my perspective now (modulo wrapping up the outstanding questions/issues with esprehn/sof of ...
5 years, 6 months ago (2015-06-09 21:08:21 UTC) #19
dtapuska
https://codereview.chromium.org/1142283004/diff/100001/Source/core/layout/HitTestCache.h File Source/core/layout/HitTestCache.h (right): https://codereview.chromium.org/1142283004/diff/100001/Source/core/layout/HitTestCache.h#newcode12 Source/core/layout/HitTestCache.h:12: // This object implements a cache for storing successfuly ...
5 years, 6 months ago (2015-06-09 21:13:01 UTC) #20
sof
On 2015/06/09 20:45:44, Dave Tapuska wrote: > > If you wanted to you could process ...
5 years, 6 months ago (2015-06-09 21:32:55 UTC) #21
tdresser
https://codereview.chromium.org/1142283004/diff/120001/Source/core/dom/TreeScope.h File Source/core/dom/TreeScope.h (right): https://codereview.chromium.org/1142283004/diff/120001/Source/core/dom/TreeScope.h#newcode214 Source/core/dom/TreeScope.h:214: HitTestResult hitTestInDocument(const Document*, int x, int y, const HitTestRequest& ...
5 years, 6 months ago (2015-06-10 13:35:22 UTC) #22
dtapuska
https://codereview.chromium.org/1142283004/diff/120001/Source/core/dom/TreeScope.h File Source/core/dom/TreeScope.h (right): https://codereview.chromium.org/1142283004/diff/120001/Source/core/dom/TreeScope.h#newcode214 Source/core/dom/TreeScope.h:214: HitTestResult hitTestInDocument(const Document*, int x, int y, const HitTestRequest& ...
5 years, 6 months ago (2015-06-10 14:04:49 UTC) #23
tdresser
On 2015/06/10 14:04:49, Dave Tapuska wrote: > https://codereview.chromium.org/1142283004/diff/120001/Source/core/dom/TreeScope.h > File Source/core/dom/TreeScope.h (right): > > https://codereview.chromium.org/1142283004/diff/120001/Source/core/dom/TreeScope.h#newcode214 ...
5 years, 6 months ago (2015-06-10 14:11:04 UTC) #24
dtapuska
On 2015/06/09 21:32:55, sof wrote: > On 2015/06/09 20:45:44, Dave Tapuska wrote: > > > ...
5 years, 6 months ago (2015-06-10 21:08:19 UTC) #25
sof
On 2015/06/10 21:08:19, Dave Tapuska wrote: > On 2015/06/09 21:32:55, sof wrote: > > On ...
5 years, 6 months ago (2015-06-10 21:43:05 UTC) #26
esprehn
Can you explain how the rect is computed? It seems right now you just create ...
5 years, 6 months ago (2015-06-12 05:09:30 UTC) #27
dtapuska
On 2015/06/12 05:09:30, esprehn wrote: > Can you explain how the rect is computed? It ...
5 years, 6 months ago (2015-06-12 13:09:42 UTC) #28
esprehn
That makes sense, can you explain in your change description that this just does exact ...
5 years, 6 months ago (2015-06-12 15:12:49 UTC) #29
dtapuska
https://codereview.chromium.org/1142283004/diff/140001/Source/core/layout/HitTestCache.cpp File Source/core/layout/HitTestCache.cpp (right): https://codereview.chromium.org/1142283004/diff/140001/Source/core/layout/HitTestCache.cpp#newcode78 Source/core/layout/HitTestCache.cpp:78: for (size_t i = 0; i < WTF_ARRAY_LENGTH(m_items); ++i) ...
5 years, 6 months ago (2015-06-12 15:30:38 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1142283004/160001
5 years, 6 months ago (2015-06-12 16:43:33 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: mac_blink_compile_dbg on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/mac_blink_compile_dbg/builds/47364) mac_blink_rel on tryserver.blink (JOB_FAILED, ...
5 years, 6 months ago (2015-06-12 16:47:09 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1142283004/180001
5 years, 6 months ago (2015-06-12 17:58:31 UTC) #38
commit-bot: I haz the power
Try jobs failed on following builders: mac_blink_compile_dbg on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/mac_blink_compile_dbg/builds/47373)
5 years, 6 months ago (2015-06-12 18:09:28 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1142283004/200001
5 years, 6 months ago (2015-06-12 19:59:04 UTC) #43
commit-bot: I haz the power
Committed patchset #11 (id:200001) as https://src.chromium.org/viewvc/blink?view=rev&revision=197063
5 years, 6 months ago (2015-06-12 21:56:17 UTC) #44
esprehn
lgtm
5 years, 6 months ago (2015-06-16 22:55:23 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1142283004/260001
5 years, 6 months ago (2015-06-17 00:23:30 UTC) #48
commit-bot: I haz the power
5 years, 6 months ago (2015-06-17 03:05:50 UTC) #49
Message was sent while issue was closed.
Committed patchset #14 (id:260001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=197233

Powered by Google App Engine
This is Rietveld 408576698