|
1 | 1 | <!DOCTYPE html>
|
2 | 2 | <html>
|
3 |
| -<title>View transitions: check pseudo element's display property</title> |
4 |
| -<link rel="help" href="https://github.com/WICG/view-transitions"> |
| 3 | +<title>View transitions: check pseudo element's default styles</title> |
| 4 | +<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/"> |
5 | 5 | <link rel=" author" href=" mailto:[email protected]" >
|
6 | 6 |
|
7 | 7 | <script src="/resources/testharness.js"></script>
|
|
30 | 30 | assert_implements(document.startViewTransition, "Missing document.startViewTransition");
|
31 | 31 | return new Promise(async (resolve, reject) => {
|
32 | 32 | let transition = document.startViewTransition(() => {
|
33 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition").position, "fixed", ":view-transition"); |
34 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").position, "absolute", "container(target)"); |
35 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").mixBlendMode, "multiply", "container(target)"); |
36 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").textOrientation, "upright", "container(target)"); |
37 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").colorScheme, "dark light", "container(target)"); |
38 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-image-pair(target)").position, "absolute", "wrapper(target)"); |
| 33 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition").position, "fixed", "::view-transition"); |
| 34 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").position, "absolute", "container(target)"); |
| 35 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").mixBlendMode, "multiply", "container(target)"); |
| 36 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").textOrientation, "upright", "container(target)"); |
| 37 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").colorScheme, "dark light", "container(target)"); |
| 38 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-image-pair(target)").position, "absolute", "wrapper(target)"); |
39 | 39 |
|
40 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-old(target)").position, "absolute", "outgoing(target)"); |
| 40 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-old(target)").position, "absolute", "outgoing(target)"); |
41 | 41 |
|
42 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(root)").position, "absolute", "container(root)"); |
43 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(root)").mixBlendMode, "normal", "container(root)"); |
44 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-image-pair(root)").position, "absolute", "wrapper(root)"); |
45 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-old(root)").position, "absolute", "outgoing(root)"); |
| 42 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(root)").position, "absolute", "container(root)"); |
| 43 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(root)").mixBlendMode, "normal", "container(root)"); |
| 44 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-image-pair(root)").position, "absolute", "wrapper(root)"); |
| 45 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-old(root)").position, "absolute", "outgoing(root)"); |
46 | 46 |
|
47 | 47 | requestAnimationFrame(() => {
|
48 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition").position, "fixed", "raf :view-transition"); |
49 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").position, "absolute", "raf container(target)"); |
50 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").mixBlendMode, "multiply", "raf container(target)"); |
51 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").textOrientation, "upright", "raf container(target)"); |
52 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").colorScheme, "dark light", "raf container(target)"); |
53 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-image-pair(target)").position, "fixed", "raf wrapper(target)"); |
54 |
| - |
55 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-old(target)").position, "absolute", "raf outgoing(target)"); |
56 |
| - |
57 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(root)").position, "absolute", "raf container(root)"); |
58 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(root)").mixBlendMode, "normal", "raf container(root)"); |
59 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-image-pair(root)").position, "absolute", "raf wrapper(root)"); |
60 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-old(root)").position, "absolute", "raf outgoing(root)"); |
| 48 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition").position, "fixed", "raf ::view-transition"); |
| 49 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").position, "absolute", "raf container(target)"); |
| 50 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").mixBlendMode, "multiply", "raf container(target)"); |
| 51 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").textOrientation, "upright", "raf container(target)"); |
| 52 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").colorScheme, "dark light", "raf container(target)"); |
| 53 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-image-pair(target)").position, "fixed", "raf wrapper(target)"); |
| 54 | + |
| 55 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-old(target)").position, "absolute", "raf outgoing(target)"); |
| 56 | + |
| 57 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(root)").position, "absolute", "raf container(root)"); |
| 58 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(root)").mixBlendMode, "normal", "raf container(root)"); |
| 59 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-image-pair(root)").position, "absolute", "raf wrapper(root)"); |
| 60 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-old(root)").position, "absolute", "raf outgoing(root)"); |
61 | 61 | });
|
62 | 62 | });
|
63 | 63 | await transition.finished;
|
|
69 | 69 | assert_implements(document.startViewTransition, "Missing document.startViewTransition");
|
70 | 70 | return new Promise(async (resolve, reject) => {
|
71 | 71 | let transition = document.startViewTransition(() => {
|
72 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition").position, "fixed"); |
73 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").position, "absolute"); |
74 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-image-pair(target)").position, "absolute"); |
| 72 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition").position, "fixed"); |
| 73 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").position, "absolute"); |
| 74 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-image-pair(target)").position, "absolute"); |
75 | 75 |
|
76 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-old(target)").position, "absolute"); |
| 76 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-old(target)").position, "absolute"); |
77 | 77 |
|
78 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(root)").position, "absolute"); |
79 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-image-pair(root)").position, "absolute"); |
80 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-old(root)").position, "absolute"); |
| 78 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(root)").position, "absolute"); |
| 79 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-image-pair(root)").position, "absolute"); |
| 80 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-old(root)").position, "absolute"); |
81 | 81 |
|
82 | 82 | target.remove();
|
83 | 83 | });
|
84 | 84 |
|
85 | 85 | await transition.ready;
|
86 | 86 |
|
87 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition").position, "fixed"); |
88 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").position, "absolute"); |
89 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").mixBlendMode, "multiply"); |
90 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").textOrientation, "upright"); |
91 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").colorScheme, "dark light"); |
92 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-image-pair(target)").position, "fixed"); |
| 87 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition").position, "fixed"); |
| 88 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").position, "absolute"); |
| 89 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").mixBlendMode, "multiply"); |
| 90 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").textOrientation, "upright"); |
| 91 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").colorScheme, "dark light"); |
| 92 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-image-pair(target)").position, "fixed"); |
93 | 93 |
|
94 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-old(target)").position, "absolute"); |
95 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-new(target)").position, "absolute"); |
| 94 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-old(target)").position, "absolute"); |
| 95 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-new(target)").position, "absolute"); |
96 | 96 |
|
97 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(root)").position, "absolute"); |
98 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-image-pair(root)").position, "absolute"); |
99 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-old(root)").position, "absolute"); |
100 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-new(root)").position, "absolute"); |
| 97 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(root)").position, "absolute"); |
| 98 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-image-pair(root)").position, "absolute"); |
| 99 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-old(root)").position, "absolute"); |
| 100 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-new(root)").position, "absolute"); |
101 | 101 |
|
102 |
| - assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").position, "absolute"); |
| 102 | + assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").position, "absolute"); |
103 | 103 |
|
104 | 104 | await transition.finished;
|
105 | 105 |
|
106 | 106 | // With custom ua sheets not applying to non-existing pseudo, the value should be the default (not absolute)
|
107 |
| - assert_not_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").position, "absolute"); |
| 107 | + assert_not_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").position, "absolute"); |
108 | 108 |
|
109 | 109 | resolve();
|
110 | 110 | });
|
|
0 commit comments