Skip to content

REGRESSION(305794@main): Unconditional CheckedPtr crash when loading any Reddit post with VoiceOver active#59243

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
twilco:eng/REGRESSION-305794-main-Unconditional-CheckedPtr-crash-when-loading-any-Reddit-post-with-VoiceOver-active
Feb 25, 2026
Merged

REGRESSION(305794@main): Unconditional CheckedPtr crash when loading any Reddit post with VoiceOver active#59243
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
twilco:eng/REGRESSION-305794-main-Unconditional-CheckedPtr-crash-when-loading-any-Reddit-post-with-VoiceOver-active

Conversation

@twilco
Copy link
Contributor

@twilco twilco commented Feb 23, 2026

54845b1

REGRESSION(305794@main): Unconditional CheckedPtr crash when loading any Reddit post with VoiceOver active
https://bugs.webkit.org/show_bug.cgi?id=308467
rdar://170985963

Reviewed by Chris Fleizach.

Narrow the scope of the CheckedPtr<RenderStyle> in AccessibilityNodeObject::textUnderElement
(added in 305794@main)so it does not live across the child iteration loop.

Previously, a CheckedPtr to the element's RenderStyle was captured at the
top of the function and held until return. During child iteration,
getOrCreate for a sibling slot element can trigger computedStyle() ->
resolveComputedStyle(), which walks the ancestor chain and re-resolves
the parent's m_computedStyle. This destroys the old RenderStyle that the
CheckedPtr still references, resulting in a crash (EXC_GUARD from
CheckedPtr accessing a scribbled-over object).

This happens specifically for display:none shadow hosts with slot
children, where a shadow-scoped stylesheet update sets
IsComputedStyleInvalidFlag on the host and slots. The flag is never
cleared by the style tree resolver because display:none subtrees without
renderers are not visited during resolveStyle, and
updateLayoutIgnorePendingStylesheets considers style clean despite the
flag persisting on non-rendered elements.

* LayoutTests/accessibility/shadow-host-style-invalidation-during-text-under-element-crash-expected.txt: Added.
* LayoutTests/accessibility/shadow-host-style-invalidation-during-text-under-element-crash.html: Added.
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::textUnderElement const):

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

e95970b

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 loading 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe ✅ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ❌ 🧪 api-mac-debug ✅ 🛠 gtk3-libwebrtc
✅ 🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🛠 ios-safer-cpp ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🛠 playstation
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@twilco twilco self-assigned this Feb 23, 2026
@twilco twilco added the Accessibility For bugs related to accessibility. label Feb 23, 2026
@twilco twilco added the merge-queue Applied to send a pull request to merge-queue label Feb 25, 2026
…any Reddit post with VoiceOver active

https://bugs.webkit.org/show_bug.cgi?id=308467
rdar://170985963

Reviewed by Chris Fleizach.

Narrow the scope of the CheckedPtr<RenderStyle> in AccessibilityNodeObject::textUnderElement
(added in 305794@main)so it does not live across the child iteration loop.

Previously, a CheckedPtr to the element's RenderStyle was captured at the
top of the function and held until return. During child iteration,
getOrCreate for a sibling slot element can trigger computedStyle() ->
resolveComputedStyle(), which walks the ancestor chain and re-resolves
the parent's m_computedStyle. This destroys the old RenderStyle that the
CheckedPtr still references, resulting in a crash (EXC_GUARD from
CheckedPtr accessing a scribbled-over object).

This happens specifically for display:none shadow hosts with slot
children, where a shadow-scoped stylesheet update sets
IsComputedStyleInvalidFlag on the host and slots. The flag is never
cleared by the style tree resolver because display:none subtrees without
renderers are not visited during resolveStyle, and
updateLayoutIgnorePendingStylesheets considers style clean despite the
flag persisting on non-rendered elements.

* LayoutTests/accessibility/shadow-host-style-invalidation-during-text-under-element-crash-expected.txt: Added.
* LayoutTests/accessibility/shadow-host-style-invalidation-during-text-under-element-crash.html: Added.
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::textUnderElement const):

Canonical link: https://commits.webkit.org/308173@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/REGRESSION-305794-main-Unconditional-CheckedPtr-crash-when-loading-any-Reddit-post-with-VoiceOver-active branch from e95970b to 54845b1 Compare February 25, 2026 02:56
@webkit-commit-queue
Copy link
Collaborator

Committed 308173@main (54845b1): https://commits.webkit.org/308173@main

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

@webkit-commit-queue webkit-commit-queue merged commit 54845b1 into WebKit:main Feb 25, 2026
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Feb 25, 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.

4 participants