Skip to content

Commit 857a19c

Browse files
authored
Use valid pseudo-element syntax in pseudo-get-computed-style.html (web-platform-tests#44643)
WebKit will reject the single colon syntax in `getComputedStyle()` because it is invalid.
1 parent 4926f1d commit 857a19c

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed

css/css-view-transitions/pseudo-get-computed-style.html

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<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/">
55
<link rel="author" href="mailto:[email protected]">
66

77
<script src="/resources/testharness.js"></script>
@@ -30,34 +30,34 @@
3030
assert_implements(document.startViewTransition, "Missing document.startViewTransition");
3131
return new Promise(async (resolve, reject) => {
3232
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)");
3939

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)");
4141

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)");
4646

4747
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)");
6161
});
6262
});
6363
await transition.finished;
@@ -69,42 +69,42 @@
6969
assert_implements(document.startViewTransition, "Missing document.startViewTransition");
7070
return new Promise(async (resolve, reject) => {
7171
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");
7575

76-
assert_equals(getComputedStyle(document.documentElement, ":view-transition-old(target)").position, "absolute");
76+
assert_equals(getComputedStyle(document.documentElement, "::view-transition-old(target)").position, "absolute");
7777

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");
8181

8282
target.remove();
8383
});
8484

8585
await transition.ready;
8686

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");
9393

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");
9696

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");
101101

102-
assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").position, "absolute");
102+
assert_equals(getComputedStyle(document.documentElement, "::view-transition-group(target)").position, "absolute");
103103

104104
await transition.finished;
105105

106106
// 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");
108108

109109
resolve();
110110
});

0 commit comments

Comments
 (0)