Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 30763df2eb58948fceecffa801e7ccf2b6943a24
      
https://github.com/WebKit/WebKit/commit/30763df2eb58948fceecffa801e7ccf2b6943a24
  Author: Lily Spiniolas <[email protected]>
  Date:   2026-01-08 (Thu, 08 Jan 2026)

  Changed paths:
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Document.h

  Log Message:
  -----------
  [Touch event regions] Slider thumbs and switch controls may be missing touch 
event regions
https://bugs.webkit.org/show_bug.cgi?id=305125
rdar://167700041

Reviewed by Abrar Rahman Protyasha.

When a page has no JS touch event listeners, slider thumbs and switch controls
are missing touch event regions.

In RenderLayerBacking::updateEventRegion(), we check
`RenderLayerBacking::maintainsEventRegion()` to see if we should proceed with
the update. To determine whether or not we should maintain an event region,
we check if there are touch event handlers, but we failed to account for
internal touch event handlers and only counted JS listeners. As a result,
we failed to build touch event regions unless JS touch event listeners were
present elsewhere on the page.

Resolve this by also checking m_touchEventHandlerCounts in
`Document::hasTouchEventHandlers()`.

Tested by the following existing tests:

fast/events/touch/ios/touch-event-regions-layer-tree/input-type-change.html
fast/events/touch/ios/touch-event-regions-layer-tree/range-enablement.html
fast/events/touch/ios/touch-event-regions-layer-tree/range.html
fast/events/touch/ios/touch-event-regions-layer-tree/switch-enablement.html
fast/events/touch/ios/touch-event-regions-layer-tree/switch.html

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::hasTouchEventHandlers const):
* Source/WebCore/dom/Document.h:

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



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

Reply via email to