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

Side by Side Diff: lib/html/src/shared_FactoryProviders.dart

Issue 10544204: Some more + cleanups. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class _EventFactoryProvider { 5 class _EventFactoryProvider {
6 factory Event(String type, [bool canBubble = true, 6 factory Event(String type, [bool canBubble = true,
7 bool cancelable = true]) { 7 bool cancelable = true]) {
8 final _EventImpl e = _document.$dom_createEvent("Event"); 8 final _EventImpl e = _document.$dom_createEvent("Event");
9 e.$dom_initEvent(type, canBubble, cancelable); 9 e.$dom_initEvent(type, canBubble, cancelable);
10 return e; 10 return e;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 final match = _START_TAG_REGEXP.firstMatch(svg); 83 final match = _START_TAG_REGEXP.firstMatch(svg);
84 if (match != null && match.group(1).toLowerCase() == 'svg') { 84 if (match != null && match.group(1).toLowerCase() == 'svg') {
85 parentTag = new Element.tag('div'); 85 parentTag = new Element.tag('div');
86 } else { 86 } else {
87 parentTag = new SVGSVGElement(); 87 parentTag = new SVGSVGElement();
88 } 88 }
89 89
90 parentTag.innerHTML = svg; 90 parentTag.innerHTML = svg;
91 if (parentTag.elements.length == 1) return parentTag.nodes.removeLast(); 91 if (parentTag.elements.length == 1) return parentTag.nodes.removeLast();
92 92
93 throw new IllegalArgumentException('SVG had ${parentTag.elements.length} ' + 93 throw new IllegalArgumentException('SVG had ${parentTag.elements.length} '
94 'top-level elements but 1 expected'); 94 'top-level elements but 1 expected');
95 } 95 }
96 } 96 }
97 97
98 class _SVGSVGElementFactoryProvider { 98 class _SVGSVGElementFactoryProvider {
99 factory SVGSVGElement() { 99 factory SVGSVGElement() {
100 final el = new SVGElement.tag("svg"); 100 final el = new SVGElement.tag("svg");
101 // The SVG spec requires the version attribute to match the spec version 101 // The SVG spec requires the version attribute to match the spec version
102 el.attributes['version'] = "1.1"; 102 el.attributes['version'] = "1.1";
103 return el; 103 return el;
104 } 104 }
105 } 105 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698