WebKit Bugzilla
Attachment 361077 Details for
Bug 194232
: Use constants for pointer types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194232-20190204203421.patch (text/plain), 3.20 KB, created by
Antoine Quint
on 2019-02-04 11:34:22 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Antoine Quint
Created:
2019-02-04 11:34:22 PST
Size:
3.20 KB
patch
obsolete
>Subversion Revision: 240929 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index cfb0ee9443fc4f0c2569637ec0ca8a029dcf3321..069e8832cad8d6ba1dd8dac723bf50ba924ead8c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,16 @@ >+2019-02-04 Antoine Quint <graouts@apple.com> >+ >+ Use constants for pointer types >+ https://bugs.webkit.org/show_bug.cgi?id=194232 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ We cannot use an enum for the pointer type since a custom pointer type can be created by developers when creating a >+ pointer event using JavaScript, but we can at least used string constants for the ones created internally. >+ >+ * dom/PointerEvent.h: >+ * dom/ios/PointerEventIOS.cpp: >+ > 2019-02-04 Antoine Quint <graouts@apple.com> > > Use a dedicated type instead of int32_t for pointer identifiers >diff --git a/Source/WebCore/dom/PointerEvent.h b/Source/WebCore/dom/PointerEvent.h >index 64fac5f44bdf1b02020c291abd8d01ca574da31c..86ef349e4c66ad9d4e883200f96db7dbaa75c282 100644 >--- a/Source/WebCore/dom/PointerEvent.h >+++ b/Source/WebCore/dom/PointerEvent.h >@@ -48,7 +48,7 @@ public: > long tiltX { 0 }; > long tiltY { 0 }; > long twist { 0 }; >- String pointerType { "mouse"_s }; >+ String pointerType { PointerEvent::mousePointerType() }; > bool isPrimary { false }; > }; > >@@ -85,6 +85,10 @@ public: > static Ref<PointerEvent> create(const PlatformTouchEvent&, unsigned touchIndex, bool isPrimary, Ref<WindowProxy>&&); > #endif > >+ static const String& mousePointerType() { static NeverDestroyed<const String> mouse(MAKE_STATIC_STRING_IMPL("mouse")); return mouse; } >+ static const String& penPointerType() { static NeverDestroyed<const String> pen(MAKE_STATIC_STRING_IMPL("pen")); return pen; } >+ static const String& touchPointerType() { static NeverDestroyed<const String> touch(MAKE_STATIC_STRING_IMPL("touch")); return touch; } >+ > virtual ~PointerEvent(); > > PointerID pointerId() const { return m_pointerId; } >@@ -117,7 +121,7 @@ private: > long m_tiltX { 0 }; > long m_tiltY { 0 }; > long m_twist { 0 }; >- String m_pointerType { "mouse"_s }; >+ String m_pointerType { PointerEvent::mousePointerType() }; > bool m_isPrimary { false }; > }; > >diff --git a/Source/WebCore/dom/ios/PointerEventIOS.cpp b/Source/WebCore/dom/ios/PointerEventIOS.cpp >index 805ad348c5da94b4ae28e783212e21a057c01915..4502400f8ad496e876c14b4fd2a98afe0bfea008 100644 >--- a/Source/WebCore/dom/ios/PointerEventIOS.cpp >+++ b/Source/WebCore/dom/ios/PointerEventIOS.cpp >@@ -69,7 +69,7 @@ PointerEvent::PointerEvent(const AtomicString& type, const PlatformTouchEvent& e > , m_width(2 * event.radiusXAtIndex(index)) > , m_height(2 * event.radiusYAtIndex(index)) > , m_pressure(event.forceAtIndex(index)) >- , m_pointerType(event.touchTypeAtIndex(index) == PlatformTouchPoint::TouchType::Stylus ? "pen"_s : "touch"_s) >+ , m_pointerType(event.touchTypeAtIndex(index) == PlatformTouchPoint::TouchType::Stylus ? PointerEvent::penPointerType() : PointerEvent::touchPointerType()) > , m_isPrimary(isPrimary) > { > // See https://github.com/w3c/pointerevents/issues/274. We might expose the azimuth and altitude
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194232
:
361077
|
361099
|
361100