Summary: | HTMLElement.innerText should return the content of a clipped box | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | zalan <zalan> | ||||
Component: | DOM | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | NEW --- | ||||||
Severity: | Normal | CC: | ahmad.saleem792, bfulgham, cdumez, darin, rniwa, simon.fraser, webkit-bug-importer, zalan | ||||
Priority: | P2 | Keywords: | BrowserCompat, InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
zalan
2022-03-30 08:58:18 PDT
innerText calls TextIterator::handleTextNode() which early returns when the content is clipped: "if (m_fullyClippedStack.top() && !m_behaviors.contains(TextIteratorBehavior::IgnoresStyleVisibility))" Hm... skipping clipped content stuff comes from this change: https://github.com/WebKit/WebKit/commit/55e9335cacf138ba817ca25d71e3d8ae66d1ced6 I guess this is really for find so we could add a new TextIterator behavior to not ignore clipped contents and use it in innerText and other places where appropriate. Alternatively, we could re-implement innerText as the spec says. There is no reason it has to use innerText if there is a clear spec text which specifies the behavior since TextIterator is used for all sorts of other features like copy & paste, etc... and has a lot of quirky behaviors. TextIteratorBehavior::IgnoresStyleVisibility lets us do this without moving off of TextIterator. A whole new implementation of innerText is also OK. |