summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/svg/styling/required-properties.svg
blob: 37bf0fdf7e8ead12ab5b686b56844c82625e6591 (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
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
     xmlns:h="http://www.w3.org/1999/xhtml">
  <metadata>
    <h:link rel="help" href="https://svgwg.org/svg2-draft/styling.html#RequiredProperties"/>
    <h:link rel="help" href="https://svgwg.org/svg2-draft/propidx.html"/>
    <h:meta name="assert" content="All required properties are supported"/>
    <!-- Note: This test does not verify that the properties are actually applied to SVG rendering. -->
  </metadata>
  <g id="target"></g>
  <h:script src="/resources/testharness.js"/>
  <h:script src="/resources/testharnessreport.js"/>
  <script><![CDATA[
  var properties = [
    // Properties listed in https://svgwg.org/svg2-draft/propidx.html
    "alignment-baseline",
    "baseline-shift",
    "clip",
    "clip-path",
    "clip-rule",
    "color",
    "color-interpolation",
    "cursor",
    "direction",
    "display",
    "dominant-baseline",
    "fill",
    "fill-opacity",
    "fill-rule",
    "filter",
    "flood-color",
    "flood-opacity",
    "font",
    "font-family",
    "font-size",
    "font-size-adjust",
    "font-stretch",
    "font-style",
    "font-variant",
    "font-weight",
    "glyph-orientation-vertical",
    "image-rendering",
    "letter-spacing",
    "lighting-color",
    "line-height",
    "marker",
    "marker-end",
    "marker-mid",
    "marker-start",
    "mask",
    "opacity",
    "overflow",
    "paint-order",
    "pointer-events",
    "shape-rendering",
    "stop-color",
    "stop-opacity",
    "stroke",
    "stroke-dasharray",
    "stroke-dashoffset",
    "stroke-linecap",
    "stroke-linejoin",
    "stroke-miterlimit",
    "stroke-opacity",
    "stroke-width",
    "text-anchor",
    "text-decoration",
    "text-rendering",
    "unicode-bidi",
    "vector-effect",
    "visibility",
    "word-spacing",
    "white-space",
    "writing-mode",

    // Properties listed in https://svgwg.org/svg2-draft/styling.html#RequiredProperties
    "display",
    "overflow",
    "visibility",
    "cursor",
    "text-overflow",
    "clip",
    "clip-path",
    "clip-rule",
    "mask",
    "color",
    "opacity",
    "color-interpolation-filters",
    "filter",
    "flood-color",
    "flood-opacity",
    "isolation",
    "lighting-color",
    "transform",
    "transform-box",
    "transform-origin",
    "letter-spacing",
    "text-align",
    "text-align-all",
    "text-align-last",
    "text-indent",
    "word-spacing",
    "white-space",
    "text-space-collapse",
    "vertical-align",
    "dominant-baseline",
    "alignment-baseline",
    "baseline-shift",
    "direction",
    "text-orientation",
    "writing-mode",
    "font",
    "font-family",
    "font-feature-settings",
    "font-kerning",
    "font-size",
    "font-size-adjust",
    "font-stretch",
    "font-style",
    "font-variant",
    "font-variant-position",
    "font-variant-ligatures",
    "font-variant-caps",
    "font-variant-numeric",
    "font-variant-east-asian",
    "font-weight",
    "text-decoration",
    "text-decoration-line",
    "text-decoration-style",
    "text-decoration-color"
  ];
  properties.sort();

  var target = document.getElementById('target');
  var previous = null;
  for (var property of properties) {
    if (property === previous)
      continue; // Avoid duplicate test names
    previous = property;

    test(function() {
      assert_true(property in target.style);
    }, 'Property "' + property + '" is supported');
  }
  ]]></script>
</svg>