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

Issue 237963014: Track scroll event handlers in nested documents (Closed)

Created:
6 years, 8 months ago by Sami
Modified:
6 years, 7 months ago
CC:
blink-reviews, sof, eae+blinkwatch, dglazkov+blink, adamk+blink_chromium.org, Inactive, rwlbuis
Visibility:
Public.

Description

Track scroll event handlers in nested documents This patch moves the EventHandlerRegistry from the Document object to the Page so that it tracks handlers in all documents on the page. This makes it possible to do global queries for event handlers. TEST=fast/events/scroll-event-handler-count.html BUG=359566, 367297, 369082 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=173101

Patch Set 1 #

Patch Set 2 : Rebased. #

Patch Set 3 : Rebased. #

Patch Set 4 : Rebased. #

Patch Set 5 : Removed dupe call to didRemoveAllEventHandlers. #

Total comments: 6

Patch Set 6 : Address comments. #

Total comments: 2

Patch Set 7 : More simplification. #

Total comments: 8

Patch Set 8 : Cleanup. #

Total comments: 1

Patch Set 9 : Global registry. #

Patch Set 10 : Move to page. #

Patch Set 11 : Removed unneeded function definition. #

Total comments: 6

Patch Set 12 : Remove obsolete comment. #

Patch Set 13 : Asserts and comment. #

Patch Set 14 : Rebased. #

Patch Set 15 : Import event handlers from unattached documents. #

Patch Set 16 : didMove{Into,OutOf}Page #

Total comments: 6

Patch Set 17 : Removed recursion, added more tests. #

Patch Set 18 : One more test. #

Total comments: 1

Patch Set 19 : Discard handlers in detached docs. Moar tests. #

Total comments: 2

Patch Set 20 : Rebased to pick up oilpan changes. #

Patch Set 21 : Expanded test to move child doc from attached doc to unattached one (reverse not possible AFAICT). #

Total comments: 2

Patch Set 22 : Rebased for oilpan. #

Patch Set 23 : More comments and test tweaks. #

Total comments: 1

