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

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
« no previous file with comments | « tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /**
180 * Access the union of all [CssStyleDeclaration]s that are associated with an
181 * [ElementList].
182 *
183 * Grouping the style objects all together provides easy editing of specific
184 * properties of a collection of elements. Setting a specific property value
185 * will set that property in all [Element]s in the [ElementList]. Getting a
186 * specific property value will return the value of the property of the first
187 * element in the [ElementList].
188 */
189 CssStyleDeclarationBase get style;
190
179 /** 191 /**
180 * Access dimensions and position of the Elements in this list. 192 * Access dimensions and position of the Elements in this list.
181 * 193 *
182 * Setting the height or width properties will set the height or width 194 * 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 195 * property for all elements in the list. This returns a rectangle with the
184 * dimenions actually available for content 196 * dimenions actually available for content
185 * in this element, in pixels, regardless of this element's box-sizing 197 * 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 198 * property. Getting the height or width returns the height or width of the
187 * first Element in this list. 199 * first Element in this list.
188 * 200 *
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 throw new UnsupportedError('Cannot sort list'); 275 throw new UnsupportedError('Cannot sort list');
264 } 276 }
265 277
266 Element get first => _nodeList.first; 278 Element get first => _nodeList.first;
267 279
268 Element get last => _nodeList.last; 280 Element get last => _nodeList.last;
269 281
270 Element get single => _nodeList.single; 282 Element get single => _nodeList.single;
271 283
272 CssClassSet get classes => new _MultiElementCssClassSet(_elementList); 284 CssClassSet get classes => new _MultiElementCssClassSet(_elementList);
285
286 CssStyleDeclarationBase get style =>
287 new _CssStyleDeclarationSet(_elementList);
273 288
274 void set classes(Iterable<String> value) { 289 void set classes(Iterable<String> value) {
275 _elementList.forEach((e) => e.classes = value); 290 _elementList.forEach((e) => e.classes = value);
276 } 291 }
277 292
278 CssRect get contentEdge => new _ContentCssListRect(_elementList); 293 CssRect get contentEdge => new _ContentCssListRect(_elementList);
279 294
280 CssRect get paddingEdge => _elementList.first.paddingEdge; 295 CssRect get paddingEdge => _elementList.first.paddingEdge;
281 296
282 CssRect get borderEdge => _elementList.first.borderEdge; 297 CssRect get borderEdge => _elementList.first.borderEdge;
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 const ScrollAlignment._internal(this._value); 1285 const ScrollAlignment._internal(this._value);
1271 toString() => 'ScrollAlignment.$_value'; 1286 toString() => 'ScrollAlignment.$_value';
1272 1287
1273 /// Attempt to align the element to the top of the scrollable area. 1288 /// Attempt to align the element to the top of the scrollable area.
1274 static const TOP = const ScrollAlignment._internal('TOP'); 1289 static const TOP = const ScrollAlignment._internal('TOP');
1275 /// Attempt to center the element in the scrollable area. 1290 /// Attempt to center the element in the scrollable area.
1276 static const CENTER = const ScrollAlignment._internal('CENTER'); 1291 static const CENTER = const ScrollAlignment._internal('CENTER');
1277 /// Attempt to align the element to the bottom of the scrollable area. 1292 /// Attempt to align the element to the bottom of the scrollable area.
1278 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); 1293 static const BOTTOM = const ScrollAlignment._internal('BOTTOM');
1279 } 1294 }
OLDNEW
« no previous file with comments | « tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698