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

Side by Side Diff: tools/dom/templates/html/impl/impl_SVGElement.darttemplate

Issue 410863002: Redo "Use @Native annotation on dart2js DOM native classes" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 part of $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 class _AttributeClassSet extends CssClassSetImpl { 7 class _AttributeClassSet extends CssClassSetImpl {
8 final Element _element; 8 final Element _element;
9 9
10 _AttributeClassSet(this._element); 10 _AttributeClassSet(this._element);
(...skipping 12 matching lines...) Expand all
23 } 23 }
24 } 24 }
25 return s; 25 return s;
26 } 26 }
27 27
28 void writeClasses(Set s) { 28 void writeClasses(Set s) {
29 _element.attributes['class'] = s.join(' '); 29 _element.attributes['class'] = s.join(' ');
30 } 30 }
31 } 31 }
32 32
33 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { 33 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
34 static final _START_TAG_REGEXP = new RegExp('<(\\w+)'); 34 static final _START_TAG_REGEXP = new RegExp('<(\\w+)');
35 35
36 factory $CLASSNAME.tag(String tag) => 36 factory $CLASSNAME.tag(String tag) =>
37 document.createElementNS("http://www.w3.org/2000/svg", tag); 37 document.createElementNS("http://www.w3.org/2000/svg", tag);
38 factory $CLASSNAME.svg(String svg, 38 factory $CLASSNAME.svg(String svg,
39 {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) { 39 {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
40 40
41 if (validator == null && treeSanitizer == null) { 41 if (validator == null && treeSanitizer == null) {
42 validator = new NodeValidatorBuilder.common()..allowSvg(); 42 validator = new NodeValidatorBuilder.common()..allowSvg();
43 } 43 }
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 * Checks to see if the SVG element type is supported by the current platform. 143 * Checks to see if the SVG element type is supported by the current platform.
144 * 144 *
145 * The tag should be a valid SVG element tag name. 145 * The tag should be a valid SVG element tag name.
146 */ 146 */
147 static bool isTagSupported(String tag) { 147 static bool isTagSupported(String tag) {
148 var e = new $CLASSNAME.tag(tag); 148 var e = new $CLASSNAME.tag(tag);
149 return e is $CLASSNAME && !(e is UnknownElement); 149 return e is $CLASSNAME && !(e is UnknownElement);
150 } 150 }
151 $!MEMBERS 151 $!MEMBERS
152 } 152 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698