summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/embedded-and-images-presentational-hints-ascii-case-insensitive.html
blob: 8fafb0c7f0fb5c1f0651d6e8c06b7dcc1fd7de3f (plain)
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
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="help" href="https://html.spec.whatwg.org/#attributes-for-embedded-content-and-images:presentational-hints">
<link rel="help" href="https://drafts.csswg.org/selectors-4/#attribute-case">
<meta name="assert" content="@align values on embedded content and images are ASCII case-insensitive">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<img src="fuchsia.png" align="absbottom">
<img src="fuchsia.png" align="AbSbOtToM">
<img src="fuchsia.png" align="abſbottom">
<img src="fuchsia.png" align="abscenter">
<img src="fuchsia.png" align="AbScEnTeR">
<img src="fuchsia.png" align="abſcenter">
<img src="fuchsia.png" align="absmiddle">
<img src="fuchsia.png" align="AbSmIdDlE">
<img src="fuchsia.png" align="abſmiddle">
<script>
const img = document.querySelectorAll("img");

test(() => {
  assert_equals(getComputedStyle(img[0]).getPropertyValue("vertical-align"),
    "bottom", "lowercase valid");
  assert_equals(getComputedStyle(img[1]).getPropertyValue("vertical-align"),
    "bottom", "mixed case valid");
  assert_equals(getComputedStyle(img[2]).getPropertyValue("vertical-align"),
    "baseline", "non-ASCII invalid");
}, "keyword absbottom");

test(() => {
  assert_equals(getComputedStyle(img[3]).getPropertyValue("vertical-align"),
    "middle", "lowercase valid");
  assert_equals(getComputedStyle(img[4]).getPropertyValue("vertical-align"),
    "middle", "mixed case valid");
  assert_equals(getComputedStyle(img[5]).getPropertyValue("vertical-align"),
    "baseline", "non-ASCII invalid");
}, "keyword abscenter");

test(() => {
  assert_equals(getComputedStyle(img[6]).getPropertyValue("vertical-align"),
    "middle", "lowercase valid");
  assert_equals(getComputedStyle(img[7]).getPropertyValue("vertical-align"),
    "middle", "mixed case valid");
  assert_equals(getComputedStyle(img[8]).getPropertyValue("vertical-align"),
    "baseline", "non-ASCII invalid");
}, "keyword absmiddle");
</script>