Patch Set 24 : Oilpan build fix. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+275 lines, -433 lines) Patch
M 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 21 22 1 chunk +111 lines, -0 lines 0 comments Download
M 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 21 22 1 chunk +25 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 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/Document.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 +0 lines, -1 line 0 comments Download
D 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 +0 lines, -96 lines 0 comments Download
D 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 +0 lines, -230 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 7 chunks +15 lines, -7 lines 0 comments Download
A + Source/core/page/EventHandlerRegistry.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 4 chunks +26 lines, -21 lines 0 comments Download
A + Source/core/page/EventHandlerRegistry.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 8 chunks +90 lines, -74 lines 0 comments Download
M Source/core/page/Page.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +2 lines, -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 22 3 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 59 (0 generated)
Sami
6 years, 8 months ago (2014-04-22 09:41:29 UTC) #1
abarth-chromium
https://codereview.chromium.org/237963014/diff/80001/Source/core/dom/EventHandlerRegistry.cpp File Source/core/dom/EventHandlerRegistry.cpp (right): https://codereview.chromium.org/237963014/diff/80001/Source/core/dom/EventHandlerRegistry.cpp#newcode23 Source/core/dom/EventHandlerRegistry.cpp:23: suspendIfNeeded(); As a general pattern, we don't call suspendIfNeeded() ...
6 years, 8 months ago (2014-04-22 16:18:22 UTC) #2
Sami
https://codereview.chromium.org/237963014/diff/80001/Source/core/dom/EventHandlerRegistry.cpp File Source/core/dom/EventHandlerRegistry.cpp (right): https://codereview.chromium.org/237963014/diff/80001/Source/core/dom/EventHandlerRegistry.cpp#newcode23 Source/core/dom/EventHandlerRegistry.cpp:23: suspendIfNeeded(); On 2014/04/22 16:18:23, abarth wrote: > As a ...
6 years, 8 months ago (2014-04-22 18:05:17 UTC) #3
abarth-chromium
On 2014/04/22 18:05:17, Sami wrote: > https://codereview.chromium.org/237963014/diff/80001/Source/core/dom/EventHandlerRegistry.cpp#newcode51 > Source/core/dom/EventHandlerRegistry.cpp:51: { > On 2014/04/22 16:18:23, abarth ...
6 years, 8 months ago (2014-04-22 23:39:45 UTC) #4
abarth-chromium
https://codereview.chromium.org/237963014/diff/100001/Source/core/dom/EventHandlerRegistry.h File Source/core/dom/EventHandlerRegistry.h (right): https://codereview.chromium.org/237963014/diff/100001/Source/core/dom/EventHandlerRegistry.h#newcode82 Source/core/dom/EventHandlerRegistry.h:82: class DocumentObserver: public ActiveDOMObject { I still don't understand ...
6 years, 8 months ago (2014-04-22 23:40:25 UTC) #5
Sami
Thanks again for your comments. I've reworked this to hopefully follow established practices more closely. ...
6 years, 8 months ago (2014-04-23 10:02:34 UTC) #6
abarth-chromium
https://codereview.chromium.org/237963014/diff/120001/Source/core/dom/EventHandlerRegistry.cpp File Source/core/dom/EventHandlerRegistry.cpp (right): https://codereview.chromium.org/237963014/diff/120001/Source/core/dom/EventHandlerRegistry.cpp#newcode30 Source/core/dom/EventHandlerRegistry.cpp:30: , m_document(document) We should be able to remove m_document ...
6 years, 8 months ago (2014-04-23 15:23:28 UTC) #7
Sami
https://codereview.chromium.org/237963014/diff/120001/Source/core/dom/EventHandlerRegistry.cpp File Source/core/dom/EventHandlerRegistry.cpp (right): https://codereview.chromium.org/237963014/diff/120001/Source/core/dom/EventHandlerRegistry.cpp#newcode30 Source/core/dom/EventHandlerRegistry.cpp:30: , m_document(document) On 2014/04/23 15:23:28, abarth wrote: > We ...
6 years, 8 months ago (2014-04-23 16:44:09 UTC) #8
abarth-chromium
On 2014/04/23 16:44:09, Sami wrote: > I don't think we want to register all handlers ...
6 years, 8 months ago (2014-04-23 17:25:28 UTC) #9
abarth-chromium
https://codereview.chromium.org/237963014/diff/140001/Source/core/dom/EventHandlerRegistry.cpp File Source/core/dom/EventHandlerRegistry.cpp (right): https://codereview.chromium.org/237963014/diff/140001/Source/core/dom/EventHandlerRegistry.cpp#newcode156 Source/core/dom/EventHandlerRegistry.cpp:156: target = document; I see, I missed this line.
6 years, 8 months ago (2014-04-23 17:25:53 UTC) #10
Sami
On 2014/04/23 17:25:28, abarth wrote: > On 2014/04/23 16:44:09, Sami wrote: > > I don't ...
6 years, 8 months ago (2014-04-23 17:54:03 UTC) #11
abarth-chromium
It makes sense to summarize the information for use by the compositor, but I don't ...
6 years, 8 months ago (2014-04-23 20:10:27 UTC) #12
Sami
On 2014/04/23 20:10:27, abarth wrote: > It makes sense to summarize the information for use ...
6 years, 8 months ago (2014-04-24 11:00:41 UTC) #13
abarth-chromium
There's nothing special about frame boundaries. The approach in this CL just coalesces at arbitrary ...
6 years, 8 months ago (2014-04-24 15:03:21 UTC) #14
Rick Byers
On 2014/04/24 11:00:41, Sami wrote: > On 2014/04/23 20:10:27, abarth wrote: > > It makes ...
6 years, 8 months ago (2014-04-24 17:02:39 UTC) #15
Rick Byers
On 2014/04/24 17:02:39, Rick Byers wrote: > On 2014/04/24 11:00:41, Sami wrote: > > On ...
6 years, 8 months ago (2014-04-24 17:08:13 UTC) #16
Sami
Thanks Rick. Since I didn't write the original code this is replacing, I ran out ...
6 years, 8 months ago (2014-04-24 17:19:30 UTC) #17
abarth-chromium
On 2014/04/24 17:19:30, Sami wrote: > EventHandlerRegistry::from(document)->hasEventHandlers() will tell you about all > handlers in ...
6 years, 8 months ago (2014-04-24 17:25:35 UTC) #18
Rick Byers
On 2014/04/24 17:19:30, Sami wrote: > Thanks Rick. Since I didn't write the original code ...
6 years, 8 months ago (2014-04-24 17:34:59 UTC) #19
Sami
On 2014/04/24 17:34:59, Rick Byers wrote: > Yes, if it's going to be global then ...
6 years, 8 months ago (2014-04-24 17:46:56 UTC) #20
Rick Byers
On 2014/04/24 17:46:56, Sami wrote: > On 2014/04/24 17:34:59, Rick Byers wrote: > > Yes, ...
6 years, 8 months ago (2014-04-24 17:54:42 UTC) #21
Sami
On 2014/04/24 17:54:42, Rick Byers wrote: > On 2014/04/24 17:46:56, Sami wrote: > > On ...
6 years, 8 months ago (2014-04-24 18:06:03 UTC) #22
Rick Byers
On 2014/04/24 18:06:03, Sami wrote: > On 2014/04/24 17:54:42, Rick Byers wrote: > > On ...
6 years, 8 months ago (2014-04-24 18:09:43 UTC) #23
Sami
On 2014/04/24 18:09:43, Rick Byers wrote: > Yeah I think it's there only because the ...
6 years, 8 months ago (2014-04-24 18:39:59 UTC) #24
abarth-chromium
LGTM assuming Rick is happy. Thanks for being willing try a few approaches.
6 years, 8 months ago (2014-04-24 21:17:56 UTC) #25
Rick Byers
Yeah I like this simplification - thanks for suggesting it Adam! This LGTM to me. ...
6 years, 8 months ago (2014-04-24 21:30:11 UTC) #26
Sami
On 2014/04/24 21:17:56, abarth wrote: > LGTM assuming Rick is happy. Thanks for being willing ...
6 years, 8 months ago (2014-04-25 19:51:15 UTC) #27
Rick Byers
On 2014/04/25 19:51:15, Sami wrote: > On 2014/04/24 21:17:56, abarth wrote: > > LGTM assuming ...
6 years, 8 months ago (2014-04-25 20:13:52 UTC) #28
Sami
On 2014/04/25 20:13:52, Rick Byers wrote: > If we update event handlers at all when ...
6 years, 8 months ago (2014-04-25 21:08:15 UTC) #29
Rick Byers
Ok, LGTM - thanks!
6 years, 8 months ago (2014-04-26 02:27:54 UTC) #30
Sami
I did some testing with link prefetching (http://jsbin.com/yecebogo/4/quiet) and I didn't see any inconsistencies; the ...
6 years, 7 months ago (2014-04-28 10:43:02 UTC) #31
Sami
The CQ bit was checked by skyostil@chromium.org
6 years, 7 months ago (2014-04-28 10:43:09 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@chromium.org/237963014/260001
6 years, 7 months ago (2014-04-28 10:43:40 UTC) #33
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-04-28 12:01:03 UTC) #34
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on linux_blink_dbg
6 years, 7 months ago (2014-04-28 12:01:04 UTC) #35
Sami
Looks like Rick's suggested assertions found some cases where event handlers are modified in a ...
6 years, 7 months ago (2014-04-28 20:52:44 UTC) #36
Rick Byers
Interesting, I was worried about that. Well I guess that's one argument for tracking per-Document ...
6 years, 7 months ago (2014-04-28 21:18:07 UTC) #37
Sami
On 2014/04/28 21:18:07, Rick Byers wrote: > Interesting, I was worried about that. Well I ...
6 years, 7 months ago (2014-04-29 14:21:28 UTC) #38
Sami
On further meditation I think we may have to go back to the per-Document registry. ...
6 years, 7 months ago (2014-04-29 15:40:46 UTC) #39
Rick Byers
Thanks Sami, this is looking great. I just want to make sure we've got the ...
6 years, 7 months ago (2014-04-29 15:41:11 UTC) #40
Sami
Heh, jinx. Let me see why the handlers aren't getting unregistered and report back.
6 years, 7 months ago (2014-04-29 15:43:25 UTC) #41
Rick Byers
On 2014/04/29 15:43:25, Sami wrote: > Heh, jinx. Let me see why the handlers aren't ...
6 years, 7 months ago (2014-04-29 17:57:15 UTC) #42
Sami
I think I've now figured out how we end up with stale event handler targets ...
6 years, 7 months ago (2014-04-29 18:37:42 UTC) #43
Rick Byers
On 2014/04/29 18:37:42, Sami wrote: > I think I've now figured out how we end ...
6 years, 7 months ago (2014-04-29 19:08:21 UTC) #44
Sami
On 2014/04/29 19:08:21, Rick Byers wrote: > > We could fix this by un/registering handlers ...
6 years, 7 months ago (2014-04-29 21:58:09 UTC) #45
Rick Byers
Great, this seems like it should (hopefully) be adequate. I love the extra validation and ...
6 years, 7 months ago (2014-04-30 17:28:49 UTC) #46
Rick Byers
On 2014/04/30 17:28:49, Rick Byers wrote: > Great, this seems like it should (hopefully) be ...
6 years, 7 months ago (2014-04-30 17:30:17 UTC) #47
abarth-chromium
I haven't followed the latest discussion in detail, but the CL LGTM
6 years, 7 months ago (2014-04-30 19:17:43 UTC) #48
Sami
Thanks both. > Looks like the site isolation guys have put stuff in there asking ...
6 years, 7 months ago (2014-05-01 13:29:33 UTC) #49
Rick Byers
Great, thanks! Lets land this monster ;-) https://codereview.chromium.org/237963014/diff/430001/Source/core/testing/Internals.cpp File Source/core/testing/Internals.cpp (right): https://codereview.chromium.org/237963014/diff/430001/Source/core/testing/Internals.cpp#newcode1251 Source/core/testing/Internals.cpp:1251: if (!document.page()) ...
6 years, 7 months ago (2014-05-01 13:42:35 UTC) #50
Sami
The CQ bit was checked by skyostil@chromium.org
6 years, 7 months ago (2014-05-01 14:01:19 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@chromium.org/237963014/430001
6 years, 7 months ago (2014-05-01 14:01:26 UTC) #52
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-01 14:50:15 UTC) #53
commit-bot: I haz the power
Try jobs failed on following builders: win_blink_rel on tryserver.blink
6 years, 7 months ago (2014-05-01 14:50:16 UTC) #54
Sami
Hmm, virtual/serviceworker/http/tests/serviceworker/serviceworkerglobalscope-scope.html seems to be flaky. Saw the same crash without my patch too.
6 years, 7 months ago (2014-05-01 17:42:11 UTC) #55
Sami
The CQ bit was checked by skyostil@chromium.org
6 years, 7 months ago (2014-05-01 17:42:22 UTC) #56
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skyostil@chromium.org/237963014/450001
6 years, 7 months ago (2014-05-01 17:42:41 UTC) #57
Sami
On 2014/05/01 17:42:11, Sami wrote: > Hmm, > virtual/serviceworker/http/tests/serviceworker/serviceworkerglobalscope-scope.html > seems to be flaky. Saw ...
6 years, 7 months ago (2014-05-01 17:44:16 UTC) #58
commit-bot: I haz the power
6 years, 7 months ago (2014-05-01 18:44:27 UTC) #59
Message was sent while issue was closed.
Change committed as 173101

Powered by Google App Engine
This is Rietveld 408576698