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

Unified Diff: third_party/WebKit/Source/core/events/PointerEventFactory.cpp

Issue 1968653005: Set width=height=1 of mouse like pointer events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/events/PointerEventFactory.cpp
diff --git a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
index 9eed8a9e3ae87d8169da4ce58f9b71870e456669..86c15ccd53d65875e6711b35599841bf512a37b0 100644
--- a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
+++ b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
@@ -92,6 +92,10 @@ PointerEvent* PointerEventFactory::create(
EventTarget* relatedTarget,
LocalDOMWindow* view)
{
+ DCHECK(mouseEventName == EventTypeNames::mousemove
+ || mouseEventName == EventTypeNames::mousedown
+ || mouseEventName == EventTypeNames::mouseup);
+
AtomicString pointerEventName = pointerEventNameForMouseEventName(mouseEventName);
unsigned buttons = MouseEvent::platformModifiersToButtons(mouseEvent.getModifiers());
PointerEventInit pointerEventInit;
@@ -119,14 +123,16 @@ PointerEvent* PointerEventFactory::create(
if (pointerEventName == EventTypeNames::pointerdown
|| pointerEventName == EventTypeNames::pointerup) {
pointerEventInit.setButton(mouseEvent.button());
- } else {
- // TODO(crbug.com/587955): We are setting NoButton for transition
- // pointerevents should be resolved as part of this bug
+ } else { // Only when pointerEventName == EventTypeNames::pointermove
pointerEventInit.setButton(NoButton);
}
pointerEventInit.setPressure(getPointerEventPressure(
mouseEvent.pointerProperties().force, pointerEventInit.buttons()));
+ // Set width/height to 1 because it matches Edge (and supported by the spec).
+ pointerEventInit.setWidth(1);
+ pointerEventInit.setHeight(1);
+
UIEventWithKeyState::setFromPlatformModifiers(pointerEventInit, mouseEvent.getModifiers());
// Make sure chorded buttons fire pointermove instead of pointerup/down.

Powered by Google App Engine
This is Rietveld 408576698