⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245809 in webkit


Ignore:
Timestamp:
May 28, 2019, 5:33:11 AM (7 years ago)
Author:
graouts@webkit.org
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:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r245807 r245809  
     12019-05-27  Antoine Quint  <graouts@apple.com>
     2
     3        [Pointer Events] Check that capturing data managed by the PointerCaptureController gets cleared upon navigation
     4        https://bugs.webkit.org/show_bug.cgi?id=198191
     5
     6        Reviewed by Dean Jackson.
     7
     8        When the document of the page's main frame changes, make sure we clear all of the data accumulated for the previous document.
     9        I don't think this particular change is testable as none of the data contained in the PointerIdToCapturingDataMap maintained by
     10        the PointerCaptureController contains any data that could be inspected by the page due to other fixes landed to fix wkb.ug/198129,
     11        but I've checked that removing those fixes and using this patch correctly fixes that bug.
     12
     13        * page/Page.cpp:
     14        (WebCore::Page::didChangeMainDocument):
     15        * page/PointerCaptureController.cpp:
     16        (WebCore::PointerCaptureController::PointerCaptureController):
     17        (WebCore::PointerCaptureController::reset):
     18        * page/PointerCaptureController.h:
     19
    1202019-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
    221
  • trunk/Source/WebCore/page/Page.cpp

    r245778 r245809  
    28612861    m_rtcController.reset(m_shouldEnableICECandidateFilteringByDefault);
    28622862#endif
     2863#if ENABLE(POINTER_EVENTS)
     2864    m_pointerCaptureController->reset();
     2865#endif
    28632866}
    28642867
  • trunk/Source/WebCore/page/PointerCaptureController.cpp

    r245699 r245809  
    4545    : m_page(page)
    4646{
    47 #if !ENABLE(TOUCH_EVENTS)
    48     CapturingData capturingData;
    49     capturingData.pointerType = PointerEvent::mousePointerType();
    50     m_activePointerIdsToCapturingData.set(mousePointerID, capturingData);
    51 #endif
     47    reset();
    5248}
    5349
    … …  
    147143}
    148144
     145void PointerCaptureController::reset()
     146{
     147    m_activePointerIdsToCapturingData.clear();
     148#if !ENABLE(TOUCH_EVENTS)
     149    CapturingData capturingData;
     150    capturingData.pointerType = PointerEvent::mousePointerType();
     151    m_activePointerIdsToCapturingData.set(mousePointerID, capturingData);
     152#endif
     153}
     154
    149155void PointerCaptureController::touchWithIdentifierWasRemoved(PointerID pointerId)
    150156{
  • trunk/Source/WebCore/page/PointerCaptureController.h

    r245699 r245809  
    4545    ExceptionOr<void> releasePointerCapture(Element*, PointerID);
    4646    bool hasPointerCapture(Element*, PointerID);
     47    void reset();
    4748
    4849    void pointerLockWasApplied();
Note: See TracChangeset for help on using the changeset viewer.