Title: [245809] trunk/Source/WebCore
Revision
245809
Author
[email protected]
Date
2019-05-28 05:33:11 -0700 (Tue, 28 May 2019)

Log Message

[Pointer Events] Check that capturing data managed by the PointerCaptureController gets cleared upon navigation
https://bugs.webkit.org/show_bug.cgi?id=198191

Reviewed by Dean Jackson.

When the document of the page's main frame changes, make sure we clear all of the data accumulated for the previous document.
I don't think this particular change is testable as none of the data contained in the PointerIdToCapturingDataMap maintained by
the PointerCaptureController contains any data that could be inspected by the page due to other fixes landed to fix wkb.ug/198129,
but I've checked that removing those fixes and using this patch correctly fixes that bug.

* page/Page.cpp:
(WebCore::Page::didChangeMainDocument):
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::PointerCaptureController):
(WebCore::PointerCaptureController::reset):
* page/PointerCaptureController.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (245808 => 245809)


--- trunk/Source/WebCore/ChangeLog	2019-05-28 08:45:02 UTC (rev 245808)
+++ trunk/Source/WebCore/ChangeLog	2019-05-28 12:33:11 UTC (rev 245809)
@@ -1,3 +1,22 @@
+2019-05-27  Antoine Quint  <[email protected]>
+
+        [Pointer Events] Check that capturing data managed by the PointerCaptureController gets cleared upon navigation
+        https://bugs.webkit.org/show_bug.cgi?id=198191
+
+        Reviewed by Dean Jackson.
+
+        When the document of the page's main frame changes, make sure we clear all of the data accumulated for the previous document.
+        I don't think this particular change is testable as none of the data contained in the PointerIdToCapturingDataMap maintained by
+        the PointerCaptureController contains any data that could be inspected by the page due to other fixes landed to fix wkb.ug/198129,
+        but I've checked that removing those fixes and using this patch correctly fixes that bug.
+
+        * page/Page.cpp:
+        (WebCore::Page::didChangeMainDocument):
+        * page/PointerCaptureController.cpp:
+        (WebCore::PointerCaptureController::PointerCaptureController):
+        (WebCore::PointerCaptureController::reset):
+        * page/PointerCaptureController.h:
+
 2019-05-27  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Use WPEBackend-fdo for accelerating compositing in Wayland instead of the nested compositor

Modified: trunk/Source/WebCore/page/Page.cpp (245808 => 245809)


--- trunk/Source/WebCore/page/Page.cpp	2019-05-28 08:45:02 UTC (rev 245808)
+++ trunk/Source/WebCore/page/Page.cpp	2019-05-28 12:33:11 UTC (rev 245809)
@@ -2860,6 +2860,9 @@
 #if ENABLE(WEB_RTC)
     m_rtcController.reset(m_shouldEnableICECandidateFilteringByDefault);
 #endif
+#if ENABLE(POINTER_EVENTS)
+    m_pointerCaptureController->reset();
+#endif
 }
 
 RenderingUpdateScheduler& Page::renderingUpdateScheduler()

Modified: trunk/Source/WebCore/page/PointerCaptureController.cpp (245808 => 245809)


--- trunk/Source/WebCore/page/PointerCaptureController.cpp	2019-05-28 08:45:02 UTC (rev 245808)
+++ trunk/Source/WebCore/page/PointerCaptureController.cpp	2019-05-28 12:33:11 UTC (rev 245809)
@@ -44,11 +44,7 @@
 PointerCaptureController::PointerCaptureController(Page& page)
     : m_page(page)
 {
-#if !ENABLE(TOUCH_EVENTS)
-    CapturingData capturingData;
-    capturingData.pointerType = PointerEvent::mousePointerType();
-    m_activePointerIdsToCapturingData.set(mousePointerID, capturingData);
-#endif
+    reset();
 }
 
 ExceptionOr<void> PointerCaptureController::setPointerCapture(Element* capturingTarget, PointerID pointerId)
@@ -146,6 +142,16 @@
     }
 }
 
+void PointerCaptureController::reset()
+{
+    m_activePointerIdsToCapturingData.clear();
+#if !ENABLE(TOUCH_EVENTS)
+    CapturingData capturingData;
+    capturingData.pointerType = PointerEvent::mousePointerType();
+    m_activePointerIdsToCapturingData.set(mousePointerID, capturingData);
+#endif
+}
+
 void PointerCaptureController::touchWithIdentifierWasRemoved(PointerID pointerId)
 {
     m_activePointerIdsToCapturingData.remove(pointerId);

Modified: trunk/Source/WebCore/page/PointerCaptureController.h (245808 => 245809)


--- trunk/Source/WebCore/page/PointerCaptureController.h	2019-05-28 08:45:02 UTC (rev 245808)
+++ trunk/Source/WebCore/page/PointerCaptureController.h	2019-05-28 12:33:11 UTC (rev 245809)
@@ -44,6 +44,7 @@
     ExceptionOr<void> setPointerCapture(Element*, PointerID);
     ExceptionOr<void> releasePointerCapture(Element*, PointerID);
     bool hasPointerCapture(Element*, PointerID);
+    void reset();
 
     void pointerLockWasApplied();
     void elementWasRemoved(Element&);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to