Index: sdk/lib/html/src/shared_FactoryProviders.dart |
diff --git a/sdk/lib/html/src/shared_FactoryProviders.dart b/sdk/lib/html/src/shared_FactoryProviders.dart |
index 045b43c50cbca591db09e0c91c280568f207060d..428a60d20f38725d7610e45724b71a9606ee2bbe 100644 |
--- a/sdk/lib/html/src/shared_FactoryProviders.dart |
+++ b/sdk/lib/html/src/shared_FactoryProviders.dart |
@@ -2,6 +2,8 @@ |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
+part of html; |
+ |
class _CustomEventFactoryProvider { |
static CustomEvent createCustomEvent(String type, [bool canBubble = true, |
bool cancelable = true, Object detail = null]) { |
@@ -69,10 +71,10 @@ class _DocumentFragmentFactoryProvider { |
// return fragment; |
// } |
- static DocumentFragment createDocumentFragment_svg(String svg) { |
+ static DocumentFragment createDocumentFragment_svg(String svgContent) { |
final fragment = new DocumentFragment(); |
- final e = new SVGSVGElement(); |
- e.innerHTML = svg; |
+ final e = new svg.SVGSVGElement(); |
+ e.innerHTML = svgContent; |
// Copy list first since we don't want liveness during iteration. |
final List nodes = new List.from(e.nodes); |
@@ -80,37 +82,3 @@ class _DocumentFragmentFactoryProvider { |
return fragment; |
} |
} |
- |
-class _SVGElementFactoryProvider { |
- static SVGElement createSVGElement_tag(String tag) { |
- final Element temp = |
- document.$dom_createElementNS("http://www.w3.org/2000/svg", tag); |
- return temp; |
- } |
- |
- static SVGElement createSVGElement_svg(String svg) { |
- Element parentTag; |
- final match = _START_TAG_REGEXP.firstMatch(svg); |
- if (match != null && match.group(1).toLowerCase() == 'svg') { |
- parentTag = new Element.tag('div'); |
- } else { |
- parentTag = new SVGSVGElement(); |
- } |
- |
- parentTag.innerHTML = svg; |
- if (parentTag.elements.length == 1) return parentTag.elements.removeLast(); |
- |
- throw new ArgumentError( |
- 'SVG had ${parentTag.elements.length} ' |
- 'top-level elements but 1 expected'); |
- } |
-} |
- |
-class _SVGSVGElementFactoryProvider { |
- static SVGSVGElement createSVGSVGElement() { |
- final el = new SVGElement.tag("svg"); |
- // The SVG spec requires the version attribute to match the spec version |
- el.attributes['version'] = "1.1"; |
- return el; |
- } |
-} |