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

Side by Side Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 21182002: Allow "bulk editing" of the CssStyleDeclaration objects in an ElementList as well (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 class _ChildrenElementList extends ListBase<Element> { 7 class _ChildrenElementList extends ListBase<Element> {
8 // Raw Element. 8 // Raw Element.
9 final Element _element; 9 final Element _element;
10 final HtmlCollection _childElements; 10 final HtmlCollection _childElements;
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 * 169 *
170 * htmlList.classes.add('selected'); 170 * htmlList.classes.add('selected');
171 * htmlList.classes.toggle('isOnline'); 171 * htmlList.classes.toggle('isOnline');
172 * htmlList.classes.remove('selected'); 172 * htmlList.classes.remove('selected');
173 */ 173 */
174 CssClassSet get classes; 174 CssClassSet get classes;
175 175
176 /** Replace the classes with `value` for every element in this list. */ 176 /** Replace the classes with `value` for every element in this list. */
177 set classes(Iterable<String> value); 177 set classes(Iterable<String> value);
178 178
179 /** The union of all styles associated with the [Element]s in this list. */
180 CssStyleDeclarationSet get style;
181
179 /** 182 /**
180 * Access dimensions and position of the Elements in this list. 183 * Access dimensions and position of the Elements in this list.
181 * 184 *
182 * Setting the height or width properties will set the height or width 185 * Setting the height or width properties will set the height or width
183 * property for all elements in the list. This returns a rectangle with the 186 * property for all elements in the list. This returns a rectangle with the
184 * dimenions actually available for content 187 * dimenions actually available for content
185 * in this element, in pixels, regardless of this element's box-sizing 188 * in this element, in pixels, regardless of this element's box-sizing
186 * property. Getting the height or width returns the height or width of the 189 * property. Getting the height or width returns the height or width of the
187 * first Element in this list. 190 * first Element in this list.
188 * 191 *
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } 267 }
265 268
266 Element get first => _nodeList.first; 269 Element get first => _nodeList.first;
267 270
268 Element get last => _nodeList.last; 271 Element get last => _nodeList.last;
269 272
270 Element get single => _nodeList.single; 273 Element get single => _nodeList.single;
271 274
272 CssClassSet get classes => new _MultiElementCssClassSet(_elementList); 275 CssClassSet get classes => new _MultiElementCssClassSet(_elementList);
273 276
277 CssStyleDeclarationSet get style =>
278 new CssStyleDeclarationSet._(_elementList);
279
274 void set classes(Iterable<String> value) { 280 void set classes(Iterable<String> value) {
275 _elementList.forEach((e) => e.classes = value); 281 _elementList.forEach((e) => e.classes = value);
276 } 282 }
277 283
278 CssRect get contentEdge => new _ContentCssListRect(_elementList); 284 CssRect get contentEdge => new _ContentCssListRect(_elementList);
279 285
280 CssRect get paddingEdge => _elementList.first.paddingEdge; 286 CssRect get paddingEdge => _elementList.first.paddingEdge;
281 287
282 CssRect get borderEdge => _elementList.first.borderEdge; 288 CssRect get borderEdge => _elementList.first.borderEdge;
283 289
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 const ScrollAlignment._internal(this._value); 1276 const ScrollAlignment._internal(this._value);
1271 toString() => 'ScrollAlignment.$_value'; 1277 toString() => 'ScrollAlignment.$_value';
1272 1278
1273 /// Attempt to align the element to the top of the scrollable area. 1279 /// Attempt to align the element to the top of the scrollable area.
1274 static const TOP = const ScrollAlignment._internal('TOP'); 1280 static const TOP = const ScrollAlignment._internal('TOP');
1275 /// Attempt to center the element in the scrollable area. 1281 /// Attempt to center the element in the scrollable area.
1276 static const CENTER = const ScrollAlignment._internal('CENTER'); 1282 static const CENTER = const ScrollAlignment._internal('CENTER');
1277 /// Attempt to align the element to the bottom of the scrollable area. 1283 /// Attempt to align the element to the bottom of the scrollable area.
1278 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); 1284 static const BOTTOM = const ScrollAlignment._internal('BOTTOM');
1279 } 1285 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698