Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 268bd784c772dc11d4ed4d22592203ede0656a20
https://github.com/WebKit/WebKit/commit/268bd784c772dc11d4ed4d22592203ede0656a20
Author: Abrar Rahman Protyasha <[email protected]>
Date: 2026-04-03 (Fri, 03 Apr 2026)
Changed paths:
M Source/WebCore/rendering/EventRegion.cpp
M Source/WebCore/rendering/EventRegion.h
Log Message:
-----------
Skip variant dispatch for touch-action: auto elements during event region
unification
https://bugs.webkit.org/show_bug.cgi?id=311453
rdar://173455838
Reviewed by Richard Robinson and Megan Gardner.
When `ENABLE_TOUCH_ACTION_REGIONS` is on, EventRegion::unite() calls
uniteTouchActions() unconditionally for every element, which requires a
Style::toPlatform() variant dispatch, even for the overwhelming majority
of elements with touch-action: auto.
As an optimization opportunity, we check isAuto() first (a single integer
comparison on the variant index) and skip the toPlatform() conversion
entirely when possible. If m_touchActionRegions is empty, meaning no
non-auto region has been found yet, we can skip uniteTouchActions()
altogether. When non-empty, we just use a helper dedicated to subtract
from the existing regions for touch-action: auto, again avoiding the
toPlatform conversion.
* Source/WebCore/rendering/EventRegion.cpp:
(WebCore::EventRegion::unite):
(WebCore::EventRegion::subtractAutoFromTouchActions):
* Source/WebCore/rendering/EventRegion.h:
Canonical link: https://commits.webkit.org/310561@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications