mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
script: Fix resize observer depth calculation for Shadow DOM. (#36230)
Follow the specification more closely by using the flat tree when calculating depth for the resize observer. Testing: Newly passing WPT test. Fixes: #36092 Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
aca5c3b7ca
commit
7382efa209
2 changed files with 1 additions and 6 deletions
|
@ -296,7 +296,7 @@ impl ResizeObservation {
|
||||||
/// <https://drafts.csswg.org/resize-observer/#calculate-depth-for-node>
|
/// <https://drafts.csswg.org/resize-observer/#calculate-depth-for-node>
|
||||||
fn calculate_depth_for_node(target: &Element) -> ResizeObservationDepth {
|
fn calculate_depth_for_node(target: &Element) -> ResizeObservationDepth {
|
||||||
let node = target.upcast::<Node>();
|
let node = target.upcast::<Node>();
|
||||||
let depth = node.ancestors().count();
|
let depth = node.inclusive_ancestors_in_flat_tree().count() - 1;
|
||||||
ResizeObservationDepth(depth)
|
ResizeObservationDepth(depth)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[calculate-depth-for-node.html]
|
|
||||||
expected: ERROR
|
|
||||||
|
|
||||||
["Calculate depth for node" algorithm with Shadow DOM]
|
|
||||||
expected: FAIL
|
|
Loading…
Add table
Add a link
Reference in a new issue