[whatwg/dom] Proposal: new API to get text content across shadowRoot (Issue #1395)

woody-li created an issue (whatwg/dom#1395)

### What problem are you trying to solve?

Currently, we already have HTML-related API: getHTML, setHTML, etc.
But there's no way to get text content across shadowRoot.

In some cases, we need to get real text content across element shadowRoots.
Such as a customized tooltip, check content in the auto-test frame, etc.

### What solutions exist today?

_No response_

### How would you solve it?

How about adding a new API, like getText or getTextContent?
Add an option like `checkVisibility` to deal with hidden elements. (The difference between innerText and textContent)

### Anything else?

_No response_

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1395
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/1395@github.com>

Received on Monday, 28 July 2025 03:24:44 UTC