| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library SvgElementTest; | 5 library SvgElementTest; |
| 6 import '../../pkg/unittest/lib/unittest.dart'; | 6 import '../../pkg/unittest/lib/unittest.dart'; |
| 7 import '../../pkg/unittest/lib/html_individual_config.dart'; | 7 import '../../pkg/unittest/lib/html_individual_config.dart'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'dart:svg' as svg; | 9 import 'dart:svg' as svg; |
| 10 | 10 |
| 11 main() { | 11 main() { |
| 12 useHtmlIndividualConfiguration(); | 12 useHtmlIndividualConfiguration(); |
| 13 | 13 |
| 14 var isSvgSvgElement = | 14 var isSvgSvgElement = |
| 15 predicate((x) => x is svg.SvgSvgElement, 'is a SvgSvgElement'); | 15 predicate((x) => x is svg.SvgSvgElement, 'is a SvgSvgElement'); |
| 16 | 16 |
| 17 Collection<String> _nodeStrings(Collection<Node> input) { | 17 Collection<String> _nodeStrings(Collection<Node> input) { |
| 18 final out = new List<String>(); | 18 final out = new List<String>(); |
| 19 for (Node n in input) { | 19 for (Node n in input) { |
| 20 if (n is Element) { | 20 if (n is Element) { |
| 21 Element e = n; | 21 Element e = n; |
| 22 out.add(e.tagName); | 22 out.add(e.tagName); |
| 23 } else { | 23 } else { |
| 24 out.add(n.text); | 24 out.add(n.text); |
| 25 } | 25 } |
| 26 } | 26 } |
| 27 return out; | 27 return out; |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 testConstructor(String tagName, Function isExpectedClass, | 30 testConstructor(String tagName, Function isExpectedClass) { |
| 31 [bool expectation = true]) { | |
| 32 test(tagName, () { | 31 test(tagName, () { |
| 33 expect(isExpectedClass(new svg.SvgElement.tag(tagName)), expectation); | 32 expect(isExpectedClass(new svg.SvgElement.tag(tagName)), isTrue); |
| 34 expect(isExpectedClass( | 33 expect(isExpectedClass( |
| 35 new svg.SvgElement.svg('<$tagName></$tagName>')), expectation); | 34 new svg.SvgElement.svg('<$tagName></$tagName>')), isTrue); |
| 36 }); | 35 }); |
| 37 } | 36 } |
| 38 group('additionalConstructors', () { | 37 group('additionalConstructors', () { |
| 39 test('valid', () { | 38 group('svg', () { |
| 40 final svgContent = """ | 39 test('valid', () { |
| 40 final svgContent = """ |
| 41 <svg version="1.1"> | 41 <svg version="1.1"> |
| 42 <circle></circle> | 42 <circle></circle> |
| 43 <path></path> | 43 <path></path> |
| 44 </svg>"""; | 44 </svg>"""; |
| 45 final el = new svg.SvgElement.svg(svgContent); | 45 final el = new svg.SvgElement.svg(svgContent); |
| 46 expect(el, isSvgSvgElement); | 46 expect(el, isSvgSvgElement); |
| 47 expect(el.innerHtml, anyOf("<circle></circle><path></path>", '<circle ' | 47 expect(el.innerHtml, "<circle></circle><path></path>"); |
| 48 'xmlns="http://www.w3.org/2000/svg" /><path ' | 48 expect(el.outerHtml, svgContent); |
| 49 'xmlns="http://www.w3.org/2000/svg" />')); | 49 }); |
| 50 expect(el.outerHtml, anyOf(svgContent, | 50 |
| 51 '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">\n ' | 51 test('has no parent', () => |
| 52 '<circle />\n <path />\n</svg>')); | 52 expect(new svg.SvgElement.svg('<circle/>').parent, isNull) |
| 53 ); |
| 54 |
| 55 test('empty', () { |
| 56 expect(() => new svg.SvgElement.svg(""), throwsArgumentError); |
| 57 }); |
| 58 |
| 59 test('too many elements', () { |
| 60 expect(() => new svg.SvgElement.svg("<circle></circle><path></path>"), |
| 61 throwsArgumentError); |
| 62 }); |
| 53 }); | 63 }); |
| 54 | 64 testConstructor('altGlyphDef', (e) => e is svg.AltGlyphDefElement); |
| 55 test('has no parent', () => | 65 testConstructor('altGlyph', (e) => e is svg.AltGlyphElement); |
| 56 expect(new svg.SvgElement.svg('<circle/>').parent, isNull) | 66 testConstructor('animateColor', (e) => e is svg.AnimateColorElement); |
| 57 ); | 67 testConstructor('animate', (e) => e is svg.AnimateElement); |
| 58 | 68 // WebKit doesn't recognize animateMotion |
| 59 test('empty', () { | 69 // testConstructor('animateMotion', (e) => e is svg.AnimateMotionElement); |
| 60 expect(() => new svg.SvgElement.svg(""), throwsArgumentError); | 70 testConstructor('animateTransform', (e) => e is svg.AnimateTransformElement)
; |
| 61 }); | 71 testConstructor('cursor', (e) => e is svg.CursorElement); |
| 62 | 72 testConstructor('feBlend', (e) => e is svg.FEBlendElement); |
| 63 test('too many elements', () { | 73 testConstructor('feColorMatrix', (e) => e is svg.FEColorMatrixElement); |
| 64 expect(() => new svg.SvgElement.svg("<circle></circle><path></path>"), | 74 testConstructor('feComponentTransfer', |
| 65 throwsArgumentError); | 75 (e) => e is svg.FEComponentTransferElement); |
| 66 }); | 76 testConstructor('feConvolveMatrix', (e) => e is svg.FEConvolveMatrixElement)
; |
| 67 }); | 77 testConstructor('feDiffuseLighting', |
| 68 | 78 (e) => e is svg.FEDiffuseLightingElement); |
| 69 // Unfortunately, because the filtering mechanism in unitttest is a regex done | 79 testConstructor('feDisplacementMap', |
| 70 group('supported_altGlyph', () { | 80 (e) => e is svg.FEDisplacementMapElement); |
| 71 test('supported', () { | 81 testConstructor('feDistantLight', (e) => e is svg.FEDistantLightElement); |
| 72 expect(svg.AltGlyphElement.supported, true); | 82 testConstructor('feDropShadow', (e) => e is svg.FEDropShadowElement); |
| 73 }); | 83 testConstructor('feFlood', (e) => e is svg.FEFloodElement); |
| 74 }); | 84 testConstructor('feFuncA', (e) => e is svg.FEFuncAElement); |
| 75 | 85 testConstructor('feFuncB', (e) => e is svg.FEFuncBElement); |
| 76 group('supported_animate', () { | 86 testConstructor('feFuncG', (e) => e is svg.FEFuncGElement); |
| 77 test('supported', () { | 87 testConstructor('feFuncR', (e) => e is svg.FEFuncRElement); |
| 78 expect(svg.AnimateElement.supported, true); | 88 testConstructor('feGaussianBlur', (e) => e is svg.FEGaussianBlurElement); |
| 79 }); | 89 testConstructor('feImage', (e) => e is svg.FEImageElement); |
| 80 }); | 90 testConstructor('feMerge', (e) => e is svg.FEMergeElement); |
| 81 | 91 testConstructor('feMergeNode', (e) => e is svg.FEMergeNodeElement); |
| 82 group('supported_animateMotion', () { | 92 testConstructor('feOffset', (e) => e is svg.FEOffsetElement); |
| 83 test('supported', () { | 93 testConstructor('fePointLight', (e) => e is svg.FEPointLightElement); |
| 84 expect(svg.AnimateMotionElement.supported, true); | 94 testConstructor('feSpecularLighting', |
| 85 }); | 95 (e) => e is svg.FESpecularLightingElement); |
| 86 }); | 96 testConstructor('feSpotLight', (e) => e is svg.FESpotLightElement); |
| 87 | 97 testConstructor('feTile', (e) => e is svg.FETileElement); |
| 88 group('supported_animateTransform', () { | 98 testConstructor('feTurbulence', (e) => e is svg.FETurbulenceElement); |
| 89 test('supported', () { | 99 testConstructor('filter', (e) => e is svg.FilterElement); |
| 90 expect(svg.AnimateTransformElement.supported, true); | 100 testConstructor('font', (e) => e is svg.FontElement); |
| 91 }); | 101 testConstructor('font-face', (e) => e is svg.FontFaceElement); |
| 92 }); | 102 testConstructor('font-face-format', (e) => e is svg.FontFaceFormatElement); |
| 93 | 103 testConstructor('font-face-name', (e) => e is svg.FontFaceNameElement); |
| 94 group('supported_feBlend', () { | 104 testConstructor('font-face-src', (e) => e is svg.FontFaceSrcElement); |
| 95 test('supported', () { | 105 testConstructor('font-face-uri', (e) => e is svg.FontFaceUriElement); |
| 96 expect(svg.FEBlendElement.supported, true); | 106 testConstructor('foreignObject', (e) => e is svg.ForeignObjectElement); |
| 97 }); | 107 testConstructor('glyph', (e) => e is svg.GlyphElement); |
| 98 }); | 108 testConstructor('glyphRef', (e) => e is svg.GlyphRefElement); |
| 99 | 109 testConstructor('metadata', (e) => e is svg.MetadataElement); |
| 100 group('supported_feColorMatrix', () { | 110 testConstructor('missing-glyph', (e) => e is svg.MissingGlyphElement); |
| 101 test('supported', () { | 111 testConstructor('set', (e) => e is svg.SetElement); |
| 102 expect(svg.FEColorMatrixElement.supported, true); | 112 testConstructor('tref', (e) => e is svg.TRefElement); |
| 103 }); | 113 testConstructor('vkern', (e) => e is svg.VKernElement); |
| 104 }); | |
| 105 | |
| 106 group('supported_feComponentTransfer', () { | |
| 107 test('supported', () { | |
| 108 expect(svg.FEComponentTransferElement.supported, true); | |
| 109 }); | |
| 110 }); | |
| 111 | |
| 112 group('supported_feConvolveMatrix', () { | |
| 113 test('supported', () { | |
| 114 expect(svg.FEConvolveMatrixElement.supported, true); | |
| 115 }); | |
| 116 }); | |
| 117 | |
| 118 group('supported_feDiffuseLighting', () { | |
| 119 test('supported', () { | |
| 120 expect(svg.FEDiffuseLightingElement.supported, true); | |
| 121 }); | |
| 122 }); | |
| 123 | |
| 124 group('supported_feDisplacementMap', () { | |
| 125 test('supported', () { | |
| 126 expect(svg.FEDisplacementMapElement.supported, true); | |
| 127 }); | |
| 128 }); | |
| 129 | |
| 130 group('supported_feDistantLight', () { | |
| 131 test('supported', () { | |
| 132 expect(svg.FEDistantLightElement.supported, true); | |
| 133 }); | |
| 134 }); | |
| 135 | |
| 136 group('supported_feFlood', () { | |
| 137 test('supported', () { | |
| 138 expect(svg.FEFloodElement.supported, true); | |
| 139 }); | |
| 140 }); | |
| 141 | |
| 142 group('supported_feFuncA', () { | |
| 143 test('supported', () { | |
| 144 expect(svg.FEFuncAElement.supported, true); | |
| 145 }); | |
| 146 }); | |
| 147 | |
| 148 group('supported_feFuncB', () { | |
| 149 test('supported', () { | |
| 150 expect(svg.FEFuncBElement.supported, true); | |
| 151 }); | |
| 152 }); | |
| 153 | |
| 154 group('supported_feFuncG', () { | |
| 155 test('supported', () { | |
| 156 expect(svg.FEFuncGElement.supported, true); | |
| 157 }); | |
| 158 }); | |
| 159 | |
| 160 group('supported_feFuncR', () { | |
| 161 test('supported', () { | |
| 162 expect(svg.FEFuncRElement.supported, true); | |
| 163 }); | |
| 164 }); | |
| 165 | |
| 166 group('supported_feGaussianBlur', () { | |
| 167 test('supported', () { | |
| 168 expect(svg.FEGaussianBlurElement.supported, true); | |
| 169 }); | |
| 170 }); | |
| 171 | |
| 172 group('supported_feImage', () { | |
| 173 test('supported', () { | |
| 174 expect(svg.FEImageElement.supported, true); | |
| 175 }); | |
| 176 }); | |
| 177 | |
| 178 group('supported_feMerge', () { | |
| 179 test('supported', () { | |
| 180 expect(svg.FEMergeElement.supported, true); | |
| 181 }); | |
| 182 }); | |
| 183 | |
| 184 group('supported_feMergeNode', () { | |
| 185 test('supported', () { | |
| 186 expect(svg.FEMergeNodeElement.supported, true); | |
| 187 }); | |
| 188 }); | |
| 189 | |
| 190 group('supported_feOffset', () { | |
| 191 test('supported', () { | |
| 192 expect(svg.FEOffsetElement.supported, true); | |
| 193 }); | |
| 194 }); | |
| 195 | |
| 196 group('supported_feComponentTransfer', () { | |
| 197 test('supported', () { | |
| 198 expect(svg.FEPointLightElement.supported, true); | |
| 199 }); | |
| 200 }); | |
| 201 | |
| 202 group('supported_feSpecularLighting', () { | |
| 203 test('supported', () { | |
| 204 expect(svg.FESpecularLightingElement.supported, true); | |
| 205 }); | |
| 206 }); | |
| 207 | |
| 208 group('supported_feComponentTransfer', () { | |
| 209 test('supported', () { | |
| 210 expect(svg.FESpotLightElement.supported, true); | |
| 211 }); | |
| 212 }); | |
| 213 | |
| 214 group('supported_feTile', () { | |
| 215 test('supported', () { | |
| 216 expect(svg.FETileElement.supported, true); | |
| 217 }); | |
| 218 }); | |
| 219 | |
| 220 group('supported_feTurbulence', () { | |
| 221 test('supported', () { | |
| 222 expect(svg.FETurbulenceElement.supported, true); | |
| 223 }); | |
| 224 }); | |
| 225 | |
| 226 group('supported_filter', () { | |
| 227 test('supported', () { | |
| 228 expect(svg.FilterElement.supported, true); | |
| 229 }); | |
| 230 }); | |
| 231 | |
| 232 group('supported_foreignObject', () { | |
| 233 test('supported', () { | |
| 234 expect(svg.ForeignObjectElement.supported, true); | |
| 235 }); | |
| 236 }); | |
| 237 | |
| 238 group('supported_set', () { | |
| 239 test('supported', () { | |
| 240 expect(svg.SetElement.supported, true); | |
| 241 }); | |
| 242 }); | 114 }); |
| 243 | 115 |
| 244 group('constructors', () { | 116 group('constructors', () { |
| 245 test('supported', () { | 117 testConstructor('a', (e) => e is svg.AElement); |
| 246 testConstructor('a', (e) => e is svg.AElement); | 118 testConstructor('circle', (e) => e is svg.CircleElement); |
| 247 testConstructor('circle', (e) => e is svg.CircleElement); | 119 testConstructor('clipPath', (e) => e is svg.ClipPathElement); |
| 248 testConstructor('clipPath', (e) => e is svg.ClipPathElement); | 120 testConstructor('defs', (e) => e is svg.DefsElement); |
| 249 testConstructor('defs', (e) => e is svg.DefsElement); | 121 testConstructor('desc', (e) => e is svg.DescElement); |
| 250 testConstructor('desc', (e) => e is svg.DescElement); | 122 testConstructor('ellipse', (e) => e is svg.EllipseElement); |
| 251 testConstructor('ellipse', (e) => e is svg.EllipseElement); | 123 testConstructor('g', (e) => e is svg.GElement); |
| 252 testConstructor('g', (e) => e is svg.GElement); | 124 // WebKit doesn't recognize hkern |
| 253 testConstructor('image', (e) => e is svg.ImageElement); | 125 // testConstructor('hkern', (e) => e is svg.HKernElement); |
| 254 testConstructor('line', (e) => e is svg.LineElement); | 126 testConstructor('image', (e) => e is svg.ImageElement); |
| 255 testConstructor('linearGradient', (e) => e is svg.LinearGradientElement); | 127 testConstructor('line', (e) => e is svg.LineElement); |
| 256 testConstructor('marker', (e) => e is svg.MarkerElement); | 128 testConstructor('linearGradient', (e) => e is svg.LinearGradientElement); |
| 257 testConstructor('mask', (e) => e is svg.MaskElement); | 129 // WebKit doesn't recognize mpath |
| 258 testConstructor('path', (e) => e is svg.PathElement); | 130 // testConstructor('mpath', (e) => e is svg.MPathElement); |
| 259 testConstructor('pattern', (e) => e is svg.PatternElement); | 131 testConstructor('marker', (e) => e is svg.MarkerElement); |
| 260 testConstructor('polygon', (e) => e is svg.PolygonElement); | 132 testConstructor('mask', (e) => e is svg.MaskElement); |
| 261 testConstructor('polyline', (e) => e is svg.PolylineElement); | 133 testConstructor('path', (e) => e is svg.PathElement); |
| 262 testConstructor('radialGradient', (e) => e is svg.RadialGradientElement); | 134 testConstructor('pattern', (e) => e is svg.PatternElement); |
| 263 testConstructor('rect', (e) => e is svg.RectElement); | 135 testConstructor('polygon', (e) => e is svg.PolygonElement); |
| 264 testConstructor('script', (e) => e is svg.ScriptElement); | 136 testConstructor('polyline', (e) => e is svg.PolylineElement); |
| 265 testConstructor('stop', (e) => e is svg.StopElement); | 137 testConstructor('radialGradient', (e) => e is svg.RadialGradientElement); |
| 266 testConstructor('style', (e) => e is svg.StyleElement); | 138 testConstructor('rect', (e) => e is svg.RectElement); |
| 267 testConstructor('switch', (e) => e is svg.SwitchElement); | 139 testConstructor('script', (e) => e is svg.ScriptElement); |
| 268 testConstructor('symbol', (e) => e is svg.SymbolElement); | 140 testConstructor('stop', (e) => e is svg.StopElement); |
| 269 testConstructor('tspan', (e) => e is svg.TSpanElement); | 141 testConstructor('style', (e) => e is svg.StyleElement); |
| 270 testConstructor('text', (e) => e is svg.TextElement); | 142 testConstructor('switch', (e) => e is svg.SwitchElement); |
| 271 testConstructor('textPath', (e) => e is svg.TextPathElement); | 143 testConstructor('symbol', (e) => e is svg.SymbolElement); |
| 272 testConstructor('title', (e) => e is svg.TitleElement); | 144 testConstructor('tspan', (e) => e is svg.TSpanElement); |
| 273 testConstructor('use', (e) => e is svg.UseElement); | 145 testConstructor('text', (e) => e is svg.TextElement); |
| 274 testConstructor('view', (e) => e is svg.ViewElement); | 146 testConstructor('textPath', (e) => e is svg.TextPathElement); |
| 275 testConstructor('altGlyph', (e) => e is svg.AltGlyphElement, | 147 testConstructor('title', (e) => e is svg.TitleElement); |
| 276 svg.AltGlyphElement.supported); | 148 testConstructor('use', (e) => e is svg.UseElement); |
| 277 testConstructor('animate', (e) => e is svg.AnimateElement, | 149 testConstructor('view', (e) => e is svg.ViewElement); |
| 278 svg.AnimateElement.supported); | |
| 279 testConstructor('animateMotion', (e) => e is svg.AnimateMotionElement, | |
| 280 svg.AnimateMotionElement.supported); | |
| 281 testConstructor('animateTransform', (e) => e is svg.AnimateTransformElemen
t, | |
| 282 svg.AnimateTransformElement.supported); | |
| 283 testConstructor('feBlend', (e) => e is svg.FEBlendElement, | |
| 284 svg.FEBlendElement.supported); | |
| 285 testConstructor('feColorMatrix', (e) => e is svg.FEColorMatrixElement, | |
| 286 svg.FEColorMatrixElement.supported); | |
| 287 testConstructor('feComponentTransfer', | |
| 288 (e) => e is svg.FEComponentTransferElement, | |
| 289 svg.FEComponentTransferElement.supported); | |
| 290 testConstructor('feConvolveMatrix', | |
| 291 (e) => e is svg.FEConvolveMatrixElement, | |
| 292 svg.FEConvolveMatrixElement.supported); | |
| 293 testConstructor('feDiffuseLighting', | |
| 294 (e) => e is svg.FEDiffuseLightingElement, | |
| 295 svg.FEDiffuseLightingElement.supported); | |
| 296 testConstructor('feDisplacementMap', | |
| 297 (e) => e is svg.FEDisplacementMapElement, | |
| 298 svg.FEDisplacementMapElement.supported); | |
| 299 testConstructor('feDistantLight', (e) => e is svg.FEDistantLightElement, | |
| 300 svg.FEDistantLightElement.supported); | |
| 301 testConstructor('feFlood', (e) => e is svg.FEFloodElement, | |
| 302 svg.FEFloodElement.supported); | |
| 303 testConstructor('feFuncA', (e) => e is svg.FEFuncAElement, | |
| 304 svg.FEFuncAElement.supported); | |
| 305 testConstructor('feFuncB', (e) => e is svg.FEFuncBElement, | |
| 306 svg.FEFuncBElement.supported); | |
| 307 testConstructor('feFuncG', (e) => e is svg.FEFuncGElement, | |
| 308 svg.FEFuncGElement.supported); | |
| 309 testConstructor('feFuncR', (e) => e is svg.FEFuncRElement, | |
| 310 svg.FEFuncRElement.supported); | |
| 311 testConstructor('feGaussianBlur', (e) => e is svg.FEGaussianBlurElement, | |
| 312 svg.FEGaussianBlurElement.supported); | |
| 313 testConstructor('feImage', (e) => e is svg.FEImageElement, | |
| 314 svg.FEImageElement.supported); | |
| 315 testConstructor('feMerge', (e) => e is svg.FEMergeElement, | |
| 316 svg.FEMergeElement.supported); | |
| 317 testConstructor('feMergeNode', (e) => e is svg.FEMergeNodeElement, | |
| 318 svg.FEMergeNodeElement.supported); | |
| 319 testConstructor('feOffset', (e) => e is svg.FEOffsetElement, | |
| 320 svg.FEOffsetElement.supported); | |
| 321 testConstructor('fePointLight', (e) => e is svg.FEPointLightElement, | |
| 322 svg.FEPointLightElement.supported); | |
| 323 testConstructor('feSpecularLighting', | |
| 324 (e) => e is svg.FESpecularLightingElement, | |
| 325 svg.FESpecularLightingElement.supported); | |
| 326 testConstructor('feSpotLight', (e) => e is svg.FESpotLightElement, | |
| 327 svg.FESpotLightElement.supported); | |
| 328 testConstructor('feTile', (e) => e is svg.FETileElement, | |
| 329 svg.FETileElement.supported); | |
| 330 testConstructor('feTurbulence', (e) => e is svg.FETurbulenceElement, | |
| 331 svg.FETurbulenceElement.supported); | |
| 332 testConstructor('filter', (e) => e is svg.FilterElement, | |
| 333 svg.FilterElement.supported); | |
| 334 testConstructor('foreignObject', (e) => e is svg.ForeignObjectElement, | |
| 335 svg.ForeignObjectElement.supported); | |
| 336 testConstructor('metadata', (e) => e is svg.MetadataElement); | |
| 337 testConstructor('set', (e) => e is svg.SetElement, | |
| 338 svg.SetElement.supported); | |
| 339 }); | |
| 340 }); | 150 }); |
| 341 | 151 |
| 342 group('outerHtml', () { | 152 group('outerHtml', () { |
| 343 test('outerHtml', () { | 153 test('outerHtml', () { |
| 344 final el = new svg.SvgSvgElement(); | 154 final el = new svg.SvgSvgElement(); |
| 345 el.children.add(new svg.CircleElement()); | 155 el.children.add(new svg.CircleElement()); |
| 346 el.children.add(new svg.PathElement()); | 156 el.children.add(new svg.PathElement()); |
| 347 expect([ | 157 expect([ |
| 348 '<svg version="1.1"><circle></circle><path></path></svg>', | 158 '<svg version="1.1"><circle></circle><path></path></svg>', |
| 349 '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">' | 159 '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">' |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 var el = new svg.CircleElement(); | 225 var el = new svg.CircleElement(); |
| 416 var classes = el.classes; | 226 var classes = el.classes; |
| 417 expect(el.classes.length, 0); | 227 expect(el.classes.length, 0); |
| 418 classes.toggle('foo'); | 228 classes.toggle('foo'); |
| 419 expect(el.classes.length, 1); | 229 expect(el.classes.length, 1); |
| 420 classes.toggle('foo'); | 230 classes.toggle('foo'); |
| 421 expect(el.classes.length, 0); | 231 expect(el.classes.length, 0); |
| 422 }); | 232 }); |
| 423 }); | 233 }); |
| 424 } | 234 } |
| OLD | NEW |