Repository navigation
fix: return the shadow host for a text node in a shadow root in SerializedAXNode.elementHandle - #15451
Merged
Conversation
…lizedAXNode.elementHandle
samiyac
approved these changes
Sep 15, 2026
Merged
dadezzz
pushed a commit
to dadezzz/events-cash-register
that referenced
this pull request
Sep 27, 2026
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [puppeteer-core](https://github.com/puppeteer/puppeteer/tree/main#readme) ([source](https://github.com/puppeteer/puppeteer)) | [`25.11.0` → `25.12.0`](https://renovatebot.com/diffs/npm/puppeteer-core/25.11.0/25.12.0) |  |  | --- ### Release Notes <details> <summary>puppeteer/puppeteer (puppeteer-core)</summary> ### [`v25.12.0`](https://github.com/puppeteer/puppeteer/releases/tag/puppeteer-core-v25.12.0): puppeteer-core: v25.12.0 [Compare Source](puppeteer/puppeteer@puppeteer-core-v25.11.0...puppeteer-core-v25.12.0) ##### 🎉 Features - roll to Chrome 154.0.8037.57 ([#​15484](puppeteer/puppeteer#15484)) ([00eec77](puppeteer/puppeteer@00eec77)) - roll to Firefox 156.0 ([#​15464](puppeteer/puppeteer#15464)) ([abdc078](puppeteer/puppeteer@abdc078)) ##### 🛠️ Fixes - **launcher:** clean temporary profiles on process exit ([#​15441](puppeteer/puppeteer#15441)) ([b30d91c](puppeteer/puppeteer@b30d91c)) - release the mouse button when a drag or drop fails ([#​15231](puppeteer/puppeteer#15231)) ([469621f](puppeteer/puppeteer@469621f)) - return the shadow host for a text node in a shadow root in SerializedAXNode.elementHandle ([#​15451](puppeteer/puppeteer#15451)) ([101c7d5](puppeteer/puppeteer@101c7d5)) - roll to Chrome 153.0.8010.47 ([#​15465](puppeteer/puppeteer#15465)) ([1ce3a9a](puppeteer/puppeteer@1ce3a9a)) - roll to Chrome 153.0.8010.52 ([#​15470](puppeteer/puppeteer#15470)) ([257a6a1](puppeteer/puppeteer@257a6a1)) - roll to Firefox 156.0.1 ([#​15483](puppeteer/puppeteer#15483)) ([73d8fec](puppeteer/puppeteer@73d8fec)) ##### Dependencies - The following workspace dependencies were updated - dependencies - [@​puppeteer/browsers](https://github.com/puppeteer/browsers) bumped from 3.2.2 to 3.2.3 </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMTUuMTAiLCJ1cGRhdGVkSW5WZXIiOiI0NC4xMTUuMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=-->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Bugfix.
Did you add tests for your changes?
Yes, a new case under
Accessibility > elementHandle()intest/src/accessibility.test.ts.If relevant, did you update the documentation?
Not needed, the documented return type (
ElementHandle | null) doesn't change.Summary
I was reading how
SerializedAXNode.elementHandle()handles text nodes: it evaluatesnode.parentElementso that aStaticTextnode gives back its parent element. When the text sits directly inside a shadow root,parentElementisnull(the parent node is theShadowRoot), andevaluateHandlethen returns aJSHandlewrappingnull. That value isn'tnulland isn't anElementHandleeither, so the caller's null check passes and the next call blows up.Repro against the current build, Chrome 153 headless:
The fix falls back to the shadow host when a text node has no parent element, which keeps the existing intent of the comment there (give the element that contains the text).
The new test fails on main with
expect(received).toBeTruthy() Received: nullonasElement(), and passes with the change. I ran the whole accessibility file onchrome-headless(32 passing) and theelementHandle()tests onchrome-bidi(3 passing); Firefox skips this file in TestExpectations.Does this PR introduce a breaking change?
No. Text nodes with a parent element take the same path as before; only the case that currently returns an unusable handle changes.
Other information
AI tools used