1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Cascade: rolling back the cascade with presentation hints</title>
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
<link rel="help" href="https://www.w3.org/TR/css-cascade-5/#preshint">
<link rel="help" href="https://www.w3.org/TR/css-cascade-5/#default">
<link rel="help" href="https://www.w3.org/TR/css-cascade-5/#revert-layer">
<link rel="help" href="https://html.spec.whatwg.org/multipage/embedded-content-other.html#dimension-attributes">
<meta name="assert" content="Checks that 'revert' considers presentational hints as part of the author origin,
and 'revert-layer' considers them an independent origin between the user origin and the author origin.">
<style>
@layer {
.revert-1 {
width: revert;
height: revert;
}
.revert-layer-1 {
width: revert-layer;
height: revert-layer;
}
}
.revert-2 {
width: revert;
height: revert;
}
.revert-layer-2 {
width: revert-layer;
height: revert-layer;
}
.revert-3 {
animation: revert-3 paused 2s -1s;
}
.revert-layer-3 {
animation: revert-layer-3 paused 2s -1s;
}
@keyframes revert-3 {
from, to {
width: revert;
height: revert;
}
}
@keyframes revert-layer-3 {
from, to {
width: revert-layer;
height: revert-layer;
}
}
</style>
<div id="log"></div>
<div id="tests">
<!-- 'revert' considers presentational hints as part of the author origin, so it rolls back to user origin.
The images should then get an 'auto' size, which will use the natural size of the resource. -->
<img class="revert-1" src="/css/support/60x60-green.png"
width="44" data-expected-client-width="60"
height="33" data-expected-client-height="60">
<img class="revert-2" src="/css/support/60x60-green.png"
width="44" data-expected-client-width="60"
height="33" data-expected-client-height="60">
<img class="revert-3" src="/css/support/60x60-green.png"
width="44" data-expected-client-width="60"
height="33" data-expected-client-height="60">
<img style="width: revert; height: revert" src="/css/support/60x60-green.png"
width="44" data-expected-client-width="60"
height="33" data-expected-client-height="60">
<!-- 'revert-layer' considers presentational hints as an independent origin, so it rolls back to them.
The images should then get size specified in the attributes. -->
<img class="revert-layer-1" src="/css/support/60x60-green.png"
width="44" data-expected-client-width="44"
height="33" data-expected-client-height="33">
<img class="revert-layer-2" src="/css/support/60x60-green.png"
width="44" data-expected-client-width="44"
height="33" data-expected-client-height="33">
<img class="revert-layer-3" src="/css/support/60x60-green.png"
width="44" data-expected-client-width="44"
height="33" data-expected-client-height="33">
<img style="width: revert-layer; height: revert-layer" src="/css/support/60x60-green.png"
width="44" data-expected-client-width="44"
height="33" data-expected-client-height="33">
<!-- 'revert' considers presentational hints as part of the author origin, so it rolls back to user origin.
The iframes should then get an 'auto' size, which will default to 300x150. -->
<iframe class="revert-1" src="/css/support/60x60-green.png"
width="44" data-expected-client-width="300"
height="33" data-expected-client-height="150"></iframe>
<iframe class="revert-2" src="/css/support/60x60-green.png"
width="44" data-expected-client-width="300"
height="33" data-expected-client-height="150"></iframe>
<iframe class="revert-3" src="/css/support/60x60-green.png"
width="44" data-expected-client-width="300"
height="33" data-expected-client-height="150"></iframe>
<iframe style="width: revert; height: revert" src="/css/support/60x60-green.png"
width="44" data-expected-client-width="300"
height="33" data-expected-client-height="150"></iframe>
<!-- 'revert-layer' considers presentational hints as an independent origin, so it rolls back to them.
The iframes should then get size specified in the attributes. -->
<iframe class="revert-layer-1" src="/css/support/60x60-green.png"
width="44" data-expected-client-width="44"
height="33" data-expected-client-height="33"></iframe>
<iframe class="revert-layer-2" src="/css/support/60x60-green.png"
width="44" data-expected-client-width="44"
height="33" data-expected-client-height="33"></iframe>
<iframe class="revert-layer-3" src="/css/support/60x60-green.png"
width="44" data-expected-client-width="44"
height="33" data-expected-client-height="33"></iframe>
<iframe style="width: revert-layer; height: revert-layer" src="/css/support/60x60-green.png"
width="44" data-expected-client-width="44"
height="33" data-expected-client-height="33"></iframe>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script>
addEventListener("load", function() {
checkLayout("#tests > *", false);
done();
}, {once: true});
</script>
|