WebKit Bugzilla
Attachment 371283 Details for
Bug 198468
: [Pointer Events] Expose navigator.maxTouchPoints
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198468-20190604173005.patch (text/plain), 14.39 KB, created by
Antoine Quint
on 2019-06-04 08:30:06 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Antoine Quint
Created:
2019-06-04 08:30:06 PDT
Size:
14.39 KB
patch
obsolete
>Subversion Revision: 246056 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index bf197880ab046e4b5ac6ea5da72bd00f0569cbe9..e86a6cc0e54a995ae4b65c20168c369977072dd8 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,30 @@ >+2019-06-02 Antoine Quint <graouts@apple.com> >+ >+ [Pointer Events] Expose navigator.maxTouchPoints >+ https://bugs.webkit.org/show_bug.cgi?id=198468 >+ <rdar://problem/51273029> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Expose the navigator.maxTouchPoints property when Pointer Events are enabled both at compile-time and run-time. >+ We return a canned value for this on iOS touch-enabled devices that matches the number of simultaneous touches >+ supported by the system, which is 5. In fact, iPad support more simultaneous touches, but it doesn't seem worthy >+ to expose this level of granularity due to fingerprinting practices. In practice, what really matters is returning >+ 0, 1 or more than 1 for this value to identify multi-touch support. >+ >+ Test: js/dom/navigator-maxtouchpoints.html >+ >+ * CMakeLists.txt: >+ * DerivedSources-input.xcfilelist: >+ * DerivedSources-output.xcfilelist: >+ * DerivedSources.make: >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * dom/NavigatorMaxTouchPoints.idl: Added. >+ * page/Navigator.idl: >+ * page/NavigatorBase.h: >+ (WebCore::NavigatorBase::maxTouchPoints const): >+ > 2019-06-03 Andy Estes <aestes@apple.com> > > [Apple Pay] Disable script injection when canMakePayment APIs are called and return true >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 071ad2027ecd88a7bbc802489176c9cfd2a90466..7c57e5bad1e19f5cfe5b5d094b6a06c0c981f272 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -710,6 +710,7 @@ set(WebCore_NON_SVG_IDL_FILES > dom/MutationObserver.idl > dom/MutationRecord.idl > dom/NamedNodeMap.idl >+ dom/NavigatorMaxTouchPoints.idl > dom/Node.idl > dom/NodeFilter.idl > dom/NodeIterator.idl >diff --git a/Source/WebCore/DerivedSources-input.xcfilelist b/Source/WebCore/DerivedSources-input.xcfilelist >index 21b5ee7faf97d727dcb2d871d7c9c94f572434a6..57c537c3ec9d428227e8de5e88163569b7607bce 100644 >--- a/Source/WebCore/DerivedSources-input.xcfilelist >+++ b/Source/WebCore/DerivedSources-input.xcfilelist >@@ -593,6 +593,7 @@ $(PROJECT_DIR)/dom/MutationEvent.idl > $(PROJECT_DIR)/dom/MutationObserver.idl > $(PROJECT_DIR)/dom/MutationRecord.idl > $(PROJECT_DIR)/dom/NamedNodeMap.idl >+$(PROJECT_DIR)/dom/NavigatorMaxTouchPoints.idl > $(PROJECT_DIR)/dom/Node.idl > $(PROJECT_DIR)/dom/NodeFilter.idl > $(PROJECT_DIR)/dom/NodeIterator.idl >diff --git a/Source/WebCore/DerivedSources-output.xcfilelist b/Source/WebCore/DerivedSources-output.xcfilelist >index 04acd207615d4abbacb3b04d05760e6896f931c3..d0e0a8f27f83e68946f8eb043163c6609c7d7422 100644 >--- a/Source/WebCore/DerivedSources-output.xcfilelist >+++ b/Source/WebCore/DerivedSources-output.xcfilelist >@@ -1051,6 +1051,8 @@ $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigatorID.cpp > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigatorID.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigatorLanguage.cpp > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigatorLanguage.h >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigatorMaxTouchPoints.cpp >+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigatorMaxTouchPoints.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigatorMediaCapabilities.cpp > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigatorMediaCapabilities.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSNavigatorMediaDevices.cpp >diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make >index 57ae1144b78d0c8800f6d7dcafe8c24127a882d4..d88aed458f0ef6eae31478e1e8b8071fceed91df 100644 >--- a/Source/WebCore/DerivedSources.make >+++ b/Source/WebCore/DerivedSources.make >@@ -609,6 +609,7 @@ JS_BINDING_IDLS = \ > $(WebCore)/dom/MutationObserver.idl \ > $(WebCore)/dom/MutationRecord.idl \ > $(WebCore)/dom/NamedNodeMap.idl \ >+ $(WebCore)/dom/NavigatorMaxTouchPoints.idl \ > $(WebCore)/dom/Node.idl \ > $(WebCore)/dom/NodeFilter.idl \ > $(WebCore)/dom/NodeIterator.idl \ >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index 27ed8b8ccb974bab4f25945bd6403e31ecc47d50..5e3063bbe46db8c23eaa156ff4eb66781f226b45 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -2934,6 +2934,7 @@ JSNavigatorGeolocation.cpp > JSNavigatorGPU.cpp > JSNavigatorID.cpp > JSNavigatorLanguage.cpp >+JSNavigatorMaxTouchPoints.cpp > JSNavigatorMediaCapabilities.cpp > JSNavigatorMediaDevices.cpp > JSNavigatorOnLine.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 8334a9fd89b3a27134d5bab1b35a39ea82281605..442b579544bf600e12927f4a41231ef2d13dde5f 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -9393,6 +9393,7 @@ > 71EFCEDA202B388F00D7C411 /* AnimationEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnimationEffect.cpp; sourceTree = "<group>"; }; > 71EFCEDE202B39C700D7C411 /* JSAnimationEffectCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAnimationEffectCustom.cpp; sourceTree = "<group>"; }; > 71F936F71DD4F99B00922CC7 /* tracks-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "tracks-support.js"; sourceTree = "<group>"; }; >+ 71FF851822A3F81F005D5959 /* NavigatorMaxTouchPoints.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorMaxTouchPoints.idl; sourceTree = "<group>"; }; > 721443452240C8BA00F12FF7 /* SVGAnimatedValueProperty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedValueProperty.h; sourceTree = "<group>"; }; > 721443462240CAD200F12FF7 /* SVGValueProperty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGValueProperty.h; sourceTree = "<group>"; }; > 724ED3291A3A7E5400F5F13C /* EXTBlendMinMax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EXTBlendMinMax.cpp; sourceTree = "<group>"; }; >@@ -27486,6 +27487,7 @@ > A81872130977D3C0005826D9 /* NameNodeList.h */, > 8306EFF01B8BCE7C0031D032 /* NativeNodeFilter.cpp */, > 83E959E11B8BC22B004D9385 /* NativeNodeFilter.h */, >+ 71FF851822A3F81F005D5959 /* NavigatorMaxTouchPoints.idl */, > A8C4A7EE09D563270003AC8D /* Node.cpp */, > 14115B5109F84B7100CA4FC1 /* Node.h */, > 14DC0D0B09FECFA4007B0235 /* Node.idl */, >diff --git a/Source/WebCore/dom/NavigatorMaxTouchPoints.idl b/Source/WebCore/dom/NavigatorMaxTouchPoints.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..e1b351784511aa42d2737989960588037b7a4dee >--- /dev/null >+++ b/Source/WebCore/dom/NavigatorMaxTouchPoints.idl >@@ -0,0 +1,35 @@ >+/* >+* Copyright (C) 2019 Apple Inc. All rights reserved. >+* >+* Redistribution and use in source and binary forms, with or without >+* modification, are permitted provided that the following conditions >+* are met: >+* >+* 1. Redistributions of source code must retain the above copyright >+* notice, this list of conditions and the following disclaimer. >+* 2. Redistributions in binary form must reproduce the above copyright >+* notice, this list of conditions and the following disclaimer in the >+* documentation and/or other materials provided with the distribution. >+* 3. Neither the name of Apple Inc. ("Apple") nor the names of >+* its contributors may be used to endorse or promote products derived >+* from this software without specific prior written permission. >+* >+* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY >+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND >+* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF >+* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+*/ >+ >+[ >+ NoInterfaceObject, >+ Conditional=POINTER_EVENTS, >+ EnabledAtRuntime=PointerEvents >+] interface MaxTouchPoints { >+ readonly attribute long maxTouchPoints; >+}; >diff --git a/Source/WebCore/page/Navigator.idl b/Source/WebCore/page/Navigator.idl >index 69d55c89bf0129fd5fd34885ae1415f791506844..45befb81ed89832d10ba719451de648f4cd90237 100644 >--- a/Source/WebCore/page/Navigator.idl >+++ b/Source/WebCore/page/Navigator.idl >@@ -33,6 +33,7 @@ > > Navigator implements NavigatorID; > Navigator implements NavigatorLanguage; >+Navigator implements NavigatorMaxTouchPoints; > Navigator implements NavigatorOnLine; > Navigator implements NavigatorServiceWorker; > Navigator implements NavigatorShare; >diff --git a/Source/WebCore/page/NavigatorBase.h b/Source/WebCore/page/NavigatorBase.h >index d3f3fdabe9c2ea17c3230634f3da8bf3fe704d25..3126ef73f2377b52a531b2d32c85ee2c859a670e 100644 >--- a/Source/WebCore/page/NavigatorBase.h >+++ b/Source/WebCore/page/NavigatorBase.h >@@ -69,6 +69,15 @@ public: > private: > std::unique_ptr<ServiceWorkerContainer> m_serviceWorkerContainer; > #endif >+ >+#if ENABLE(POINTER_EVENTS) >+public: >+#if ENABLE(IOS_TOUCH_EVENTS) && !PLATFORM(IOSMAC) >+ int maxTouchPoints() const { return 5; } >+#else >+ int maxTouchPoints() const { return 0; } >+#endif >+#endif > }; > > } // namespace WebCore >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index b3b473946565159a045a969e4bb4cca7a1022ec7..d1342a84af448fc8ccedac42397de76de281bd80 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2019-06-02 Antoine Quint <graouts@apple.com> >+ >+ [Pointer Events] Expose navigator.maxTouchPoints >+ https://bugs.webkit.org/show_bug.cgi?id=198468 >+ <rdar://problem/51273029> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * js/dom/navigator-maxtouchpoints-expected.txt: Added. >+ * js/dom/navigator-maxtouchpoints.html: Added. >+ * platform/mac-wk1/fast/dom/navigator-detached-no-crash-expected.txt: >+ * platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt: >+ * platform/win/js/dom/navigator-maxtouchpoints-expected.txt: Added. >+ > 2019-06-03 Youenn Fablet <youenn@apple.com> > > Allow resizing of camera video feeds to very small resolutions >diff --git a/LayoutTests/js/dom/navigator-maxtouchpoints-expected.txt b/LayoutTests/js/dom/navigator-maxtouchpoints-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..5c63c5b4c1436471e47518313d86006a6f9be779 >--- /dev/null >+++ b/LayoutTests/js/dom/navigator-maxtouchpoints-expected.txt >@@ -0,0 +1,9 @@ >+Check return value of navigator.maxTouchPoints. >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+navigator.maxTouchPoints = 0 >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/js/dom/navigator-maxtouchpoints.html b/LayoutTests/js/dom/navigator-maxtouchpoints.html >new file mode 100644 >index 0000000000000000000000000000000000000000..fe4c8684f3e0c8d4597246d1757de682aaa4beaa >--- /dev/null >+++ b/LayoutTests/js/dom/navigator-maxtouchpoints.html >@@ -0,0 +1,19 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../resources/js-test-pre.js"></script> >+</head> >+<body> >+<script> >+description( >+ "<pre>Check return value of navigator.maxTouchPoints." >+); >+ >+if (window.testRunner) >+ testRunner.dumpAsText(); >+ >+debug(`navigator.maxTouchPoints = ${navigator.maxTouchPoints}`); >+</script> >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html> >diff --git a/LayoutTests/platform/mac-wk1/fast/dom/navigator-detached-no-crash-expected.txt b/LayoutTests/platform/mac-wk1/fast/dom/navigator-detached-no-crash-expected.txt >index aecf6ac2fa6f72909afc75ec4af24d7bfb3aff36..20b94a602f9cdfce1f1d784e66f9881c580179d4 100644 >--- a/LayoutTests/platform/mac-wk1/fast/dom/navigator-detached-no-crash-expected.txt >+++ b/LayoutTests/platform/mac-wk1/fast/dom/navigator-detached-no-crash-expected.txt >@@ -9,6 +9,7 @@ navigator.getStorageUpdates() is OK > navigator.javaEnabled() is OK > navigator.language is OK > navigator.languages is OK >+navigator.maxTouchPoints is OK > navigator.mediaCapabilities is OK > navigator.mimeTypes is OK > navigator.onLine is OK >@@ -29,6 +30,7 @@ navigator.getStorageUpdates() is OK > navigator.javaEnabled() is OK > navigator.language is OK > navigator.languages is OK >+navigator.maxTouchPoints is OK > navigator.mediaCapabilities is OK > navigator.mimeTypes is OK > navigator.onLine is OK >diff --git a/LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt b/LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt >index 924b3294dc3bcf3f291f85a83adf245331f15c59..3cf0db2bd818c7ed0790297d521a5b53540fd9f8 100644 >--- a/LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt >+++ b/LayoutTests/platform/mac-wk2/fast/dom/navigator-detached-no-crash-expected.txt >@@ -12,6 +12,7 @@ navigator.gpu is OK > navigator.javaEnabled() is OK > navigator.language is OK > navigator.languages is OK >+navigator.maxTouchPoints is OK > navigator.mediaCapabilities is OK > navigator.mimeTypes is OK > navigator.onLine is OK >@@ -37,6 +38,7 @@ navigator.gpu is OK > navigator.javaEnabled() is OK > navigator.language is OK > navigator.languages is OK >+navigator.maxTouchPoints is OK > navigator.mediaCapabilities is OK > navigator.mimeTypes is OK > navigator.onLine is OK >diff --git a/LayoutTests/platform/win/js/dom/navigator-maxtouchpoints-expected.txt b/LayoutTests/platform/win/js/dom/navigator-maxtouchpoints-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..ae96346921b427c8f2bf817c2fbb6caf0e75fb50 >--- /dev/null >+++ b/LayoutTests/platform/win/js/dom/navigator-maxtouchpoints-expected.txt >@@ -0,0 +1,9 @@ >+Check return value of navigator.maxTouchPoints. >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+navigator.maxTouchPoints = undefined >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+
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 198468
:
371146
|
371150
|
371151
|
371152
|
371153
|
371154
|
371283
|
371287
|
371292
|
371294