4 years, 10 months ago
(2015-06-24 12:46:08 UTC)
#17
On 2015/06/23 22:19:21, lanwei wrote:
>
https://codereview.chromium.org/1174683004/diff/180001/LayoutTests/fast/event...
> File
> LayoutTests/fast/events/mouse-event-from-touch-source-device-event-sender.html
> (right):
>
>
https://codereview.chromium.org/1174683004/diff/180001/LayoutTests/fast/event...
>
LayoutTests/fast/events/mouse-event-from-touch-source-device-event-sender.html:16:
> document.addEventListener("mouseup", mouseHandler);
> On 2015/06/23 00:55:57, Rick Byers wrote:
> > nit: please add a 'click' handler too.
> > You can do this concisely with something like:
> >
> > for (var evt of ['mousemove', 'mousedown', 'mouseup', 'click') {
> > document.addEventListener(evt, mouseHandler);
> > }
>
> Done.
>
>
https://codereview.chromium.org/1174683004/diff/180001/LayoutTests/fast/event...
> File LayoutTests/fast/events/mouse-event-source-device-event-sender.html
> (right):
>
>
https://codereview.chromium.org/1174683004/diff/180001/LayoutTests/fast/event...
> LayoutTests/fast/events/mouse-event-source-device-event-sender.html:15:
> document.addEventListener("mouseup", mouseHandler);
> On 2015/06/23 00:55:57, Rick Byers wrote:
> > also add click listener here too
>
> Done.
>
>
https://codereview.chromium.org/1174683004/diff/180001/LayoutTests/fast/event...
> File LayoutTests/fast/events/uievent-with-inputdevice.html (right):
>
>
https://codereview.chromium.org/1174683004/diff/180001/LayoutTests/fast/event...
> LayoutTests/fast/events/uievent-with-inputdevice.html:36:
> mouseevent.initMouseEvent("mousedown", true, true, window, 0, 0, 0, 0, 0,
false,
> false, false, false, 0, null, sourceDevice);
> On 2015/06/23 00:55:57, Rick Byers wrote:
> > nit: please use the 'new MouseEvent' style instead or as well (just like the
> > 'new UIEvent' above). If we're only going to test one of the patterns than
> the
> > modern style is probably the one we really care about.
>
> Done.
>
>
https://codereview.chromium.org/1174683004/diff/180001/Source/core/events/Mou...
> File Source/core/events/MouseEvent.cpp (right):
>
>
https://codereview.chromium.org/1174683004/diff/180001/Source/core/events/Mou...
> Source/core/events/MouseEvent.cpp:92: ctrlKey, altKey, shiftKey, metaKey,
> isSimulated)
> On 2015/06/23 00:55:57, Rick Byers wrote:
> > rather than rely on a setSourceDevice method on UIEvent you can use a
> > conditional expression in the ctor here, eg:
> > syntheticEventType == PlatformMouseEvent::FromtTouch ?
> > InputDevice::firestouchEventsInputDevice() :
> > InputDevice::doesntFireTouchEventsInputDevice();
> >
> > Ideally the source device in a UIEvent would be immutable (so we don't need
to
> > worry about how to behave if it changes).
>
> Done.
>
>
https://codereview.chromium.org/1174683004/diff/180001/Source/core/events/Mou...
> File Source/core/events/MouseEvent.h (right):
>
>
https://codereview.chromium.org/1174683004/diff/180001/Source/core/events/Mou...
> Source/core/events/MouseEvent.h:70: short button,
> PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, InputDevice* sourceDevice,
> unsigned short buttons = 0);
> On 2015/06/23 00:55:57, Rick Byers wrote:
> > Do you really need to add a new overload or could you just rely on a default
> > value (sourceDevice = 0)?
>
> Done.
Good call on sourceDevice being immutable.
I took another look over things, still LGTM.
Rick Byers
Awesome, now nice and simple - thanks! LGTM with nits https://codereview.chromium.org/1174683004/diff/260001/Source/core/events/MouseEvent.cpp File Source/core/events/MouseEvent.cpp (right): https://codereview.chromium.org/1174683004/diff/260001/Source/core/events/MouseEvent.cpp#newcode291 ...
4 years, 10 months ago
(2015-06-25 03:34:54 UTC)
#18
Awesome, now nice and simple - thanks!
LGTM with nits
https://codereview.chromium.org/1174683004/diff/260001/Source/core/events/Mou...
File Source/core/events/MouseEvent.cpp (right):
https://codereview.chromium.org/1174683004/diff/260001/Source/core/events/Mou...
Source/core/events/MouseEvent.cpp:291: doubleClickEvent->initMouseEvent(nullptr,
EventTypeNames::dblclick, event().bubbles(), event().cancelable(),
event().view(),
nit: You should really be using either an eventInitDict or initMouseEvent - not
both at once. Can you just put all the things you need here into the init dict?
If not, I don't have a problem with an internal (i.e. not web exposed)
initMouseEvent method that includes an InputDevice argument - especially if you
can simply implement the web-exposed version of it in terms of your new
overload.
https://codereview.chromium.org/1174683004/diff/260001/Source/core/events/Mou...
File Source/core/events/MouseRelatedEvent.h (right):
https://codereview.chromium.org/1174683004/diff/260001/Source/core/events/Mou...
Source/core/events/MouseRelatedEvent.h:71: bool shiftKey, bool metaKey, bool
isSimulated = false, InputDevice* sourceDevice = nullptr);
nit: as discussed offline, default InputDevice values like this are probably
dangerous (make it too easy for a caller to accidentally forget to provide an
InputDevice - if it should be nullptr then ideally that would be explicit at the
call site). Feel free to just add a "TODO: make this argument non-optional"
comment for now.
lanwei
The CQ bit was checked by lanwei@chromium.org
4 years, 10 months ago
(2015-06-25 19:04:57 UTC)
#19
https://codereview.chromium.org/1174683004/diff/260001/Source/core/events/MouseEvent.cpp File Source/core/events/MouseEvent.cpp (right): https://codereview.chromium.org/1174683004/diff/260001/Source/core/events/MouseEvent.cpp#newcode291 Source/core/events/MouseEvent.cpp:291: doubleClickEvent->initMouseEvent(nullptr, EventTypeNames::dblclick, event().bubbles(), event().cancelable(), event().view(), On 2015/06/25 03:34:54, Rick ...
4 years, 10 months ago
(2015-06-25 19:26:40 UTC)
#22
https://codereview.chromium.org/1174683004/diff/260001/Source/core/events/Mou...
File Source/core/events/MouseEvent.cpp (right):
https://codereview.chromium.org/1174683004/diff/260001/Source/core/events/Mou...
Source/core/events/MouseEvent.cpp:291: doubleClickEvent->initMouseEvent(nullptr,
EventTypeNames::dblclick, event().bubbles(), event().cancelable(),
event().view(),
On 2015/06/25 03:34:54, Rick Byers wrote:
> nit: You should really be using either an eventInitDict or initMouseEvent -
not
> both at once. Can you just put all the things you need here into the init
dict?
>
> If not, I don't have a problem with an internal (i.e. not web exposed)
> initMouseEvent method that includes an InputDevice argument - especially if
you
> can simply implement the web-exposed version of it in terms of your new
> overload.
Done.
https://codereview.chromium.org/1174683004/diff/260001/Source/core/events/Mou...
File Source/core/events/MouseRelatedEvent.h (right):
https://codereview.chromium.org/1174683004/diff/260001/Source/core/events/Mou...
Source/core/events/MouseRelatedEvent.h:71: bool shiftKey, bool metaKey, bool
isSimulated = false, InputDevice* sourceDevice = nullptr);
On 2015/06/25 03:34:54, Rick Byers wrote:
> nit: as discussed offline, default InputDevice values like this are probably
> dangerous (make it too easy for a caller to accidentally forget to provide an
> InputDevice - if it should be nullptr then ideally that would be explicit at
the
> call site). Feel free to just add a "TODO: make this argument non-optional"
> comment for now.
Done.
commit-bot: I haz the power
Committed patchset #7 (id:280001) as https://src.chromium.org/viewvc/blink?view=rev&revision=197849
4 years, 10 months ago
(2015-06-25 19:58:46 UTC)
#23
Issue 1174683004: Populates sourceDevice attribute into MouseEvent
(Closed)
Created 4 years, 10 months ago by lanwei
Modified 4 years, 10 months ago
Reviewers: Rick Byers, tdresser
Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Comments: 19