servo/tests/wpt/meta/dom/ranges
Simon Wülker 430f65584d
Don't drain ranges across shadow boundaries (#37281)
The [live range pre remove
steps](https://dom.spec.whatwg.org/#live-range-pre-remove-steps) state
that:

> For each [live range](https://dom.spec.whatwg.org/#concept-live-range)
whose [start
node](https://dom.spec.whatwg.org/#concept-range-start-node) is an
[inclusive
descendant](https://dom.spec.whatwg.org/#concept-tree-inclusive-descendant)
of node, set its
[start](https://dom.spec.whatwg.org/#concept-range-start) to (parent,
index).

Elements in a shadow tree are not inclusive descendants of their hosts -
meaning we should not bubble ranges across shadow boundaries.

Includes a small fix to `Node::ranges_is_empty` which makes servo do
less work on DOM mutations, as well as some changes to `range.rs` to
match the spec better. I made these changes during debugging and they
don't feel like they're worth their own PR.

Testing: Covered by WPT

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-06-06 07:54:02 +00:00
..
Range-cloneContents.html.ini script: LoadBlocker's drop impl shouldn't run after termination. (#36508) 2025-04-21 07:17:00 +00:00
Range-deleteContents.html.ini script: LoadBlocker's drop impl shouldn't run after termination. (#36508) 2025-04-21 07:17:00 +00:00
Range-extractContents.html.ini script: LoadBlocker's drop impl shouldn't run after termination. (#36508) 2025-04-21 07:17:00 +00:00
Range-insertNode.html.ini script: LoadBlocker's drop impl shouldn't run after termination. (#36508) 2025-04-21 07:17:00 +00:00
Range-surroundContents.html.ini script: LoadBlocker's drop impl shouldn't run after termination. (#36508) 2025-04-21 07:17:00 +00:00