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

Issue 206603002: Add EventHandlerRegistry (Closed)

Created:
6 years, 9 months ago by Sami
Modified:
6 years, 8 months ago
CC:
blink-reviews, kenneth.christiansen, jamesr, sof, eae+blinkwatch, blink-layers+watch_chromium.org, dglazkov+blink, adamk+blink_chromium.org, Inactive, rwlbuis, Zeeshan Qureshi
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Add EventHandlerRegistry This patch introduces a generic EventHandlerRegistry document supplement for keeping track for event handlers on EventTargets. The EventHandlerRegistry provides a hash map of EventTargets for scroll events; touch and wheel events will be added later. Currently the target set contains all event handler targets in the host document. Future patches will add handlers from child documents. Initially the registry only tracks scroll handlers, but upcoming patches will migrate the existing code paths for tracking touch and wheel events to use this registry instead. TEST=fast/events/scroll-event-handler-count.html BUG=347366 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=171885

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : Tests. #

Total comments: 2

Patch Set 4 : Refactoring WIP. #

Patch Set 5 : Refactoring WIP. #

Total comments: 2

Patch Set 6 : WIP snapshot. #

Patch Set 7 : Logic is mostly there but still fails some tests. #

Patch Set 8 : Tests now seem to pass. #

Total comments: 34

Patch Set 9 : Review comments. #

Patch Set 10 : Add test for external handlers. #

Total comments: 2

Patch Set 11 : Rebased. #

Total comments: 11

Patch Set 12 : More comments. #

Total comments: 6

Patch Set 13 : Fix merge snafu. #

Patch Set 14 : Rebased. #

Patch Set 15 : Rebase harder. #

Total comments: 4

Patch Set 16 : Added comments. Replaced nullptr with 0 to fix build. #

Total comments: 12

Patch Set 17 : Review comments (except breaking up the patch). #

Patch Set 18 : Just the registry. #

Total comments: 18

Patch Set 19 : Rebased. #

Patch Set 20 : Adam's comments -- further splitting still TODO. #

Patch Set 21 : Start with the bare minimum. #

Total comments: 13

Patch Set 22 : Adam's comments. #

