Skip to content

AX: Refactor six ancestor-finding methods in AXCoreObject from pure virtual, template-based implementations to non-virtual inline member functions.#56121

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
AndresGonzalezApple:editableAncestor
Jan 6, 2026

Conversation

@AndresGonzalezApple
Copy link
Contributor

@AndresGonzalezApple AndresGonzalezApple commented Jan 6, 2026

a1f5e0b

AX: Refactor six ancestor-finding methods in AXCoreObject from pure virtual, template-based implementations to non-virtual inline member functions.
https://bugs.webkit.org/show_bug.cgi?id=304967
<rdar://problem/167591275>

Reviewed by Tyler Wilcock.

No change in functionality.

This patch refactors six ancestor-finding methods in AXCoreObject from pure virtual, template-based implementations to non-virtual inline member functions. The refactoring improves const-correctness, simplifies the inheritance hierarchy, and eliminates virtual dispatch overhead.

* Source/WebCore/accessibility/AXCoreObject.h:
(WebCore::AXCoreObject::editableAncestor const):
(WebCore::AXCoreObject::highestEditableAncestor const):
(WebCore::AXCoreObject::focusableAncestor const):
(WebCore::AXCoreObject::clickableSelfOrAncestor const):
(WebCore::AXCoreObject::liveRegionAncestor const):
(WebCore::AXCoreObject::exposedTableAncestor const):
(WebCore::Accessibility::focusableAncestor): Deleted.
(WebCore::Accessibility::editableAncestor): Deleted.
(WebCore::Accessibility::highestEditableAncestor): Deleted.
(WebCore::Accessibility::liveRegionAncestor): Deleted.
(WebCore::Accessibility::exposedTableAncestor): Deleted.
* Source/WebCore/accessibility/AccessibilityObject.h:
* Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityHeaderElements]):
(-[WebAccessibilityObjectWrapper accessibilityElementForRow:andColumn:]):
(-[WebAccessibilityObjectWrapper accessibilityRowCount]):
(-[WebAccessibilityObjectWrapper accessibilityColumnCount]):
(-[WebAccessibilityObjectWrapper accessibilityARIARowCount]):
(-[WebAccessibilityObjectWrapper accessibilityARIAColumnCount]):
(-[WebAccessibilityObjectWrapper tableParent]): Deleted.
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h:
In both derived classes, removed simple forwarding functions to the template implementations. With the base class now providing concrete implementations, these overrides are no longer needed.

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

e8e513c

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
❌ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ✅ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 🧪 win-tests ✅ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe ✅ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ✅ 🧪 api-mac-debug ✅ 🛠 wpe-cairo-libwebrtc
✅ 🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-wk2-stress ✅ 🛠 playstation
✅ 🛠 tv ✅ 🧪 mac-intel-wk2
✅ 🛠 tv-sim ✅ 🛠 mac-safer-cpp
✅ 🛠 watch
✅ 🛠 watch-sim

@AndresGonzalezApple AndresGonzalezApple self-assigned this Jan 6, 2026
@AndresGonzalezApple AndresGonzalezApple added the Accessibility For bugs related to accessibility. label Jan 6, 2026
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Jan 6, 2026
@AndresGonzalezApple AndresGonzalezApple removed the merging-blocked Applied to prevent a change from being merged label Jan 6, 2026
@AndresGonzalezApple AndresGonzalezApple added the merge-queue Applied to send a pull request to merge-queue label Jan 6, 2026
…irtual, template-based implementations to non-virtual inline member functions.

https://bugs.webkit.org/show_bug.cgi?id=304967
<rdar://problem/167591275>

Reviewed by Tyler Wilcock.

No change in functionality.

This patch refactors six ancestor-finding methods in AXCoreObject from pure virtual, template-based implementations to non-virtual inline member functions. The refactoring improves const-correctness, simplifies the inheritance hierarchy, and eliminates virtual dispatch overhead.

* Source/WebCore/accessibility/AXCoreObject.h:
(WebCore::AXCoreObject::editableAncestor const):
(WebCore::AXCoreObject::highestEditableAncestor const):
(WebCore::AXCoreObject::focusableAncestor const):
(WebCore::AXCoreObject::clickableSelfOrAncestor const):
(WebCore::AXCoreObject::liveRegionAncestor const):
(WebCore::AXCoreObject::exposedTableAncestor const):
(WebCore::Accessibility::focusableAncestor): Deleted.
(WebCore::Accessibility::editableAncestor): Deleted.
(WebCore::Accessibility::highestEditableAncestor): Deleted.
(WebCore::Accessibility::liveRegionAncestor): Deleted.
(WebCore::Accessibility::exposedTableAncestor): Deleted.
* Source/WebCore/accessibility/AccessibilityObject.h:
* Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityHeaderElements]):
(-[WebAccessibilityObjectWrapper accessibilityElementForRow:andColumn:]):
(-[WebAccessibilityObjectWrapper accessibilityRowCount]):
(-[WebAccessibilityObjectWrapper accessibilityColumnCount]):
(-[WebAccessibilityObjectWrapper accessibilityARIARowCount]):
(-[WebAccessibilityObjectWrapper accessibilityARIAColumnCount]):
(-[WebAccessibilityObjectWrapper tableParent]): Deleted.
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h:
In both derived classes, removed simple forwarding functions to the template implementations. With the base class now providing concrete implementations, these overrides are no longer needed.

Canonical link: https://commits.webkit.org/305170@main
@webkit-commit-queue
Copy link
Collaborator

Committed 305170@main (a1f5e0b): https://commits.webkit.org/305170@main

Reviewed commits have been landed. Closing PR #56121 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit a1f5e0b into WebKit:main Jan 6, 2026
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Accessibility For bugs related to accessibility.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants