Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2331)

Unified Diff: tools/dom/src/shared_SVGFactoryProviders.dart

Issue 16374007: First rev of Safe DOM (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/dom/src/Validators.dart ('k') | tools/dom/templates/html/dart2js/html_dart2js.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/shared_SVGFactoryProviders.dart
diff --git a/tools/dom/src/shared_SVGFactoryProviders.dart b/tools/dom/src/shared_SVGFactoryProviders.dart
index a6960b8fc1ff8cacde87e29fa19608893cda4a95..6f4b9a78f9fdd69eaa7bc3854979d0a94370caa0 100644
--- a/tools/dom/src/shared_SVGFactoryProviders.dart
+++ b/tools/dom/src/shared_SVGFactoryProviders.dart
@@ -2,9 +2,7 @@
// 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 svg;
-
-final _START_TAG_REGEXP = new RegExp('<(\\w+)');
+part of dart.dom.svg;
class _SvgElementFactoryProvider {
static SvgElement createSvgElement_tag(String tag) {
@@ -12,30 +10,4 @@ class _SvgElementFactoryProvider {
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.children.length == 1) return parentTag.children.removeLast();
-
- throw new ArgumentError(
- 'SVG had ${parentTag.children.length} '
- 'top-level children 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;
- }
}
« no previous file with comments | « tools/dom/src/Validators.dart ('k') | tools/dom/templates/html/dart2js/html_dart2js.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698