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

Side by Side Diff: sdk/lib/svg/dart2js/svg_dart2js.dart

Issue 24084004: Exposing document.createElement (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | « sdk/lib/html/dartium/html_dartium.dart ('k') | sdk/lib/svg/dartium/svg_dartium.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * Scalable Vector Graphics: 2 * Scalable Vector Graphics:
3 * Two-dimensional vector graphics with support for events and animation. 3 * Two-dimensional vector graphics with support for events and animation.
4 * 4 *
5 * For details about the features and syntax of SVG, a W3C standard, 5 * For details about the features and syntax of SVG, a W3C standard,
6 * refer to the 6 * refer to the
7 * [Scalable Vector Graphics Specification](http://www.w3.org/TR/SVG/). 7 * [Scalable Vector Graphics Specification](http://www.w3.org/TR/SVG/).
8 */ 8 */
9 library dart.dom.svg; 9 library dart.dom.svg;
10 10
(...skipping 14 matching lines...) Expand all
25 25
26 26
27 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 27 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
28 // for details. All rights reserved. Use of this source code is governed by a 28 // for details. All rights reserved. Use of this source code is governed by a
29 // BSD-style license that can be found in the LICENSE file. 29 // BSD-style license that can be found in the LICENSE file.
30 30
31 31
32 class _SvgElementFactoryProvider { 32 class _SvgElementFactoryProvider {
33 static SvgElement createSvgElement_tag(String tag) { 33 static SvgElement createSvgElement_tag(String tag) {
34 final Element temp = 34 final Element temp =
35 document.$dom_createElementNS("http://www.w3.org/2000/svg", tag); 35 document.createElementNS("http://www.w3.org/2000/svg", tag);
36 return temp; 36 return temp;
37 } 37 }
38 } 38 }
39 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 39 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
40 // for details. All rights reserved. Use of this source code is governed by a 40 // for details. All rights reserved. Use of this source code is governed by a
41 // BSD-style license that can be found in the LICENSE file. 41 // BSD-style license that can be found in the LICENSE file.
42 42
43 43
44 @DocsEditable() 44 @DocsEditable()
45 @DomName('SVGAElement') 45 @DomName('SVGAElement')
(...skipping 4687 matching lines...) Expand 10 before | Expand all | Expand 10 after
4733 _element.attributes['class'] = s.join(' '); 4733 _element.attributes['class'] = s.join(' ');
4734 } 4734 }
4735 } 4735 }
4736 4736
4737 @DomName('SVGElement') 4737 @DomName('SVGElement')
4738 @Unstable() 4738 @Unstable()
4739 class SvgElement extends Element native "SVGElement" { 4739 class SvgElement extends Element native "SVGElement" {
4740 static final _START_TAG_REGEXP = new RegExp('<(\\w+)'); 4740 static final _START_TAG_REGEXP = new RegExp('<(\\w+)');
4741 4741
4742 factory SvgElement.tag(String tag) => 4742 factory SvgElement.tag(String tag) =>
4743 document.$dom_createElementNS("http://www.w3.org/2000/svg", tag); 4743 document.createElementNS("http://www.w3.org/2000/svg", tag);
4744 factory SvgElement.svg(String svg, 4744 factory SvgElement.svg(String svg,
4745 {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) { 4745 {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
4746 4746
4747 if (validator == null && treeSanitizer == null) { 4747 if (validator == null && treeSanitizer == null) {
4748 validator = new NodeValidatorBuilder.common()..allowSvg(); 4748 validator = new NodeValidatorBuilder.common()..allowSvg();
4749 } 4749 }
4750 4750
4751 final match = _START_TAG_REGEXP.firstMatch(svg); 4751 final match = _START_TAG_REGEXP.firstMatch(svg);
4752 var parentElement; 4752 var parentElement;
4753 if (match != null && match.group(1).toLowerCase() == 'svg') { 4753 if (match != null && match.group(1).toLowerCase() == 'svg') {
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after
6198 @DomName('SVGVKernElement') 6198 @DomName('SVGVKernElement')
6199 @Unstable() 6199 @Unstable()
6200 abstract class _SVGVKernElement extends SvgElement native "SVGVKernElement" { 6200 abstract class _SVGVKernElement extends SvgElement native "SVGVKernElement" {
6201 // To suppress missing implicit constructor warnings. 6201 // To suppress missing implicit constructor warnings.
6202 factory _SVGVKernElement._() { throw new UnsupportedError("Not supported"); } 6202 factory _SVGVKernElement._() { throw new UnsupportedError("Not supported"); }
6203 6203
6204 @DomName('SVGVKernElement.SVGVKernElement') 6204 @DomName('SVGVKernElement.SVGVKernElement')
6205 @DocsEditable() 6205 @DocsEditable()
6206 factory _SVGVKernElement() => _SvgElementFactoryProvider.createSvgElement_tag( "vkern"); 6206 factory _SVGVKernElement() => _SvgElementFactoryProvider.createSvgElement_tag( "vkern");
6207 } 6207 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | sdk/lib/svg/dartium/svg_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698