OLD | NEW |
1 library svg; | 1 library svg; |
2 | 2 |
3 import 'dart:collection'; | 3 import 'dart:collection'; |
4 import 'dart:html'; | 4 import 'dart:html'; |
5 import 'dart:html_common'; | 5 import 'dart:html_common'; |
6 import 'dart:nativewrappers'; | 6 import 'dart:nativewrappers'; |
7 // DO NOT EDIT | 7 // DO NOT EDIT |
8 // Auto-generated dart:svg library. | 8 // Auto-generated dart:svg library. |
9 | 9 |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 static SvgElement createSvgElement_svg(String svg) { | 28 static SvgElement createSvgElement_svg(String svg) { |
29 Element parentTag; | 29 Element parentTag; |
30 final match = _START_TAG_REGEXP.firstMatch(svg); | 30 final match = _START_TAG_REGEXP.firstMatch(svg); |
31 if (match != null && match.group(1).toLowerCase() == 'svg') { | 31 if (match != null && match.group(1).toLowerCase() == 'svg') { |
32 parentTag = new Element.tag('div'); | 32 parentTag = new Element.tag('div'); |
33 } else { | 33 } else { |
34 parentTag = new SvgSvgElement(); | 34 parentTag = new SvgSvgElement(); |
35 } | 35 } |
36 | 36 |
37 parentTag.innerHtml = svg; | 37 parentTag.innerHtml = svg; |
38 if (parentTag.elements.length == 1) return parentTag.elements.removeLast(); | 38 if (parentTag.children.length == 1) return parentTag.children.removeLast(); |
39 | 39 |
40 throw new ArgumentError( | 40 throw new ArgumentError( |
41 'SVG had ${parentTag.elements.length} ' | 41 'SVG had ${parentTag.children.length} ' |
42 'top-level elements but 1 expected'); | 42 'top-level children but 1 expected'); |
43 } | 43 } |
44 } | 44 } |
45 | 45 |
46 class _SvgSvgElementFactoryProvider { | 46 class _SvgSvgElementFactoryProvider { |
47 static SvgSvgElement createSvgSvgElement() { | 47 static SvgSvgElement createSvgSvgElement() { |
48 final el = new SvgElement.tag("svg"); | 48 final el = new SvgElement.tag("svg"); |
49 // The SVG spec requires the version attribute to match the spec version | 49 // The SVG spec requires the version attribute to match the spec version |
50 el.attributes['version'] = "1.1"; | 50 el.attributes['version'] = "1.1"; |
51 return el; | 51 return el; |
52 } | 52 } |
(...skipping 7919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7972 List<ElementInstance> getRange(int start, int rangeLength) => | 7972 List<ElementInstance> getRange(int start, int rangeLength) => |
7973 Lists.getRange(this, start, rangeLength, <ElementInstance>[]); | 7973 Lists.getRange(this, start, rangeLength, <ElementInstance>[]); |
7974 | 7974 |
7975 // -- end List<ElementInstance> mixins. | 7975 // -- end List<ElementInstance> mixins. |
7976 | 7976 |
7977 | 7977 |
7978 /** @domName SVGElementInstanceList.item */ | 7978 /** @domName SVGElementInstanceList.item */ |
7979 ElementInstance item(int index) native "SVGElementInstanceList_item_Callback"; | 7979 ElementInstance item(int index) native "SVGElementInstanceList_item_Callback"; |
7980 | 7980 |
7981 } | 7981 } |
OLD | NEW |