Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 0978f82

Browse files
committed
Bug 1891302 - Fix container-progress-computed.tentative.html to not include viewport sizes in assertion names. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D207362
1 parent 821cf61 commit 0978f82

File tree

2 files changed

+14
-48
lines changed

2 files changed

+14
-48
lines changed

testing/web-platform/meta/css/css-values/container-progress-computed.tentative.html.ini

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@
2626
[calc(container-progress(height of my-container from 10px to sign(50px - 500em) * 10px)) should be used-value-equivalent to -10.9]
2727
expected: FAIL
2828

29-
[container-progress(width of non-existing-container from 0px to 1px) should be used-value-equivalent to 1280]
29+
[container-progress() width fallback for non-existing container name]
3030
expected: FAIL
3131

32-
[container-progress(height of non-existing-container from 0px to 1px) should be used-value-equivalent to 891]
32+
[container-progress() height fallback for non-existing container names]
3333
expected: FAIL
3434

35-
[container-progress(width of out-of-scope-container from 0px to 1px) should be used-value-equivalent to 1280]
35+
[container-progress() width fallback for out of scope container]
3636
expected: FAIL
3737

38-
[container-progress(height of out-of-scope-container from 0px to 1px) should be used-value-equivalent to 891]
38+
[container-progress() height fallback for out of scope container]
3939
expected: FAIL
4040

4141
[calc(container-progress(width from 0px to 1px) * 1px) should be used-value-equivalent to 228px]
@@ -46,41 +46,3 @@
4646

4747
[calc(container-progress(width of my-container-2 from 0px to 1px) * 1deg) should be used-value-equivalent to 5051deg]
4848
expected: FAIL
49-
50-
[container-progress(width of non-existing-container from 0px to 1px) should be used-value-equivalent to 800]
51-
expected: FAIL
52-
53-
[container-progress(height of non-existing-container from 0px to 1px) should be used-value-equivalent to 1136]
54-
expected: FAIL
55-
56-
[container-progress(width of out-of-scope-container from 0px to 1px) should be used-value-equivalent to 800]
57-
expected: FAIL
58-
59-
[container-progress(height of out-of-scope-container from 0px to 1px) should be used-value-equivalent to 1136]
60-
expected: FAIL
61-
62-
[container-progress(height of non-existing-container from 0px to 1px) should be used-value-equivalent to 955]
63-
expected: FAIL
64-
65-
[container-progress(height of out-of-scope-container from 0px to 1px) should be used-value-equivalent to 955]
66-
expected: FAIL
67-
68-
[container-progress(height of non-existing-container from 0px to 1px) should be used-value-equivalent to 865]
69-
expected: FAIL
70-
71-
[container-progress(height of out-of-scope-container from 0px to 1px) should be used-value-equivalent to 865]
72-
expected: FAIL
73-
74-
[container-progress(height of non-existing-container from 0px to 1px) should be used-value-equivalent to 866]
75-
expected:
76-
if (os == "mac") and release_or_beta: FAIL
77-
78-
[container-progress(height of out-of-scope-container from 0px to 1px) should be used-value-equivalent to 866]
79-
expected:
80-
if (os == "mac") and release_or_beta: FAIL
81-
82-
[container-progress(height of out-of-scope-container from 0px to 1px) should be used-value-equivalent to 954]
83-
expected: FAIL
84-
85-
[container-progress(height of non-existing-container from 0px to 1px) should be used-value-equivalent to 954]
86-
expected: FAIL

testing/web-platform/tests/css/css-values/container-progress-computed.tentative.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<!DOCTYPE html>
2+
<meta name="viewport" content="width=device-width, initial-scale=1">
23
<link rel="help" href="https://drafts.csswg.org/css-values-5/#container-progress-func">
34
<link rel="author" title="[email protected]">
45
<script src="/resources/testharness.js"></script>
@@ -15,6 +16,8 @@
1516
<style>
1617
:root {
1718
font-size: 10px;
19+
width: 100vw;
20+
height: 100vh;
1821
}
1922
#out-of-scope-container {
2023
container: my-container-3 / size;
@@ -42,8 +45,9 @@
4245
</style>
4346
<script>
4447

45-
let width = window.innerWidth;
46-
let height = window.innerHeight;
48+
// innerWidth and innerHeight have lossy precision, see
49+
// https://github.com/w3c/csswg-drafts/issues/5260.
50+
let { width, height } = document.documentElement.getBoundingClientRect();
4751

4852
let extraWidth = 5051;
4953
let extraHeight = 1337;
@@ -68,10 +72,10 @@
6872
test_math_used('calc(container-progress(height of my-container from 10px to sign(50px - 500em) * 10px))', (outerHeight - 10) / (-10 - 10), {type:'number'});
6973

7074
// Fallback
71-
test_math_used('container-progress(width of non-existing-container from 0px to 1px)', width, {type:'number'});
72-
test_math_used('container-progress(height of non-existing-container from 0px to 1px)', height, {type:'number'});
73-
test_math_used('container-progress(width of out-of-scope-container from 0px to 1px)', width, {type:'number'});
74-
test_math_used('container-progress(height of out-of-scope-container from 0px to 1px)', height, {type:'number'});
75+
test_math_used('container-progress(width of non-existing-container from 0px to 1px)', width, {type:'number', msg: 'container-progress() width fallback for non-existing container name'});
76+
test_math_used('container-progress(height of non-existing-container from 0px to 1px)', height, {type:'number', msg: 'container-progress() height fallback for non-existing container names'});
77+
test_math_used('container-progress(width of out-of-scope-container from 0px to 1px)', width, {type:'number', msg: 'container-progress() width fallback for out of scope container'});
78+
test_math_used('container-progress(height of out-of-scope-container from 0px to 1px)', height, {type:'number', msg: 'container-progress() height fallback for out of scope container'});
7579

7680
// Type checking
7781
test_math_used('calc(container-progress(width from 0px to 1px) * 1px)', innerWidth + 'px');

0 commit comments

Comments
 (0)