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

Unified Diff: sdk/lib/html/templates/html/impl/impl_SVGElement.darttemplate

Issue 11364186: Dartifying SVG library class names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Syncing to latest, updating for style guide. Created 8 years, 1 month 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
Index: sdk/lib/html/templates/html/impl/impl_SVGElement.darttemplate
diff --git a/sdk/lib/html/templates/html/impl/impl_SVGElement.darttemplate b/sdk/lib/html/templates/html/impl/impl_SVGElement.darttemplate
deleted file mode 100644
index 077a8077cae10f650bf2cd971fbae57613e2a7e7..0000000000000000000000000000000000000000
--- a/sdk/lib/html/templates/html/impl/impl_SVGElement.darttemplate
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// 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;
-
-class _AttributeClassSet extends CssClassSet {
- final Element _element;
-
- _AttributeClassSet(this._element);
-
- Set<String> readClasses() {
- var classname = _element.attributes['class'];
-
- Set<String> s = new Set<String>();
- if (classname == null) {
- return s;
- }
- for (String name in classname.split(' ')) {
- String trimmed = name.trim();
- if (!trimmed.isEmpty) {
- s.add(trimmed);
- }
- }
- return s;
- }
-
- void writeClasses(Set s) {
- List list = new List.from(s);
- _element.attributes['class'] = Strings.join(list, ' ');
- }
-}
-
-class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
- factory $CLASSNAME.tag(String tag) =>
- _$(CLASSNAME)FactoryProvider.create$(CLASSNAME)_tag(tag);
- factory $CLASSNAME.svg(String svg) =>
- _$(CLASSNAME)FactoryProvider.create$(CLASSNAME)_svg(svg);
-
- _AttributeClassSet _cssClassSet;
- CssClassSet get classes {
- if (_cssClassSet == null) {
- _cssClassSet = new _AttributeClassSet(this);
- }
- return _cssClassSet;
- }
-
- List<Element> get elements => new FilteredElementList(this);
-
- void set elements(Collection<Element> value) {
- final elements = this.elements;
- elements.clear();
- elements.addAll(value);
- }
-
- String get outerHTML {
- final container = new Element.tag("div");
- final SVGElement cloned = this.clone(true);
- container.elements.add(cloned);
- return container.innerHTML;
- }
-
- String get innerHTML {
- final container = new Element.tag("div");
- final SVGElement cloned = this.clone(true);
- container.elements.addAll(cloned.elements);
- return container.innerHTML;
- }
-
- void set innerHTML(String svg) {
- final container = new Element.tag("div");
- // Wrap the SVG string in <svg> so that SVGElements are created, rather than
- // HTMLElements.
- container.innerHTML = '<svg version="1.1">$svg</svg>';
- this.elements = container.elements[0].elements;
- }
-
-$!MEMBERS
-}
« no previous file with comments | « sdk/lib/html/src/shared_SVGFactoryProviders.dart ('k') | sdk/lib/html/templates/html/impl/impl_SVGSVGElement.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698