| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 html; | 5 part of html; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A set (union) of the CSS classes that are present in a set of elements. | 8 * A set (union) of the CSS classes that are present in a set of elements. |
| 9 * Implemented separately from _ElementCssClassSet for performance. | 9 * Implemented separately from _ElementCssClassSet for performance. |
| 10 */ | 10 */ |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 } | 113 } |
| 114 | 114 |
| 115 bool toggle(String value, [bool shouldAdd]) { | 115 bool toggle(String value, [bool shouldAdd]) { |
| 116 return _toggle(_element, value, shouldAdd); | 116 return _toggle(_element, value, shouldAdd); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void addAll(Iterable<String> iterable) { | 119 void addAll(Iterable<String> iterable) { |
| 120 _addAll(_element, iterable); | 120 _addAll(_element, iterable); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void removeAll(Iterable<String> iterable) { | 123 void removeAll(Iterable<Object> iterable) { |
| 124 _removeAll(_element, iterable); | 124 _removeAll(_element, iterable); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void retainAll(Iterable<String> iterable) { | 127 void retainAll(Iterable<Object> iterable) { |
| 128 _removeWhere(_element, iterable.toSet().contains, false); | 128 _removeWhere(_element, iterable.toSet().contains, false); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void removeWhere(bool test(String name)) { | 131 void removeWhere(bool test(String name)) { |
| 132 _removeWhere(_element, test, true); | 132 _removeWhere(_element, test, true); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void retainWhere(bool test(String name)) { | 135 void retainWhere(bool test(String name)) { |
| 136 _removeWhere(_element, test, false); | 136 _removeWhere(_element, test, false); |
| 137 } | 137 } |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 249 |
| 250 static bool _classListToggle1(DomTokenList list, String value) { | 250 static bool _classListToggle1(DomTokenList list, String value) { |
| 251 return JS('bool', '#.toggle(#)', list, value); | 251 return JS('bool', '#.toggle(#)', list, value); |
| 252 } | 252 } |
| 253 | 253 |
| 254 static bool _classListToggle2( | 254 static bool _classListToggle2( |
| 255 DomTokenList list, String value, bool shouldAdd) { | 255 DomTokenList list, String value, bool shouldAdd) { |
| 256 return JS('bool', '#.toggle(#, #)', list, value, shouldAdd); | 256 return JS('bool', '#.toggle(#, #)', list, value, shouldAdd); |
| 257 } | 257 } |
| 258 } | 258 } |
| OLD | NEW |