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

Side by Side Diff: third_party/WebKit/Source/core/events/PointerEventFactory.cpp

Issue 2024243002: Set default width/height of pointer events to 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/events/PointerEventFactory.h" 5 #include "core/events/PointerEventFactory.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "platform/geometry/FloatSize.h" 8 #include "platform/geometry/FloatSize.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 if (pointerEventName == EventTypeNames::pointerdown 123 if (pointerEventName == EventTypeNames::pointerdown
124 || pointerEventName == EventTypeNames::pointerup) { 124 || pointerEventName == EventTypeNames::pointerup) {
125 pointerEventInit.setButton(mouseEvent.button()); 125 pointerEventInit.setButton(mouseEvent.button());
126 } else { // Only when pointerEventName == EventTypeNames::pointermove 126 } else { // Only when pointerEventName == EventTypeNames::pointermove
127 pointerEventInit.setButton(NoButton); 127 pointerEventInit.setButton(NoButton);
128 } 128 }
129 pointerEventInit.setPressure(getPointerEventPressure( 129 pointerEventInit.setPressure(getPointerEventPressure(
130 mouseEvent.pointerProperties().force, pointerEventInit.buttons())); 130 mouseEvent.pointerProperties().force, pointerEventInit.buttons()));
131 131
132 // Set width/height to 1 because it matches Edge (and supported by the spec) .
133 pointerEventInit.setWidth(1);
134 pointerEventInit.setHeight(1);
135
136 UIEventWithKeyState::setFromPlatformModifiers(pointerEventInit, mouseEvent.g etModifiers()); 132 UIEventWithKeyState::setFromPlatformModifiers(pointerEventInit, mouseEvent.g etModifiers());
137 133
138 // Make sure chorded buttons fire pointermove instead of pointerup/down. 134 // Make sure chorded buttons fire pointermove instead of pointerup/down.
139 if ((pointerEventName == EventTypeNames::pointerdown 135 if ((pointerEventName == EventTypeNames::pointerdown
140 && (buttons & ~MouseEvent::buttonToButtons(mouseEvent.button())) != 0) 136 && (buttons & ~MouseEvent::buttonToButtons(mouseEvent.button())) != 0)
141 || (pointerEventName == EventTypeNames::pointerup && buttons != 0)) 137 || (pointerEventName == EventTypeNames::pointerup && buttons != 0))
142 pointerEventName = EventTypeNames::pointermove; 138 pointerEventName = EventTypeNames::pointermove;
143 139
144 140
145 pointerEventInit.setView(view); 141 pointerEventInit.setView(view);
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 if (properties.pointerType 371 if (properties.pointerType
376 == WebPointerProperties::PointerType::Mouse) 372 == WebPointerProperties::PointerType::Mouse)
377 return PointerEventFactory::s_mouseId; 373 return PointerEventFactory::s_mouseId;
378 IncomingId id(properties.pointerType, properties.id); 374 IncomingId id(properties.pointerType, properties.id);
379 if (m_pointerIncomingIdMapping.contains(id)) 375 if (m_pointerIncomingIdMapping.contains(id))
380 return m_pointerIncomingIdMapping.get(id); 376 return m_pointerIncomingIdMapping.get(id);
381 return PointerEventFactory::s_invalidId; 377 return PointerEventFactory::s_invalidId;
382 } 378 }
383 379
384 } // namespace blink 380 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698