mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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>
This commit is contained in:
parent
836316c844
commit
430f65584d
3 changed files with 80 additions and 55 deletions
|
@ -1,14 +0,0 @@
|
|||
[Range-in-shadow-after-the-shadow-removed.html?mode=closed]
|
||||
[Range in shadow should stay in the shadow after the host is removed]
|
||||
expected: FAIL
|
||||
|
||||
[Range in shadow should stay in the shadow after the host parent is removed]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[Range-in-shadow-after-the-shadow-removed.html?mode=open]
|
||||
[Range in shadow should stay in the shadow after the host is removed]
|
||||
expected: FAIL
|
||||
|
||||
[Range in shadow should stay in the shadow after the host parent is removed]
|
||||
expected: FAIL
|
Loading…
Add table
Add a link
Reference in a new issue