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

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: Adding CSSClassSet to wrappers and converting it to a frozen API on DocumentFragment. 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..7023a62034452a63c0ea4c3a712ddab662a75587 100644
--- a/lib/dom/templates/html/interface/interface_Element.darttemplate
+++ b/lib/dom/templates/html/interface/interface_Element.darttemplate
@@ -47,6 +47,14 @@ interface NodeSelector {
List<Element> queryAll(String selectors);
}
+interface CSSClassSet extends Set<String> {
+ /// Adds the class to the element if it is not on it, removes it if it is.
sra1 2012/08/24 20:31:02 Adds the class [token] ...
blois 2012/08/24 21:39:47 Done.
+ bool toggle(String token);
+
+ /// True if this classes cannot be added or removed from this.
sra1 2012/08/24 20:31:02 Not sure what this this or that this means. Maybe
blois 2012/08/24 21:39:47 Done.
+ bool isFrozen();
sra1 2012/08/24 20:31:02 Should this be a property? I would hope that this
blois 2012/08/24 21:39:47 Done.
blois 2012/08/24 21:39:47 Done.
+}
+
$!COMMENT
interface Element extends Node, NodeSelector default _$(ID)FactoryProvider {
Element.html(String html);
@@ -64,7 +72,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