Diff
Modified: trunk/LayoutTests/ChangeLog (240874 => 240875)
--- trunk/LayoutTests/ChangeLog 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/LayoutTests/ChangeLog 2019-02-01 21:53:40 UTC (rev 240875)
@@ -1,3 +1,27 @@
+2019-02-01 Antoine Quint <[email protected]>
+
+ Dispatch pointercancel events when content is panned or zoomed on iOS
+ https://bugs.webkit.org/show_bug.cgi?id=193962
+ <rdar://problem/47629134>
+
+ Reviewed by Dean Jackson.
+
+ Adding a few tests for "pointercancel" and adding "touch-action: none" on tests that would now be affected by canceling pointers. We also unflake a few tests.
+
+ * pointerevents/ios/pointer-events-implicit-capture.html:
+ * pointerevents/ios/pointer-events-is-primary.html:
+ * pointerevents/ios/touch-action-pan-x-pan-y.html:
+ * pointerevents/ios/touch-action-pan-x.html:
+ * pointerevents/ios/touch-action-pan-y-expected.txt:
+ * pointerevents/ios/touch-action-pan-y.html:
+ * pointerevents/ios/touch-action-pinch-zoom-allows-zooming.html:
+ * pointerevents/ios/touch-action-pointercancel-pan-x-expected.txt: Added.
+ * pointerevents/ios/touch-action-pointercancel-pan-x.html: Added.
+ * pointerevents/ios/touch-action-pointercancel-pan-y-expected.txt: Added.
+ * pointerevents/ios/touch-action-pointercancel-pan-y.html: Added.
+ * pointerevents/ios/touch-action-pointercancel-pinch-zoom-expected.txt: Added.
+ * pointerevents/ios/touch-action-pointercancel-pinch-zoom.html: Added.
+
2019-02-01 Carlos Garcia Campos <[email protected]>
REGRESSION(r239915): css3/font-feature-font-face-local.html failing on WPE
Modified: trunk/LayoutTests/pointerevents/ios/pointer-events-implicit-capture.html (240874 => 240875)
--- trunk/LayoutTests/pointerevents/ios/pointer-events-implicit-capture.html 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/LayoutTests/pointerevents/ios/pointer-events-implicit-capture.html 2019-02-01 21:53:40 UTC (rev 240875)
@@ -13,6 +13,7 @@
'use strict';
target_test((target, test) => {
+ target.style.touchAction = "none";
const eventTracker = new EventTracker(target, ["pointerdown", "gotpointercapture", "pointermove", "pointerup", "lostpointercapture"]);
const _one_ = ui.finger();
Modified: trunk/LayoutTests/pointerevents/ios/pointer-events-is-primary.html (240874 => 240875)
--- trunk/LayoutTests/pointerevents/ios/pointer-events-is-primary.html 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/LayoutTests/pointerevents/ios/pointer-events-is-primary.html 2019-02-01 21:53:40 UTC (rev 240875)
@@ -13,6 +13,7 @@
'use strict';
target_test((target, test) => {
+ target.style.touchAction = "none";
const eventTracker = new EventTracker(target, ["pointerdown", "pointermove"]);
const _one_ = ui.finger();
Modified: trunk/LayoutTests/pointerevents/ios/touch-action-pan-x-pan-y.html (240874 => 240875)
--- trunk/LayoutTests/pointerevents/ios/touch-action-pan-x-pan-y.html 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/LayoutTests/pointerevents/ios/touch-action-pan-x-pan-y.html 2019-02-01 21:53:40 UTC (rev 240875)
@@ -19,10 +19,13 @@
target.style.touchAction = "pan-x pan-y";
ui.swipe({ x: 150, y: 150 }, { x: 50, y: 50 }).then(() => {
- assert_not_equals(window.pageXOffset, 0, "The page was scrolled in the x-axis.");
- assert_not_equals(window.pageYOffset, 0, "The page was scrolled in the y-axis.");
- test.done();
+ requestAnimationFrame(() => {
+ assert_not_equals(window.pageXOffset, 0, "The page was scrolled in the x-axis.");
+ assert_not_equals(window.pageYOffset, 0, "The page was scrolled in the y-axis.");
+ test.done();
+ });
});
+
}, "Testing that setting 'touch-action: pan-x pan-y' on an element allows page scrolling in both axes.");
</script>
Modified: trunk/LayoutTests/pointerevents/ios/touch-action-pan-x.html (240874 => 240875)
--- trunk/LayoutTests/pointerevents/ios/touch-action-pan-x.html 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/LayoutTests/pointerevents/ios/touch-action-pan-x.html 2019-02-01 21:53:40 UTC (rev 240875)
@@ -19,9 +19,11 @@
target.style.touchAction = "pan-x";
ui.swipe({ x: 150, y: 150 }, { x: 50, y: 50 }).then(() => {
- assert_not_equals(window.pageXOffset, 0, "The page was scrolled in the x-axis.");
- assert_equals(window.pageYOffset, 0, "The page was not scrolled in the y-axis.");
- test.done();
+ requestAnimationFrame(() => {
+ assert_not_equals(window.pageXOffset, 0, "The page was scrolled in the x-axis.");
+ assert_equals(window.pageYOffset, 0, "The page was not scrolled in the y-axis.");
+ test.done();
+ });
});
}, "Testing that setting touch-action: pan-x on an element prevents page scrolling in the y-axis.");
Modified: trunk/LayoutTests/pointerevents/ios/touch-action-pan-y-expected.txt (240874 => 240875)
--- trunk/LayoutTests/pointerevents/ios/touch-action-pan-y-expected.txt 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/LayoutTests/pointerevents/ios/touch-action-pan-y-expected.txt 2019-02-01 21:53:40 UTC (rev 240875)
@@ -1,3 +1,3 @@
-PASS Testing that setting touch-action: pan-x on an element prevents page scrolling in the x-axis.
+PASS Testing that setting touch-action: pan-y on an element prevents page scrolling in the x-axis.
Modified: trunk/LayoutTests/pointerevents/ios/touch-action-pan-y.html (240874 => 240875)
--- trunk/LayoutTests/pointerevents/ios/touch-action-pan-y.html 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/LayoutTests/pointerevents/ios/touch-action-pan-y.html 2019-02-01 21:53:40 UTC (rev 240875)
@@ -19,11 +19,13 @@
target.style.touchAction = "pan-y";
ui.swipe({ x: 150, y: 150 }, { x: 50, y: 50 }).then(() => {
- assert_equals(window.pageXOffset, 0, "The page was not scrolled in the x-axis.");
- assert_not_equals(window.pageYOffset, 0, "The page was scrolled in the y-axis.");
- test.done();
+ requestAnimationFrame(() => {
+ assert_equals(window.pageXOffset, 0, "The page was not scrolled in the x-axis.");
+ assert_not_equals(window.pageYOffset, 0, "The page was scrolled in the y-axis.");
+ test.done();
+ });
});
-}, "Testing that setting touch-action: pan-x on an element prevents page scrolling in the x-axis.");
+}, "Testing that setting touch-action: pan-y on an element prevents page scrolling in the x-axis.");
</script>
</body>
Modified: trunk/LayoutTests/pointerevents/ios/touch-action-pinch-zoom-allows-zooming.html (240874 => 240875)
--- trunk/LayoutTests/pointerevents/ios/touch-action-pinch-zoom-allows-zooming.html 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/LayoutTests/pointerevents/ios/touch-action-pinch-zoom-allows-zooming.html 2019-02-01 21:53:40 UTC (rev 240875)
@@ -19,8 +19,10 @@
target.style.touchAction = "pinch-zoom";
ui.pinchOut({ x: 50, y: 50, width: 100, height: 100, scale: 0.5 }).then(() => {
- assert_not_equals(window.internals.pageScaleFactor(), 1, "The page was scaled.");
- test.done();
+ requestAnimationFrame(() => {
+ assert_not_equals(window.internals.pageScaleFactor(), 1, "The page was scaled.");
+ test.done();
+ });
});
}, "Testing that setting touch-action: pinch-zoom on an element allows page zooming.");
Added: trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pan-x-expected.txt (0 => 240875)
--- trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pan-x-expected.txt (rev 0)
+++ trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pan-x-expected.txt 2019-02-01 21:53:40 UTC (rev 240875)
@@ -0,0 +1,3 @@
+
+PASS Testing that panning in the x-axis on an element with touch-action: pan-x triggers a pointercancel event.
+
Added: trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pan-x.html (0 => 240875)
--- trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pan-x.html (rev 0)
+++ trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pan-x.html 2019-02-01 21:53:40 UTC (rev 240875)
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script>
+
+'use strict';
+
+target_test({ width: "200px", height: "200px" }, (target, test) => {
+ document.body.style.width = "2000px";
+ document.body.style.height = "2000px";
+
+ target.style.touchAction = "pan-x";
+
+ const eventTracker = new EventTracker(target, ["pointerdown", "pointermove", "pointerup", "pointercancel"]);
+
+ const _one_ = ui.finger();
+ ui.sequence([
+ one.begin({ x: 150, y: 150 }),
+ one.move({ x: 149, y: 150 }),
+ one.move({ x: 148, y: 150 }),
+ one.move({ x: 120, y: 150 }),
+ one.move({ x: 100, y: 150 }),
+ one.end()
+ ]).then(() => {
+ eventTracker.assertMatchesEvents([
+ { type: "pointerdown" },
+ { type: "pointermove" },
+ { type: "pointermove" },
+ { type: "pointermove" },
+ { type: "pointercancel" }
+ ]);
+ test.done();
+ });
+}, "Testing that panning in the x-axis on an element with touch-action: pan-x triggers a pointercancel event.");
+
+</script>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pan-y-expected.txt (0 => 240875)
--- trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pan-y-expected.txt (rev 0)
+++ trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pan-y-expected.txt 2019-02-01 21:53:40 UTC (rev 240875)
@@ -0,0 +1,3 @@
+
+PASS Testing that panning in the y-axis on an element with touch-action: pan-y triggers a pointercancel event.
+
Added: trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pan-y.html (0 => 240875)
--- trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pan-y.html (rev 0)
+++ trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pan-y.html 2019-02-01 21:53:40 UTC (rev 240875)
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script>
+
+'use strict';
+
+target_test({ width: "200px", height: "200px" }, (target, test) => {
+ document.body.style.width = "2000px";
+ document.body.style.height = "2000px";
+
+ target.style.touchAction = "pan-y";
+
+ const eventTracker = new EventTracker(target, ["pointerdown", "pointermove", "pointerup", "pointercancel"]);
+
+ const _one_ = ui.finger();
+ ui.sequence([
+ one.begin({ x: 150, y: 150 }),
+ one.move({ x: 150, y: 149 }),
+ one.move({ x: 150, y: 148 }),
+ one.move({ x: 150, y: 120 }),
+ one.move({ x: 150, y: 100 }),
+ one.end()
+ ]).then(() => {
+ eventTracker.assertMatchesEvents([
+ { type: "pointerdown" },
+ { type: "pointermove" },
+ { type: "pointermove" },
+ { type: "pointermove" },
+ { type: "pointercancel" }
+ ]);
+ test.done();
+ });
+}, "Testing that panning in the y-axis on an element with touch-action: pan-y triggers a pointercancel event.");
+
+</script>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pinch-zoom-expected.txt (0 => 240875)
--- trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pinch-zoom-expected.txt (rev 0)
+++ trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pinch-zoom-expected.txt 2019-02-01 21:53:40 UTC (rev 240875)
@@ -0,0 +1,3 @@
+
+PASS Testing that pinching on an element with touch-action: pinch-zoom triggers a pointercancel event for each touch.
+
Copied: trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pinch-zoom.html (from rev 240874, trunk/LayoutTests/pointerevents/ios/touch-action-pinch-zoom-allows-zooming.html) (0 => 240875)
--- trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pinch-zoom.html (rev 0)
+++ trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pinch-zoom.html 2019-02-01 21:53:40 UTC (rev 240875)
@@ -0,0 +1,36 @@
+<!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+<html>
+<head>
+<meta charset=utf-8>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script>
+
+'use strict';
+
+target_test({ width: "400px", height: "400px" }, (target, test) => {
+ document.body.style.width = "2000px";
+ document.body.style.height = "2000px";
+
+ target.style.touchAction = "pinch-zoom";
+
+ const eventTracker = new EventTracker(target, ["pointerdown", "pointercancel"]);
+
+ ui.pinchOut({ x: 50, y: 50, width: 100, height: 100, scale: 0.5 }).then(() => {
+ eventTracker.assertMatchesEvents([
+ { type: "pointerdown" },
+ { type: "pointerdown" },
+ { type: "pointercancel" },
+ { type: "pointercancel" }
+ ]);
+ test.done();
+ });
+}, "Testing that pinching on an element with touch-action: pinch-zoom triggers a pointercancel event for each touch.");
+
+</script>
+</body>
+</html>
\ No newline at end of file
Modified: trunk/Source/WebCore/ChangeLog (240874 => 240875)
--- trunk/Source/WebCore/ChangeLog 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebCore/ChangeLog 2019-02-01 21:53:40 UTC (rev 240875)
@@ -1,3 +1,42 @@
+2019-02-01 Antoine Quint <[email protected]>
+
+ Dispatch pointercancel events when content is panned or zoomed on iOS
+ https://bugs.webkit.org/show_bug.cgi?id=193962
+ <rdar://problem/47629134>
+
+ Reviewed by Dean Jackson.
+
+ Expose two new methods on PointerCaptureController so that, given a pointer id, it can be established whether this pointer
+ has been cancelled, which is important because a cancelled pointer should no longer dispatch any further pointer events, and
+ to cancel a pointer.
+
+ Tests: pointerevents/ios/touch-action-pointercancel-pan-x.html
+ pointerevents/ios/touch-action-pointercancel-pan-y.html
+ pointerevents/ios/touch-action-pointercancel-pinch-zoom.html
+
+ * WebCore.xcodeproj/project.pbxproj: Make PointerCaptureController.h Private so that it can be imported from WebKit.
+ * dom/PointerEvent.h: Remove an unnecessary #if ENABLE(POINTER_EVENTS) since the entire file is already contained in one.
+ Then we add a new create() method that takes an event type, a pointer id and a pointer type (touch vs. pen) that we use
+ to create pointercancel events in PointerCaptureController::cancelPointer().
+ * page/Page.cpp:
+ (WebCore::Page::Page): Pass the Page as a parameter when creating the PointerCaptureController.
+ * page/PointerCaptureController.cpp:
+ (WebCore::PointerCaptureController::PointerCaptureController): Add a Page reference to the constructor since we'll need
+ the page to access its main frame's EventHandler to perform hit testing in case we do not have a capture target override
+ in cancelPointer().
+ (WebCore::PointerCaptureController::releasePointerCapture): Drive-by, remove the the implicit parameter since on iOS we
+ don't need to differentiate. We'll bring this back for the macOS work.
+ (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier): New method we'll use when dispatching pointer
+ events to identify whether a pointer id has already been cancelled which will allow for _not_ dispatching any further
+ pointer events for this pointer id.
+ (WebCore::PointerCaptureController::pointerEventWillBeDispatched): Keep track of the pointer type so we can preserve it
+ when dispatching pointercancel events for a given pointer id.
+ (WebCore::PointerCaptureController::cancelPointer): Dispatch a pointercancel for the provided pointer id, using the capture
+ target override as the event's target, if there is one, and otherwise hit-testing at the provided location to figure out
+ what the target should be.
+ * page/PointerCaptureController.h: Switch the target overrides from Element* to RefPtr<Element> to ensure it may not be
+ deleted while we still need them. Existing code already ensures these get set to nullptr.
+
2019-02-01 Jer Noble <[email protected]>
Make the WebKit default for media source based on the WebCore default.
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (240874 => 240875)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-02-01 21:53:40 UTC (rev 240875)
@@ -2119,7 +2119,7 @@
71A1B6081DEE5AD70073BCFB /* modern-media-controls-localized-strings.js in Resources */ = {isa = PBXBuildFile; fileRef = 71A1B6061DEE5A820073BCFB /* modern-media-controls-localized-strings.js */; };
71A57DF2154BE25C0009D120 /* SVGPathUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */; };
71B28427203CEC4C0036AA5D /* JSCSSAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 71B28426203CEC0D0036AA5D /* JSCSSAnimation.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 71B5AB2621F1D9F400376E5C /* PointerCaptureController.h in Headers */ = {isa = PBXBuildFile; fileRef = 71B5AB2421F1D9E200376E5C /* PointerCaptureController.h */; };
+ 71B5AB2621F1D9F400376E5C /* PointerCaptureController.h in Headers */ = {isa = PBXBuildFile; fileRef = 71B5AB2421F1D9E200376E5C /* PointerCaptureController.h */; settings = {ATTRIBUTES = (Private, ); }; };
71B7EE0D21B5C6870031C1EF /* TouchAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 71AEE4EB21B5A49C00DDB036 /* TouchAction.h */; settings = {ATTRIBUTES = (Private, ); }; };
71C29E32203CE781008F36D2 /* CSSAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 71C29E30203CE76B008F36D2 /* CSSAnimation.h */; settings = {ATTRIBUTES = (Private, ); }; };
71C916081D1483A300ACA47D /* UserInterfaceLayoutDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 71C916071D1483A300ACA47D /* UserInterfaceLayoutDirection.h */; settings = {ATTRIBUTES = (Private, ); }; };
Modified: trunk/Source/WebCore/dom/PointerEvent.h (240874 => 240875)
--- trunk/Source/WebCore/dom/PointerEvent.h 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebCore/dom/PointerEvent.h 2019-02-01 21:53:40 UTC (rev 240875)
@@ -56,7 +56,15 @@
return adoptRef(*new PointerEvent(type, WTFMove(initializer)));
}
-#if ENABLE(POINTER_EVENTS)
+ static Ref<PointerEvent> create(const AtomicString& type, int32_t pointerId, String pointerType)
+ {
+ Init initializer;
+ initializer.bubbles = true;
+ initializer.pointerId = pointerId;
+ initializer.pointerType = pointerType;
+ return adoptRef(*new PointerEvent(type, WTFMove(initializer)));
+ }
+
static Ref<PointerEvent> createForPointerCapture(const AtomicString& type, const PointerEvent& pointerEvent)
{
Init initializer;
@@ -66,7 +74,6 @@
initializer.pointerType = pointerEvent.pointerType();
return adoptRef(*new PointerEvent(type, WTFMove(initializer)));
}
-#endif
static Ref<PointerEvent> createForBindings()
{
Modified: trunk/Source/WebCore/page/Page.cpp (240874 => 240875)
--- trunk/Source/WebCore/page/Page.cpp 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebCore/page/Page.cpp 2019-02-01 21:53:40 UTC (rev 240875)
@@ -216,7 +216,7 @@
, m_userInputBridge(std::make_unique<UserInputBridge>(*this))
, m_inspectorController(std::make_unique<InspectorController>(*this, pageConfiguration.inspectorClient))
#if ENABLE(POINTER_EVENTS)
- , m_pointerCaptureController(std::make_unique<PointerCaptureController>())
+ , m_pointerCaptureController(std::make_unique<PointerCaptureController>(*this))
#endif
#if ENABLE(POINTER_LOCK)
, m_pointerLockController(std::make_unique<PointerLockController>(*this))
Modified: trunk/Source/WebCore/page/PointerCaptureController.cpp (240874 => 240875)
--- trunk/Source/WebCore/page/PointerCaptureController.cpp 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebCore/page/PointerCaptureController.cpp 2019-02-01 21:53:40 UTC (rev 240875)
@@ -29,6 +29,7 @@
#include "Document.h"
#include "Element.h"
+#include "EventHandler.h"
#include "EventNames.h"
#include "EventTarget.h"
#include "Page.h"
@@ -36,7 +37,10 @@
namespace WebCore {
-PointerCaptureController::PointerCaptureController() = default;
+PointerCaptureController::PointerCaptureController(Page& page)
+ : m_page(page)
+{
+}
ExceptionOr<void> PointerCaptureController::setPointerCapture(Element* capturingTarget, int32_t pointerId)
{
@@ -68,7 +72,7 @@
return { };
}
-ExceptionOr<void> PointerCaptureController::releasePointerCapture(Element* capturingTarget, int32_t pointerId, ImplicitCapture implicit)
+ExceptionOr<void> PointerCaptureController::releasePointerCapture(Element* capturingTarget, int32_t pointerId)
{
// https://w3c.github.io/pointerevents/#releasing-pointer-capture
@@ -78,7 +82,7 @@
// 1. If the pointerId provided as the method's argument does not match any of the active pointers and these steps are not
// being invoked as a result of the implicit release of pointer capture, then throw a DOMException with the name NotFoundError.
auto iterator = m_activePointerIdsToCapturingData.find(pointerId);
- if (implicit == ImplicitCapture::No && iterator == m_activePointerIdsToCapturingData.end())
+ if (iterator == m_activePointerIdsToCapturingData.end())
return Exception { NotFoundError };
// 2. If hasPointerCapture is false for the Element with the specified pointerId, then terminate these steps.
@@ -124,6 +128,12 @@
m_activePointerIdsToCapturingData.remove(pointerId);
}
+bool PointerCaptureController::hasCancelledPointerEventForIdentifier(int32_t pointerId)
+{
+ auto iterator = m_activePointerIdsToCapturingData.find(pointerId);
+ return iterator != m_activePointerIdsToCapturingData.end() && iterator->value.cancelled;
+}
+
void PointerCaptureController::pointerEventWillBeDispatched(const PointerEvent& event, EventTarget* target)
{
// https://w3c.github.io/pointerevents/#implicit-pointer-capture
@@ -142,7 +152,9 @@
return;
auto pointerId = event.pointerId();
- m_activePointerIdsToCapturingData.set(pointerId, CapturingData { });
+ CapturingData capturingData;
+ capturingData.pointerType = event.pointerType();
+ m_activePointerIdsToCapturingData.set(pointerId, capturingData);
setPointerCapture(downcast<Element>(target), pointerId);
}
@@ -171,6 +183,48 @@
processPendingPointerCapture(event);
}
+void PointerCaptureController::cancelPointer(int32_t pointerId, const IntPoint& documentPoint)
+{
+ // https://w3c.github.io/pointerevents/#the-pointercancel-event
+
+ // A user agent MUST fire a pointer event named pointercancel in the following circumstances:
+ //
+ // The user agent has determined that a pointer is unlikely to continue to produce events (for example, because of a hardware event).
+ // After having fired the pointerdown event, if the pointer is subsequently used to manipulate the page viewport (e.g. panning or zooming).
+ // Immediately before drag operation starts [HTML], for the pointer that caused the drag operation.
+ // After firing the pointercancel event, a user agent MUST also fire a pointer event named pointerout followed by firing a pointer event named pointerleave.
+
+ // https://w3c.github.io/pointerevents/#implicit-release-of-pointer-capture
+
+ // Immediately after firing the pointerup or pointercancel events, a user agent MUST clear the pending pointer capture target
+ // override for the pointerId of the pointerup or pointercancel event that was just dispatched, and then run Process Pending
+ // Pointer Capture steps to fire lostpointercapture if necessary. After running Process Pending Pointer Capture steps, if the
+ // pointer supports hover, user agent MUST also send corresponding boundary events necessary to reflect the current position of
+ // the pointer with no capture.
+
+ auto iterator = m_activePointerIdsToCapturingData.find(pointerId);
+ if (iterator == m_activePointerIdsToCapturingData.end())
+ return;
+
+ auto& capturingData = iterator->value;
+ if (capturingData.cancelled)
+ return;
+
+ capturingData.pendingTargetOverride = nullptr;
+ capturingData.cancelled = true;
+
+ auto& target = capturingData.targetOverride;
+ if (!target)
+ target = m_page.mainFrame().eventHandler().hitTestResultAtPoint(documentPoint, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowUserAgentShadowContent | HitTestRequest::AllowChildFrameContent).innerNonSharedElement();
+
+ if (!target)
+ return;
+
+ auto event = PointerEvent::create(eventNames().pointercancelEvent, pointerId, capturingData.pointerType);
+ target->dispatchEvent(event);
+ processPendingPointerCapture(WTFMove(event));
+}
+
void PointerCaptureController::processPendingPointerCapture(const PointerEvent& event)
{
// https://w3c.github.io/pointerevents/#process-pending-pointer-capture
Modified: trunk/Source/WebCore/page/PointerCaptureController.h (240874 => 240875)
--- trunk/Source/WebCore/page/PointerCaptureController.h 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebCore/page/PointerCaptureController.h 2019-02-01 21:53:40 UTC (rev 240875)
@@ -38,27 +38,31 @@
WTF_MAKE_NONCOPYABLE(PointerCaptureController);
WTF_MAKE_FAST_ALLOCATED;
public:
- explicit PointerCaptureController();
+ explicit PointerCaptureController(Page&);
- enum class ImplicitCapture : uint8_t { Yes, No };
-
ExceptionOr<void> setPointerCapture(Element*, int32_t);
- ExceptionOr<void> releasePointerCapture(Element*, int32_t, ImplicitCapture implicit = ImplicitCapture::No);
+ ExceptionOr<void> releasePointerCapture(Element*, int32_t);
bool hasPointerCapture(Element*, int32_t);
void pointerLockWasApplied();
void touchEndedOrWasCancelledForIdentifier(int32_t);
+ bool hasCancelledPointerEventForIdentifier(int32_t);
void pointerEventWillBeDispatched(const PointerEvent&, EventTarget*);
void pointerEventWasDispatched(const PointerEvent&);
+ WEBCORE_EXPORT void cancelPointer(int32_t, const IntPoint&);
private:
struct CapturingData {
- Element* pendingTargetOverride;
- Element* targetOverride;
+ RefPtr<Element> pendingTargetOverride;
+ RefPtr<Element> targetOverride;
+ String pointerType;
+ bool cancelled { false };
};
void processPendingPointerCapture(const PointerEvent&);
+
+ Page& m_page;
HashMap<int32_t, CapturingData> m_activePointerIdsToCapturingData;
};
Modified: trunk/Source/WebKit/ChangeLog (240874 => 240875)
--- trunk/Source/WebKit/ChangeLog 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebKit/ChangeLog 2019-02-01 21:53:40 UTC (rev 240875)
@@ -1,3 +1,54 @@
+2019-02-01 Antoine Quint <[email protected]>
+
+ Dispatch pointercancel events when content is panned or zoomed on iOS
+ https://bugs.webkit.org/show_bug.cgi?id=193962
+ <rdar://problem/47629134>
+
+ Reviewed by Dean Jackson.
+
+ When a user-agent-provided interaction, such as panning or zooming on iOS, uses a set of touches, we should dispatch a pointercancel
+ event for the pointer ids of the touches involved. To facilitate this, we add a new method on WKContentView to cancel all the pointers
+ matching active touches for a provided UIGestureRecognizer through an async IPC call into the Web process using the new method
+ PointerCaptureController::cancelPointer().
+
+ * Platform/spi/ios/UIKitSPI.h: Add the necessary forward declaration for a necessary UIKit SPI allowing us to get the set of last-seen
+ UITouches by the identifier generated for the matching WebKit touch.
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView scrollViewWillBeginZooming:withView:]): Dispatch touchcancel events for all pointers involved in a pinch gesture on the
+ top-level UIScrollView.
+ (-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Dispatch
+ touchcancel events for all pointers involved in a pan gesture on the top-level UIScrollView. We can infer this by looking at whether the
+ adjusted content offset, after accounting for the permitted touch actions, is different from the original content offset.
+ * UIProcess/PageClient.h: Expose a new virtual cancelPointersForGestureRecognizer() method which will allow the iOS implementation to
+ forward the call to WKContentViewInteraction.
+ (WebKit::PageClient::cancelPointersForGestureRecognizer):
+ * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: Expose the WebPageProxy such that we may access it to cancel pointers for
+ a given gesture recognizer from within ScrollingTreeScrollingNodeDelegateIOS.
+ (WebKit::RemoteScrollingCoordinatorProxy::webPageProxy const):
+ * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
+ * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
+ (-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]):
+ Dispatch touchcancel events for all pointers involved in a pan gesture on a nested UIScrollView. We can infer this by looking at
+ whether the adjusted content offset, after accounting for the permitted touch actions, is different from the original content offset.
+ (-[WKScrollingNodeScrollViewDelegate scrollViewWillBeginZooming:withView:]): Dispatch touchcancel events for all pointers involved in a
+ pinch gesture on a nested UIScrollView.
+ (-[WKScrollingNodeScrollViewDelegate cancelPointersForGestureRecognizer:]):
+ (WebKit::ScrollingTreeScrollingNodeDelegateIOS::cancelPointersForGestureRecognizer):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::cancelPointer):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/ios/PageClientImplIOS.h:
+ * UIProcess/ios/PageClientImplIOS.mm:
+ (WebKit::PageClientImpl::cancelPointersForGestureRecognizer):
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView cancelPointersForGestureRecognizer:]): Obtain all active UITouch objects for the view and dispatch a pointercancel event,
+ through the WebPageProxy, for all touches associated with the provided gesture recognizer.
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::cancelPointer):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in:
+
2019-02-01 Jer Noble <[email protected]>
Make the WebKit default for media source based on the WebCore default.
Modified: trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h (240874 => 240875)
--- trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h 2019-02-01 21:53:40 UTC (rev 240875)
@@ -1031,6 +1031,11 @@
#endif // USE(APPLE_INTERNAL_SDK)
+// FIXME: <rdar://problem/47714562>
+@interface UIWebTouchEventsGestureRecognizer ()
+@property (nonatomic, readonly) NSMapTable<NSNumber *, UITouch *> *activeTouchesByIdentifier;
+@end
+
@interface UIPhysicalKeyboardEvent : UIPressesEvent
@end
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (240874 => 240875)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2019-02-01 21:53:40 UTC (rev 240875)
@@ -2551,6 +2551,10 @@
[_contentView scrollViewWillStartPanOrPinchGesture];
}
[_contentView willStartZoomOrScroll];
+
+#if ENABLE(POINTER_EVENTS)
+ [_contentView cancelPointersForGestureRecognizer:scrollView.pinchGestureRecognizer];
+#endif
}
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
@@ -2635,8 +2639,10 @@
#if ENABLE(POINTER_EVENTS)
- (CGPoint)_scrollView:(UIScrollView *)scrollView adjustedOffsetForOffset:(CGPoint)offset translation:(CGPoint)translation startPoint:(CGPoint)start locationInView:(CGPoint)locationInView horizontalVelocity:(inout double *)hv verticalVelocity:(inout double *)vv
{
- if (![_contentView preventsPanningInXAxis] && ![_contentView preventsPanningInYAxis])
+ if (![_contentView preventsPanningInXAxis] && ![_contentView preventsPanningInYAxis]) {
+ [_contentView cancelPointersForGestureRecognizer:scrollView.panGestureRecognizer];
return offset;
+ }
CGPoint adjustedContentOffset = CGPointMake(offset.x, offset.y);
if ([_contentView preventsPanningInXAxis])
@@ -2644,6 +2650,11 @@
if ([_contentView preventsPanningInYAxis])
adjustedContentOffset.y = start.y;
+ if ((![_contentView preventsPanningInXAxis] && adjustedContentOffset.x != start.x)
+ || (![_contentView preventsPanningInYAxis] && adjustedContentOffset.y != start.y)) {
+ [_contentView cancelPointersForGestureRecognizer:scrollView.panGestureRecognizer];
+ }
+
return adjustedContentOffset;
}
#endif
Modified: trunk/Source/WebKit/UIProcess/PageClient.h (240874 => 240875)
--- trunk/Source/WebKit/UIProcess/PageClient.h 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebKit/UIProcess/PageClient.h 2019-02-01 21:53:40 UTC (rev 240875)
@@ -52,6 +52,7 @@
OBJC_CLASS NSFileWrapper;
OBJC_CLASS NSMenu;
OBJC_CLASS NSSet;
+OBJC_CLASS UIGestureRecognizer;
OBJC_CLASS WKDrawingView;
OBJC_CLASS _WKRemoteObjectRegistry;
@@ -477,6 +478,11 @@
#if HAVE(PENCILKIT)
virtual RetainPtr<WKDrawingView> createDrawingView(WebCore::GraphicsLayer::EmbeddedViewID) { return nullptr; }
#endif
+
+#if ENABLE(POINTER_EVENTS)
+ virtual void cancelPointersForGestureRecognizer(UIGestureRecognizer*) { }
+#endif
+
};
} // namespace WebKit
Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h (240874 => 240875)
--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h 2019-02-01 21:53:40 UTC (rev 240875)
@@ -71,6 +71,7 @@
WebCore::ScrollingNodeID rootScrollingNodeID() const;
const RemoteLayerTreeHost* layerTreeHost() const;
+ WebPageProxy& webPageProxy() const { return m_webPageProxy; }
struct RequestedScrollInfo {
bool requestsScrollPositionUpdate { };
Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h (240874 => 240875)
--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h 2019-02-01 21:53:40 UTC (rev 240875)
@@ -67,6 +67,7 @@
void updateChildNodesAfterScroll(const WebCore::FloatPoint& scrollPosition);
#if ENABLE(POINTER_EVENTS)
Optional<TouchActionData> touchActionData() const;
+ void cancelPointersForGestureRecognizer(UIGestureRecognizer*);
#endif
private:
Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm (240874 => 240875)
--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm 2019-02-01 21:53:40 UTC (rev 240875)
@@ -43,6 +43,10 @@
#import <WebCore/ScrollSnapOffsetsInfo.h>
#endif
+#if ENABLE(POINTER_EVENTS)
+#import "PageClient.h"
+#endif
+
@implementation WKScrollingNodeScrollViewDelegate
- (instancetype)initWithScrollingTreeNodeDelegate:(WebKit::ScrollingTreeScrollingNodeDelegateIOS*)delegate
@@ -141,8 +145,10 @@
- (CGPoint)_scrollView:(UIScrollView *)scrollView adjustedOffsetForOffset:(CGPoint)offset translation:(CGPoint)translation startPoint:(CGPoint)start locationInView:(CGPoint)locationInView horizontalVelocity:(inout double *)hv verticalVelocity:(inout double *)vv
{
auto touchActionData = _scrollingTreeNodeDelegate->touchActionData();
- if (!touchActionData)
+ if (!touchActionData) {
+ [self cancelPointersForGestureRecognizer:scrollView.panGestureRecognizer];
return offset;
+ }
auto touchActions = touchActionData->touchActions;
if (touchActions == WebCore::TouchAction::Auto || touchActions == WebCore::TouchAction::Manipulation)
@@ -155,8 +161,23 @@
if (!touchActions.contains(WebCore::TouchAction::PanY))
adjustedContentOffset.y = start.y;
+ if ((touchActions.contains(WebCore::TouchAction::PanX) && adjustedContentOffset.x != start.x)
+ || (touchActions.contains(WebCore::TouchAction::PanY) && adjustedContentOffset.y != start.y)) {
+ [self cancelPointersForGestureRecognizer:scrollView.panGestureRecognizer];
+ }
+
return adjustedContentOffset;
}
+
+- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view
+{
+ [self cancelPointersForGestureRecognizer:scrollView.pinchGestureRecognizer];
+}
+
+- (void)cancelPointersForGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
+{
+ _scrollingTreeNodeDelegate->cancelPointersForGestureRecognizer(gestureRecognizer);
+}
#endif
@end
@@ -345,6 +366,11 @@
{
return downcast<RemoteScrollingTree>(scrollingTree()).scrollingCoordinatorProxy().touchActionDataForScrollNodeID(scrollingNode().scrollingNodeID());
}
+
+void ScrollingTreeScrollingNodeDelegateIOS::cancelPointersForGestureRecognizer(UIGestureRecognizer* gestureRecognizer)
+{
+ downcast<RemoteScrollingTree>(scrollingTree()).scrollingCoordinatorProxy().webPageProxy().pageClient().cancelPointersForGestureRecognizer(gestureRecognizer);
+}
#endif
} // namespace WebKit
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (240874 => 240875)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2019-02-01 21:53:40 UTC (rev 240875)
@@ -2649,6 +2649,13 @@
}
#endif // ENABLE(TOUCH_EVENTS)
+#if ENABLE(POINTER_EVENTS)
+void WebPageProxy::cancelPointer(int32_t pointerId, const WebCore::IntPoint& documentPoint)
+{
+ m_process->send(Messages::WebPage::CancelPointer(pointerId, documentPoint), m_pageID);
+}
+#endif
+
void WebPageProxy::scrollBy(ScrollDirection direction, ScrollGranularity granularity)
{
if (!isValid())
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (240874 => 240875)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2019-02-01 21:53:40 UTC (rev 240875)
@@ -790,6 +790,10 @@
void handleTouchEvent(const NativeWebTouchEvent&);
#endif
+#if ENABLE(POINTER_EVENTS)
+ void cancelPointer(int32_t, const WebCore::IntPoint&);
+#endif
+
void scrollBy(WebCore::ScrollDirection, WebCore::ScrollGranularity);
void centerSelectionInVisibleArea();
Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h (240874 => 240875)
--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h 2019-02-01 21:53:40 UTC (rev 240875)
@@ -239,6 +239,10 @@
RetainPtr<WKDrawingView> createDrawingView(WebCore::GraphicsLayer::EmbeddedViewID) override;
#endif
+#if ENABLE(POINTER_EVENTS)
+ void cancelPointersForGestureRecognizer(UIGestureRecognizer*) override;
+#endif
+
WKContentView *m_contentView;
RetainPtr<WKEditorUndoTarget> m_undoTarget;
};
Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm (240874 => 240875)
--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm 2019-02-01 21:53:40 UTC (rev 240875)
@@ -844,6 +844,13 @@
}
#endif
+#if ENABLE(POINTER_EVENTS)
+void PageClientImpl::cancelPointersForGestureRecognizer(UIGestureRecognizer* gestureRecognizer)
+{
+ [m_contentView cancelPointersForGestureRecognizer:gestureRecognizer];
+}
+#endif
+
} // namespace WebKit
#endif // PLATFORM(IOS_FAMILY)
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (240874 => 240875)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2019-02-01 21:53:40 UTC (rev 240875)
@@ -378,6 +378,10 @@
- (BOOL)canPerformActionForWebView:(SEL)action withSender:(id)sender;
- (id)targetForActionForWebView:(SEL)action withSender:(id)sender;
+#if ENABLE(POINTER_EVENTS)
+- (void)cancelPointersForGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer;
+#endif
+
#define DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW(_action) \
- (void)_action ## ForWebView:(id)sender;
FOR_EACH_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW)
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (240874 => 240875)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-02-01 21:53:40 UTC (rev 240875)
@@ -1146,6 +1146,22 @@
return superDidResign;
}
+#if ENABLE(POINTER_EVENTS)
+- (void)cancelPointersForGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
+{
+ // FIXME: <rdar://problem/47714562>
+ if (![_touchEventGestureRecognizer respondsToSelector:@selector(activeTouchesByIdentifier)])
+ return;
+
+ NSMapTable<NSNumber *, UITouch *> *activeTouches = [_touchEventGestureRecognizer activeTouchesByIdentifier];
+ for (NSNumber *touchIdentifier in activeTouches) {
+ UITouch *touch = [activeTouches objectForKey:touchIdentifier];
+ if ([touch.gestureRecognizers containsObject:gestureRecognizer])
+ _page->cancelPointer([touchIdentifier unsignedIntValue], WebCore::roundedIntPoint([touch locationInView:self]));
+ }
+}
+#endif
+
- (void)_webTouchEventsRecognized:(UIWebTouchEventsGestureRecognizer *)gestureRecognizer
{
if (!_page->isValid())
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (240874 => 240875)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2019-02-01 21:53:40 UTC (rev 240875)
@@ -190,6 +190,7 @@
#include <WebCore/PlatformKeyboardEvent.h>
#include <WebCore/PlatformMediaSessionManager.h>
#include <WebCore/PluginDocument.h>
+#include <WebCore/PointerCaptureController.h>
#include <WebCore/PrintContext.h>
#include <WebCore/PromisedAttachmentInfo.h>
#include <WebCore/Range.h>
@@ -2797,6 +2798,13 @@
}
#endif
+#if ENABLE(POINTER_EVENTS)
+void WebPage::cancelPointer(int32_t pointerId, const WebCore::IntPoint& documentPoint)
+{
+ m_page->pointerCaptureController().cancelPointer(pointerId, documentPoint);
+}
+#endif
+
#if ENABLE(MAC_GESTURE_EVENTS)
static bool handleGestureEvent(const WebGestureEvent& event, Page* page)
{
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (240874 => 240875)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2019-02-01 21:53:40 UTC (rev 240875)
@@ -1240,6 +1240,10 @@
void touchEvent(const WebTouchEvent&);
#endif
+#if ENABLE(POINTER_EVENTS)
+ void cancelPointer(int32_t, const WebCore::IntPoint&);
+#endif
+
#if ENABLE(CONTEXT_MENUS)
void contextMenuHidden() { m_isShowingContextMenu = false; }
void contextMenuForKeyEvent();
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (240874 => 240875)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in 2019-02-01 21:48:53 UTC (rev 240874)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in 2019-02-01 21:53:40 UTC (rev 240875)
@@ -127,6 +127,10 @@
TouchEvent(WebKit::WebTouchEvent event)
#endif
+#if ENABLE(POINTER_EVENTS)
+ CancelPointer(int32_t pointerId, WebCore::IntPoint documentPoint)
+#endif
+
#if ENABLE(INPUT_TYPE_COLOR)
DidEndColorPicker()
DidChooseColor(WebCore::Color color)