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
|
<!doctype html>
<title>SVG CSS Selectors - Case-sensitivity</title>
<link rel="help" href="https://svgwg.org/svg2-draft/styling.html">
<link rel="help" href="https://drafts.csswg.org/selectors/#case-sensitive">
<link rel="help" href="https://drafts.csswg.org/selectors/#attribute-case">
<link rel="help" href="https://crbug.com/1246296">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
[viewBox] { color: green }
[VIEWBOX] { background-color: green }
foreignObject { color: green }
FOREIGNOBJECT { background-color: green }
</style>
<div viewBox id="t1"></div>
<div viewbox id="t2"></div>
<svg viewBox="0 0 800 10" id="t3"></svg>
<svg VIEWBOX="0 0 800 10" id="t4"></svg>
<foreignObject id="t5"></div>
<foreignobject id="t6"></div>
<svg><foreignObject id="t7"></foreignObject></svg>
<svg><FOREIGNOBJECT id="t8"></FOREIGNOBJECT></svg>
<script>
test(() => {
assert_equals(t1.attributes[0].name, "viewbox");
assert_equals(t2.attributes[0].name, "viewbox");
assert_equals(t3.attributes[0].name, "viewBox");
assert_equals(t4.attributes[0].name, "viewBox");
}, "Normalization of viewBox on html and svg elements in html documents.");
test(() => {
assert_equals(t5.localName, "foreignobject");
assert_equals(t6.localName, "foreignobject");
assert_equals(t7.localName, "foreignObject");
assert_equals(t8.localName, "foreignObject");
}, "Normalization of foreignObject html and svg elements in html documents.");
test(() => {
assert_equals(getComputedStyle(t1).color, "rgb(0, 128, 0)");
assert_equals(getComputedStyle(t1).backgroundColor, "rgb(0, 128, 0)");
assert_equals(getComputedStyle(t2).color, "rgb(0, 128, 0)");
assert_equals(getComputedStyle(t2).backgroundColor, "rgb(0, 128, 0)");
}, "viewBox attribute without namespace on html element matches case-insensitively in html document.");
test(() => {
assert_equals(getComputedStyle(t3).color, "rgb(0, 128, 0)");
assert_equals(getComputedStyle(t3).backgroundColor, "rgba(0, 0, 0, 0)");
}, "Camel-cased viewBox on svg in html document matches sensitively.");
test(() => {
assert_equals(getComputedStyle(t4).color, "rgb(0, 128, 0)");
assert_equals(getComputedStyle(t4).backgroundColor, "rgba(0, 0, 0, 0)");
}, "Normalized camel-cased viewBox on svg in html document matches case-sensitively.");
test(() => {
assert_equals(getComputedStyle(t5).color, "rgb(0, 128, 0)");
assert_equals(getComputedStyle(t5).backgroundColor, "rgb(0, 128, 0)");
assert_equals(getComputedStyle(t6).color, "rgb(0, 128, 0)");
assert_equals(getComputedStyle(t6).backgroundColor, "rgb(0, 128, 0)");
}, "foreignObject html element matches case-insensitively in html document.");
test(() => {
assert_equals(getComputedStyle(t7).color, "rgb(0, 128, 0)");
assert_equals(getComputedStyle(t7).backgroundColor, "rgba(0, 0, 0, 0)");
}, "Camel-cased svg foreignObject in html document matches sensitively.");
test(() => {
assert_equals(getComputedStyle(t8).color, "rgb(0, 128, 0)");
assert_equals(getComputedStyle(t8).backgroundColor, "rgba(0, 0, 0, 0)");
}, "Normalized camel-cased svg foreignObject in html document matches case-sensitively.");
</script>
|