Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c45fe212d9c8dce9cf9bfa1c1647743c5db0e88d
      
https://github.com/WebKit/WebKit/commit/c45fe212d9c8dce9cf9bfa1c1647743c5db0e88d
  Author: Dominic Mazzoni <[email protected]>
  Date:   2026-07-18 (Sat, 18 Jul 2026)

  Changed paths:
    A 
LayoutTests/accessibility/mac/live-regions/live-region-changes-coalesced-expected.txt
    A 
LayoutTests/accessibility/mac/live-regions/live-region-changes-coalesced.html
    M LayoutTests/accessibility/mac/live-regions/live-region-types.html
    M Source/WebCore/accessibility/AXLiveRegionManager.cpp
    M Source/WebCore/accessibility/AXLiveRegionManager.h
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AXObjectCache.h
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/testing/Internals.idl

  Log Message:
  -----------
  AX: Coalesce redundant live region snapshot recomputations within a run loop 
iteration
https://bugs.webkit.org/show_bug.cgi?id=319607
rdar://178549889

Reviewed by Tyler Wilcock and Andres Gonzalez.

The AXObjectCache walks every ancestor of every changed node and posts
a live region change for each ancestor that supports live
regions. Rebuilding a large subtree fires hundreds of such changes,
all resolving to the same live region.

With the fix, postLiveRegionChangeNotification() adds the region to
m_changedLiveRegions (deduplicated) and starts a zero-delay timer
instead of processing inline. When the timer fires,
liveRegionChangedNotificationPostTimerFired() drives
AXLiveRegionManager once per unique region. Hundreds of changes to the
same region in a single run loop iteration now collapse into a single
snapshot rebuild and a single announcement covering the net change.

Test: accessibility/mac/live-regions/live-region-changes-coalesced.html

* 
LayoutTests/accessibility/mac/live-regions/live-region-changes-coalesced-expected.txt:
 Added.
* 
LayoutTests/accessibility/mac/live-regions/live-region-changes-coalesced.html: 
Added.
* LayoutTests/accessibility/mac/live-regions/live-region-types.html:
* Source/WebCore/accessibility/AXLiveRegionManager.cpp:
(WebCore::AXLiveRegionManager::buildLiveRegionSnapshot const):
* Source/WebCore/accessibility/AXLiveRegionManager.h:
(WebCore::AXLiveRegionManager::snapshotBuildCount const):
(WebCore::AXLiveRegionManager::resetSnapshotBuildCount):
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::liveRegionSnapshotBuildCount const):
(WebCore::AXObjectCache::resetLiveRegionSnapshotBuildCount):
(WebCore::AXObjectCache::postLiveRegionChangeNotification):
(WebCore::AXObjectCache::liveRegionChangedNotificationPostTimerFired):
* Source/WebCore/accessibility/AXObjectCache.h:
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::liveRegionSnapshotBuildCount const):
(WebCore::Internals::resetLiveRegionSnapshotBuildCount const):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:

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



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

Reply via email to