Skip to content

Commit 580c9e7

Browse files
authored
script: Include target in resize observer depth calculation. (servo#40116)
The spec wants the path from the target to the root inclusive, not exclusive like the current calculation. Testing: Enables a test to run to completion. Fixes: servo#40111 Signed-off-by: Josh Matthews <[email protected]>
1 parent 0e297de commit 580c9e7

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

components/script/dom/resizeobserver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ impl ResizeObservation {
327327
/// <https://drafts.csswg.org/resize-observer/#calculate-depth-for-node>
328328
fn calculate_depth_for_node(target: &Element) -> ResizeObservationDepth {
329329
let node = target.upcast::<Node>();
330-
let depth = node.inclusive_ancestors_in_flat_tree().count() - 1;
330+
let depth = node.inclusive_ancestors_in_flat_tree().count();
331331
ResizeObservationDepth(depth)
332332
}
333333

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
[notify.html]
22
expected: ERROR
3-
[guard]
4-
expected: NOTRUN
3+
[test3: dimensions match]
4+
expected: FAIL
5+
6+
[test4: transform do not cause notifications]
7+
expected: FAIL
8+
9+
[test6: inline element notifies once with 0x0.]
10+
expected: FAIL
11+
12+
[test11: display:none element should be notified]
13+
expected: FAIL
514

6-
[test2: remove/appendChild trigger notification]
15+
[test12: element sized 0x0 should be notified]
716
expected: FAIL

0 commit comments

Comments
 (0)