Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c467303c1538dce11f24ec1c91d7d8ed503d6479
      
https://github.com/WebKit/WebKit/commit/c467303c1538dce11f24ec1c91d7d8ed503d6479
  Author: Lily Spiniolas <[email protected]>
  Date:   2025-12-04 (Thu, 04 Dec 2025)

  Changed paths:
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/style/StyleAdjuster.cpp

  Log Message:
  -----------
  Popover light dismiss does not work when touch event regions are enabled
https://bugs.webkit.org/show_bug.cgi?id=303527
rdar://165823080

Reviewed by Tim Nguyen and Abrar Rahman Protyasha.

A pointerup event followed by a pointerdown event occuring outside of a
popover should cause the popover to dismiss. This functionality is broken with
touch event regions enabled because touch event regions are only created for
elements with JS event listeners or for elements with internal touch handling.
Neither of these cases apply when a popover is shown.

To resolve this issue, call `Document::invalidateEventListenerRegions()` when a
top-layer element (popover) is created or removed if the value of
`needsPointerEventHandlingForPopover()` changed. This results in
`Style::Adjuster::adjustEventListenerRegionTypesForRootStyle` being called, 
where
we now add `EventListenerRegionTypes::PointerDown` && `PointerUp` to the root
style if the document needs pointer event handling for a popover. As a result,
the missing event region is now generated.

Tested by
imported/w3c/web-platform-tests/html/semantics/popovers/popover-light-dismiss-with-anchor.tentative.html

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::addTopLayerElement):
(WebCore::Document::removeTopLayerElement):
* Source/WebCore/style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjustEventListenerRegionTypesForRootStyle):

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



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

Reply via email to