Patch Set 23 : One more unneeded include. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+386 lines, -0 lines) Patch
A LayoutTests/fast/events/scroll-event-handler-count.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +37 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/scroll-event-handler-count-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +19 lines, -0 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +2 lines, -0 lines 0 comments Download
A Source/core/dom/EventHandlerRegistry.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +94 lines, -0 lines 0 comments Download
A Source/core/dom/EventHandlerRegistry.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +202 lines, -0 lines 0 comments Download
M Source/core/dom/Node.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 6 chunks +7 lines, -0 lines 0 comments Download
M Source/core/testing/Internals.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 20 21 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/testing/Internals.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +23 lines, -0 lines 0 comments Download
M Source/core/testing/Internals.idl View 1 2 3 4 5 6 7 8 20 21 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 30 (0 generated)
Sami
Ian, wanna look this over? This is mostly identical to wheel event handler tracking except ...
6 years, 9 months ago (2014-03-20 21:25:51 UTC) #1
abarth-chromium
https://codereview.chromium.org/206603002/diff/40001/Source/core/dom/ScrollEventHandlerController.cpp File Source/core/dom/ScrollEventHandlerController.cpp (right): https://codereview.chromium.org/206603002/diff/40001/Source/core/dom/ScrollEventHandlerController.cpp#newcode77 Source/core/dom/ScrollEventHandlerController.cpp:77: } So much copy/pasted code. Can you extract a ...
6 years, 9 months ago (2014-03-20 23:42:06 UTC) #2
Rick Byers
Thanks for working on this Sami! I like the direction of the unification you're doing. ...
6 years, 9 months ago (2014-03-24 14:27:58 UTC) #3
Sami
Thanks for the great feedback Rick. I'm glad that you think the unification makes sense. ...
6 years, 9 months ago (2014-03-24 15:03:53 UTC) #4
Rick Byers
On 2014/03/24 15:03:53, Sami wrote: > Thanks for the great feedback Rick. I'm glad that ...
6 years, 9 months ago (2014-03-24 15:15:27 UTC) #5
Sami
Rick, do you want to do a first pass over this since it looks like ...
6 years, 9 months ago (2014-03-26 20:08:39 UTC) #6
Rick Byers
On 2014/03/26 20:08:39, Sami wrote: > Rick, do you want to do a first pass ...
6 years, 9 months ago (2014-03-27 15:02:55 UTC) #7
Rick Byers
This looks awesome Sami, thanks! My comments are now relatively minor. > Currently we are ...
6 years, 9 months ago (2014-03-27 16:43:31 UTC) #8
Sami
Thanks for the excellent in-depth review Rick. All points addressed. > If there were things ...
6 years, 8 months ago (2014-04-02 19:58:04 UTC) #9
Rick Byers
Great work! A couple more things... https://codereview.chromium.org/206603002/diff/180001/LayoutTests/fast/events/event-handler-count.html File LayoutTests/fast/events/event-handler-count.html (right): https://codereview.chromium.org/206603002/diff/180001/LayoutTests/fast/events/event-handler-count.html#newcode154 LayoutTests/fast/events/event-handler-count.html:154: debug("Test redundant addEventListener ...
6 years, 8 months ago (2014-04-03 15:33:18 UTC) #10
Sami
Thanks again Rick! https://codereview.chromium.org/206603002/diff/200001/Source/core/dom/EventHandlerRegistry.h File Source/core/dom/EventHandlerRegistry.h (right): https://codereview.chromium.org/206603002/diff/200001/Source/core/dom/EventHandlerRegistry.h#newcode55 Source/core/dom/EventHandlerRegistry.h:55: void didMoveToNewDocument(EventTarget&, Document& oldDocument); On 2014/04/03 ...
6 years, 8 months ago (2014-04-04 19:53:56 UTC) #11
Rick Byers
https://codereview.chromium.org/206603002/diff/200001/Source/core/dom/EventHandlerRegistry.h File Source/core/dom/EventHandlerRegistry.h (right): https://codereview.chromium.org/206603002/diff/200001/Source/core/dom/EventHandlerRegistry.h#newcode105 Source/core/dom/EventHandlerRegistry.h:105: unsigned externalHandlerCount; On 2014/04/04 19:53:57, Sami wrote: > On ...
6 years, 8 months ago (2014-04-04 20:12:26 UTC) #12
Sami
> Yeah I wouldn't want to expose this to clients either - I was thinking ...
6 years, 8 months ago (2014-04-07 14:56:48 UTC) #13
Rick Byers
LGTM! On 2014/04/07 14:56:48, Sami wrote: > > Yeah I wouldn't want to expose this ...
6 years, 8 months ago (2014-04-07 18:50:53 UTC) #14
Sami
Thank you Rick. Ian and Adam, could I get your opinions too please?
6 years, 8 months ago (2014-04-08 11:05:39 UTC) #15
Ian Vollick
ScrollingCoordinator lg2m, and although I really like the rest of the code, I'm really new ...
6 years, 8 months ago (2014-04-08 15:40:51 UTC) #16
Sami
https://codereview.chromium.org/206603002/diff/280001/Source/core/frame/LocalFrame.cpp File Source/core/frame/LocalFrame.cpp (right): https://codereview.chromium.org/206603002/diff/280001/Source/core/frame/LocalFrame.cpp#newcode471 Source/core/frame/LocalFrame.cpp:471: On 2014/04/08 15:40:51, Ian Vollick wrote: > Is this ...
6 years, 8 months ago (2014-04-08 16:24:59 UTC) #17
Sami
Adam, ping?
6 years, 8 months ago (2014-04-10 15:34:31 UTC) #18
abarth-chromium
This CL is too large and complex to review accurately. Can we break it down ...
6 years, 8 months ago (2014-04-10 21:25:58 UTC) #19
Sami
> This CL is too large and complex to review accurately. Can we break it ...
6 years, 8 months ago (2014-04-11 16:46:53 UTC) #20
Sami
This is now split as follows: 1. Refactor wheel event handler registration in ScrollingCoordinator: https://codereview.chromium.org/234913005 ...
6 years, 8 months ago (2014-04-11 18:18:26 UTC) #21
abarth-chromium
On 2014/04/11 18:18:26, Sami wrote: > Each iteration builds and has tests coverage, so hopefully ...
6 years, 8 months ago (2014-04-11 18:49:03 UTC) #22
abarth-chromium
This CL is still too big. :( Can we do one event class at a ...
6 years, 8 months ago (2014-04-11 19:08:00 UTC) #23
Sami
> This CL is still too big. :( > > Can we do one event ...
6 years, 8 months ago (2014-04-15 18:31:51 UTC) #24
Sami
I think I've now managed to prune this to a smaller version that still does ...
6 years, 8 months ago (2014-04-16 14:15:36 UTC) #25
abarth-chromium
LGTM w/ some minor comments. https://codereview.chromium.org/206603002/diff/400001/Source/core/dom/EventHandlerRegistry.cpp File Source/core/dom/EventHandlerRegistry.cpp (right): https://codereview.chromium.org/206603002/diff/400001/Source/core/dom/EventHandlerRegistry.cpp#newcode60 Source/core/dom/EventHandlerRegistry.cpp:60: } I presume you've ...
6 years, 8 months ago (2014-04-17 18:05:11 UTC) #26
Sami
Thanks, all comments addressed. https://codereview.chromium.org/206603002/diff/400001/Source/core/dom/EventHandlerRegistry.cpp File Source/core/dom/EventHandlerRegistry.cpp (right): https://codereview.chromium.org/206603002/diff/400001/Source/core/dom/EventHandlerRegistry.cpp#newcode60 Source/core/dom/EventHandlerRegistry.cpp:60: } On 2014/04/17 18:05:12, abarth ...
6 years, 8 months ago (2014-04-17 18:40:53 UTC) #27
Sami
The CQ bit was checked by skyostil@chromium.org
6 years, 8 months ago (2014-04-17 19:01:12 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@chromium.org/206603002/440001
6 years, 8 months ago (2014-04-17 19:01:34 UTC) #29
commit-bot: I haz the power
6 years, 8 months ago (2014-04-17 20:12:51 UTC) #30
Message was sent while issue was closed.
Change committed as 171885

Powered by Google App Engine
This is Rietveld 408576698