Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7b509571d1cc10b9862b052d3222f2f68f7791ec
      
https://github.com/WebKit/WebKit/commit/7b509571d1cc10b9862b052d3222f2f68f7791ec
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2026-05-14 (Thu, 14 May 2026)

  Changed paths:
    M Source/WebCore/page/scrolling/ScrollingTree.cpp
    M Source/WebCore/page/scrolling/ScrollingTree.h
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h
    M 
Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.mm

  Log Message:
  -----------
  [AppKit Gestures] Occasional debug assert when scrolling 
(ASSERT(m_layerHitTestMutex.isLocked()))
https://bugs.webkit.org/show_bug.cgi?id=314782
rdar://177023194

Reviewed by Richard Robinson.

ScrollingTree::pinnedStateIncludingAncestorsAtPoint() walks the
scrolling tree via scrollingNodeForPoint(), but only acquires the tree
state lock and not the mutex for layer hit-tests. This is problematic
for the UI process scrolling path, since scrollingNodeForPoint() assumes
that as a caller responsibility.

In this patch, we acquire said mutex for the ancestor walk scope. We
also move our state tree lock scope to only cover our read of the main
frame scroll position, so that the lock ordering is preserved.

In writing this patch, I noticed that we have multiple RAII utilities
for this same pattern. We consolidate to ScrollingTree::HitTestLocker
in WebCore as the canonical helper and migrate the other lockers away
from their respective helpers.

* Source/WebCore/page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::pinnedStateIncludingAncestorsAtPoint):
* Source/WebCore/page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::HitTestLocker::HitTestLocker):
(WebCore::ScrollingTree::HitTestLocker::~HitTestLocker):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
(WebKit::RemoteLayerTreeHitTestLocker::RemoteLayerTreeHitTestLocker): Deleted.
(WebKit::RemoteLayerTreeHitTestLocker::~RemoteLayerTreeHitTestLocker): Deleted.
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.mm:
(WebKit::RemoteLayerTreeEventDispatcher::scrollingThreadHandleWheelEvent):
(WebKit::RemoteLayerTreeEventDispatcher::didRefreshDisplay):

Canonical link: https://commits.webkit.org/313258@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to