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

Unified Diff: client/html/release/htmlimpl.dart

Issue 9107047: Fix SVGElement#classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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:
Download patch
« no previous file with comments | « no previous file | client/html/src/CssClassSet.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/html/release/htmlimpl.dart
diff --git a/client/html/release/htmlimpl.dart b/client/html/release/htmlimpl.dart
index 38b83b901afdcec2c2fdbf7c253dd63000a73038..e61ae76213b39a7fd6dc425c8293d5ca86b62db5 100644
--- a/client/html/release/htmlimpl.dart
+++ b/client/html/release/htmlimpl.dart
@@ -18660,7 +18660,7 @@ class _CssClassSet implements Set<String> {
Set<String> _read() {
// TODO(mattsh) simplify this once split can take regex.
Set<String> s = new Set<String>();
- for (String name in _element.className.split(' ')) {
+ for (String name in _className().split(' ')) {
String trimmed = name.trim();
if (!trimmed.isEmpty()) {
s.add(trimmed);
@@ -18670,6 +18670,12 @@ class _CssClassSet implements Set<String> {
}
/**
+ * Read the class names as a space-separated string. This is meant to be
+ * overridden by subclasses.
+ */
+ String _className() => _element.className;
+
+ /**
* Join all the elements of a set into one string and write
* back to the element.
*/
@@ -24040,6 +24046,16 @@ class SVGDocumentWrappingImplementation extends DocumentWrappingImplementation i
// 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.
+class _SVGClassSet extends _CssClassSet {
+ _SVGClassSet(element) : super(element);
+
+ String _className() => _element.className.baseVal;
+
+ viod _write(Set s) {
+ _element.className.baseVal = _formatSet(s);
+ }
+}
+
class SVGElementWrappingImplementation extends ElementWrappingImplementation implements SVGElement {
SVGElementWrappingImplementation._wrap(ptr) : super._wrap(ptr) {}
@@ -24063,6 +24079,13 @@ class SVGElementWrappingImplementation extends ElementWrappingImplementation imp
'top-level elements but 1 expected');
}
+ Set<String> get classes() {
+ if (_cssClassSet === null) {
+ _cssClassSet = new _SVGClassSet(_ptr);
+ }
+ return _cssClassSet;
+ }
+
String get id() { return _ptr.id; }
void set id(String value) { _ptr.id = value; }
« no previous file with comments | « no previous file | client/html/src/CssClassSet.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698