PointerEventManager fires PointerEvents even when there's no listener |
|||
Issue descriptionSeems PointerEventManager::dispatchPointerEvent doesn't check for event listeners (checkForListener = false) by default for all events except for pointerenter/leave. Only enter/leave events dispatchers provide explicit checkForListener values. This is a bit of extra work for all other events, and contributes to unnecessary use-counts for PointerEventDispatch & PointerEventDispatchPointerDown. We have changed this code quite a few times but the original intention is unchanged IIRC: except for enter/leave, we want to follow regular checks. Navid, could you please take a look?
,
Jan 10 2017
For enter/leave, we are checking for listeners separately (further upstream in the event path) so I am pretty sure we won't change it. For other events, I don't recall why we had no listener checks. Is it because there could be a capturing listener in an ancestor node?
,
Jan 10 2017
I don't know the original reason to be honest with you. I just tried to keep the behavior the same and not to break the existing code. Rick do you know any particular reason? For the Leave/Enter if this is what you are referring to this is not that further up in the stack: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/input/BoundaryEventDispatcher.cpp?sq=package:chromium&dr=CSs&rcl=1484065239&l=111 Event there I didn't quite understand why the logic was like that.
,
Jan 11 2017
The EventTarget dispatch code already checks for listeners, so my comment about "a bit of extra work" is useless here since one more function call is nothing. UMA counting is clearly wrong: let's move it to around EventTarget::fireEventListeners where the listener check is done. --- Re enter/leave checks: a code health question just came to me. We could have checked for listeners for these two dispatches before, and remove the checkForListener parameters. Not a big concern though.
,
Jan 11 2017
You should just add an override for PointerEvent class; see https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/events/Event.h?q=Event.h&sq=package:chromium&dr=CSs&l=127
,
May 29 2017
,
Jun 7 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6026189765a3923e474f2431524199934c6b162d commit 6026189765a3923e474f2431524199934c6b162d Author: eirage <eirage@chromium.org> Date: Wed Jun 07 20:14:41 2017 Bookkeep the pointer event listeners added to page Check if the page has pointer event listeners before firing the pointer events. BUG= 679828 Review-Url: https://codereview.chromium.org/2916893003 Cr-Commit-Position: refs/heads/master@{#477743} [add] https://crrev.com/6026189765a3923e474f2431524199934c6b162d/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-handler-count.html [modify] https://crrev.com/6026189765a3923e474f2431524199934c6b162d/third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-event-dispatch-expected.txt [modify] https://crrev.com/6026189765a3923e474f2431524199934c6b162d/third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp [modify] https://crrev.com/6026189765a3923e474f2431524199934c6b162d/third_party/WebKit/Source/core/frame/EventHandlerRegistry.h [modify] https://crrev.com/6026189765a3923e474f2431524199934c6b162d/third_party/WebKit/Source/core/html/forms/SliderThumbElement.cpp [modify] https://crrev.com/6026189765a3923e474f2431524199934c6b162d/third_party/WebKit/Source/core/input/PointerEventManager.cpp [modify] https://crrev.com/6026189765a3923e474f2431524199934c6b162d/third_party/WebKit/Source/core/testing/Internals.cpp [modify] https://crrev.com/6026189765a3923e474f2431524199934c6b162d/third_party/WebKit/Source/core/testing/Internals.h [modify] https://crrev.com/6026189765a3923e474f2431524199934c6b162d/third_party/WebKit/Source/core/testing/Internals.idl
,
Jun 7 2017
,
Jun 7 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by nzolghadr@chromium.org
, Jan 10 2017