Repository navigation
Conversation
A closed <details> renders only its first <summary> child. The default stylesheet hides the element children with `display:none`, but a bare text node has no box of its own: it inherits visibility from <details>, so collect_children emitted it and innerText read "sum\nCLOSEDDETAILS" where Chrome reads "sum". Skip every child after the first <summary> when <details> lacks the open attribute. Covers text before the summary, a second <summary>, and the ancestor case where <details> sits inside the queried element. Signed-off-by: Jackzigen <jackzigen@users.noreply.github.com>
|
Hi @Jackzigen. Thanks for your interest in Kitesurf! Your pull request is open, but your GitHub username is not on the vouched An unvouched pull request is closed after 14 days of inactivity. To become vouched, discuss the bug, use case, or proposed fix in a |
Fixes the closed
<details>half of #262.What
innerTexton a closed<details>leaked its bare-text body:read
"sum\nCLOSEDDETAILS"where Chrome reads"sum". The<p>-body shape in the issue was already correct.Why
A closed
<details>renders only its first<summary>child. The default stylesheet hides the element children throughwhich matches element children only. A bare text node has no box of its own —
collect_childrenemits it whenever the inheritedctx.visibleis true, and it inherits visibility from<details>itself.Fix
In
collect_children, when the node is a<details>without theopenattribute, skip every child except the first<summary>. This covers:<summary><details>sits inside the queried elementopendetails are untouched.Verification
cargo test --lib inner_text— 17 passed (3 new)cargo test --lib(fullkitesurf-corehost suite) — 1093 passed, 0 failedcargo fmt --checkclean;cargo clippy --libreports nothing oninner_text.rsNot addressed here: the
content-visibility: hiddenhalf of #262. That depends on whether the stylo gate should be lifted, which is a separate decision.