mus: PointerWatcher events always have null event.target |
||
Issue descriptionIf an event both targets a window and matches an EventObserver the EventObserver will run before normal event dispatch. Because PointerWatcher is implemented as an EventObserver this means that event.target is always null, even if the event would hit a target in the window. This complicates converting existing EventHandlers to PointerWatchers because some of the code assumes a valid event.target. I think a reasonable fix for this is to run the PointerWatchers after normal event dispatch. Then they can: * Use the target found during dispatch. * Optionally decide not to do anything if the event was flagged as handled
,
Apr 28 2016
Yes. But in the case that it hits a window owned by the EventObserver's process, the target is still null, which is unexpected. There are at least a few EventHandlers that I want to convert to PointerWatchers that use event.target. TrayEventFilter, OverflowBubble and ShelfTooltipManager for example. OTOH, it might be possible to rewrite all of them not to use event.target, and we could decide by policy that in PointerWatchers event.target is always null. What do you think?
,
Apr 28 2016
I think it'd be better if the PointerWatcher didn't expect to find a valid event.target. I suspect in a few places, it uses the target to convert the event-location to system/native locations. We could perhaps include that in the event itself. For other cases, I am unsure, perhaps do things differently so it doesn't depend on event.target? But yeah, I would prefer that over sometimes setting event.target and sometimes not.
,
Apr 28 2016
OK, I'll see if I can refactor the ones I find not to use event.target. I'll also document for PointerWatcher that event.target is null.
,
Apr 28 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/49b741a1d0f59e24f3653ee71558b4ec4332b63e commit 49b741a1d0f59e24f3653ee71558b4ec4332b63e Author: jamescook <jamescook@chromium.org> Date: Thu Apr 28 18:37:26 2016 mus: Add comment to PointerWatcher By policy, event.target is always null. BUG= 607590 TEST=none, just a comment Review-Url: https://codereview.chromium.org/1927163002 Cr-Commit-Position: refs/heads/master@{#390430} [modify] https://crrev.com/49b741a1d0f59e24f3653ee71558b4ec4332b63e/ui/views/pointer_watcher.h |
||
►
Sign in to add a comment |
||
Comment 1 by sadrul@chromium.org
, Apr 28 2016