Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3585d8a0db29cf712ddff26e97e1000ee4df7897
      
https://github.com/WebKit/WebKit/commit/3585d8a0db29cf712ddff26e97e1000ee4df7897
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2026-03-30 (Mon, 30 Mar 2026)

  Changed paths:
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm
    M Source/WebKit/UIProcess/RemoteLayerTree/cocoa/RemoteScrollingTreeCocoa.h
    M Source/WebKit/UIProcess/RemoteLayerTree/cocoa/RemoteScrollingTreeCocoa.mm
    M Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm

  Log Message:
  -----------
  RemoteScrollingTree EventRegion helpers need not return pointers from 
EventRegion references
https://bugs.webkit.org/show_bug.cgi?id=310947
rdar://173559109

Reviewed by Aditya Keerthi.

The EventRegion getter in RemoteLayerTreeNode returns a const lvalue ref.

Returning a pointer destroys this non-null guarantee. Currently, the
pointer is used to indicate nullity for other reasons (not because the
EventRegion instance itself is null). As such, let's change these
interfaces to return std::optional<const EventRegion&> instead. Note
that std::optional cannot hold T& before C++26, so we instead make use
of std::reference_wrapper<const EventRegion>.

Furthermore, we retrofit call sites to both adopt the new API and adopt
the monadic operations now available because of this std::optional return
value.

* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::eventTrackingTypeForPoint):
* Source/WebKit/UIProcess/RemoteLayerTree/cocoa/RemoteScrollingTreeCocoa.h:
* Source/WebKit/UIProcess/RemoteLayerTree/cocoa/RemoteScrollingTreeCocoa.mm:
(WebKit::eventRegionForLayer):
(WebKit::layerEventRegionContainsPoint):
(WebKit::eventRegionForPoint):
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm:
(WebKit::RemoteScrollingTreeMac::eventListenerRegionTypesForPoint const):

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



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

Reply via email to