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

Unified Diff: lib/dom/templates/html/interface/interface_Element.darttemplate

Issue 10868026: Adding .toggle method to Element.classes to match the JS element.classList.toggle method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporating review feedback. Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/dom/templates/html/impl/impl_SVGElement.darttemplate ('k') | lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dom/templates/html/interface/interface_Element.darttemplate
diff --git a/lib/dom/templates/html/interface/interface_Element.darttemplate b/lib/dom/templates/html/interface/interface_Element.darttemplate
index 455eb0d24f804990c5402ad2773a97dca3bd0125..16d2279065b24f250ef037a5569464211f8f2f87 100644
--- a/lib/dom/templates/html/interface/interface_Element.darttemplate
+++ b/lib/dom/templates/html/interface/interface_Element.darttemplate
@@ -47,6 +47,20 @@ interface NodeSelector {
List<Element> queryAll(String selectors);
}
+interface CSSClassSet extends Set<String> {
+ /**
+ * Adds the class [token] to the element if it is not on it, removes it if it
+ * is.
+ */
+ bool toggle(String token);
+
+ /**
+ * Returns [:true:] classes cannot be added or removed from this
+ * [:CSSClassSet:].
+ */
+ bool get isFrozen();
+}
+
$!COMMENT
interface Element extends Node, NodeSelector default _$(ID)FactoryProvider {
Element.html(String html);
@@ -64,7 +78,7 @@ interface Element extends Node, NodeSelector default _$(ID)FactoryProvider {
void set elements(Collection<Element> value);
/** @domName className, classList */
- Set<String> get classes();
+ CSSClassSet get classes();
void set classes(Collection<String> value);
« no previous file with comments | « lib/dom/templates/html/impl/impl_SVGElement.darttemplate ('k') | lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698