OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 [viewBox] { color: green } |
| 6 [VIEWBOX] { background-color: green } |
| 7 </style> |
| 8 <div viewBox id="t1"></div> |
| 9 <div viewbox id="t2"></div> |
| 10 <svg viewBox="0 0 800 10" id="t3"></svg> |
| 11 <svg VIEWBOX="0 0 800 10" id="t4"></svg> |
| 12 <script> |
| 13 test(() => { |
| 14 assert_equals(t1.attributes[0].name, "viewbox"); |
| 15 assert_equals(t2.attributes[0].name, "viewbox"); |
| 16 assert_equals(t3.attributes[0].name, "viewBox"); |
| 17 assert_equals(t4.attributes[0].name, "viewBox"); |
| 18 }, "Normalization of viewBox on html and svg elements in html documents."); |
| 19 |
| 20 test(() => { |
| 21 assert_equals(getComputedStyle(t1).color, "rgb(0, 128, 0)"); |
| 22 assert_equals(getComputedStyle(t1).backgroundColor, "rgb(0, 128, 0)"); |
| 23 assert_equals(getComputedStyle(t2).color, "rgb(0, 128, 0)"); |
| 24 assert_equals(getComputedStyle(t2).backgroundColor, "rgb(0, 128, 0)"); |
| 25 }, "viewBox attribute without namespace on html element matches case-insensi
tively in html document."); |
| 26 |
| 27 test(() => { |
| 28 assert_equals(getComputedStyle(t3).color, "rgb(0, 128, 0)"); |
| 29 }, "Camel-cased viewBox on svg in html document matches sensitively."); |
| 30 |
| 31 test(() => { |
| 32 assert_equals(getComputedStyle(t3).backgroundColor, "rgb(0, 128, 0)"); |
| 33 }, "Camel-cased viewBox on svg in html document should match case-sensitivel
y. Intentional deviation from the spec."); |
| 34 |
| 35 test(() => { |
| 36 assert_equals(getComputedStyle(t4).color, "rgb(0, 128, 0)", "Attribute i
s normalized to camelCase."); |
| 37 }, "Normalized camel-cased viewBox on svg in html document matches case-sens
itively."); |
| 38 |
| 39 test(() => { |
| 40 assert_equals(getComputedStyle(t4).backgroundColor, "rgb(0, 128, 0)", "A
ttribute is normalized to camelCase."); |
| 41 }, "Normalized camel-cased viewBox on svg in html document should match case
-sensitively. Intentional deviation from the spec."); |
| 42 </script> |
OLD | NEW |