| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 class FilteredElementList implements ElementList { | 5 class FilteredElementList implements ElementList { |
| 6 final Node _node; | 6 final Node _node; |
| 7 final NodeList _childNodes; | 7 final NodeList _childNodes; |
| 8 | 8 |
| 9 FilteredElementList(Node node): _childNodes = node.nodes, _node = node; | 9 FilteredElementList(Node node): _childNodes = node.nodes, _node = node; |
| 10 | 10 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 class EmptyElementRect implements ElementRect { | 119 class EmptyElementRect implements ElementRect { |
| 120 final ClientRect client = const _SimpleClientRect(0, 0, 0, 0); | 120 final ClientRect client = const _SimpleClientRect(0, 0, 0, 0); |
| 121 final ClientRect offset = const _SimpleClientRect(0, 0, 0, 0); | 121 final ClientRect offset = const _SimpleClientRect(0, 0, 0, 0); |
| 122 final ClientRect scroll = const _SimpleClientRect(0, 0, 0, 0); | 122 final ClientRect scroll = const _SimpleClientRect(0, 0, 0, 0); |
| 123 final ClientRect bounding = const _SimpleClientRect(0, 0, 0, 0); | 123 final ClientRect bounding = const _SimpleClientRect(0, 0, 0, 0); |
| 124 final List<ClientRect> clientRects = const <ClientRect>[]; | 124 final List<ClientRect> clientRects = const <ClientRect>[]; |
| 125 | 125 |
| 126 const EmptyElementRect(); | 126 const EmptyElementRect(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 class _FrozenCSSClassSet extends _CssClassSet { |
| 130 _FrozenCSSClassSet() : super(null); |
| 131 |
| 132 void _write(Set s) { |
| 133 throw const UnsupportedOperationException( |
| 134 'frozen class set cannot be modified'); |
| 135 } |
| 136 Set<String> _read() => new Set<String>(); |
| 137 } |
| 138 |
| 129 class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 139 class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| 130 ElementList _elements; | 140 ElementList _elements; |
| 131 | 141 |
| 132 ElementList get elements() { | 142 ElementList get elements() { |
| 133 if (_elements == null) { | 143 if (_elements == null) { |
| 134 _elements = new FilteredElementList(this); | 144 _elements = new FilteredElementList(this); |
| 135 } | 145 } |
| 136 return _elements; | 146 return _elements; |
| 137 } | 147 } |
| 138 | 148 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 String get tagName() => ""; | 227 String get tagName() => ""; |
| 218 String get webkitdropzone() => ""; | 228 String get webkitdropzone() => ""; |
| 219 String get webkitRegionOverflow() => ""; | 229 String get webkitRegionOverflow() => ""; |
| 220 Element get $dom_firstElementChild() => elements.first(); | 230 Element get $dom_firstElementChild() => elements.first(); |
| 221 Element get $dom_lastElementChild() => elements.last(); | 231 Element get $dom_lastElementChild() => elements.last(); |
| 222 Element get nextElementSibling() => null; | 232 Element get nextElementSibling() => null; |
| 223 Element get previousElementSibling() => null; | 233 Element get previousElementSibling() => null; |
| 224 Element get offsetParent() => null; | 234 Element get offsetParent() => null; |
| 225 Element get parent() => null; | 235 Element get parent() => null; |
| 226 Map<String, String> get attributes() => const {}; | 236 Map<String, String> get attributes() => const {}; |
| 227 // Issue 174: this should be a const set. | 237 CSSClassSet get classes() => new _FrozenCSSClassSet(); |
| 228 Set<String> get classes() => new Set<String>(); | |
| 229 Map<String, String> get dataAttributes() => const {}; | 238 Map<String, String> get dataAttributes() => const {}; |
| 230 CSSStyleDeclaration get style() => new Element.tag('div').style; | 239 CSSStyleDeclaration get style() => new Element.tag('div').style; |
| 231 Future<CSSStyleDeclaration> get computedStyle() => | 240 Future<CSSStyleDeclaration> get computedStyle() => |
| 232 _emptyStyleFuture(); | 241 _emptyStyleFuture(); |
| 233 Future<CSSStyleDeclaration> getComputedStyle(String pseudoElement) => | 242 Future<CSSStyleDeclaration> getComputedStyle(String pseudoElement) => |
| 234 _emptyStyleFuture(); | 243 _emptyStyleFuture(); |
| 235 bool matchesSelector(String selectors) => false; | 244 bool matchesSelector(String selectors) => false; |
| 236 | 245 |
| 237 // Imperative Element methods are made into no-ops, as they are on parentless | 246 // Imperative Element methods are made into no-ops, as they are on parentless |
| 238 // elements. | 247 // elements. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 "WebKit drop zone can't be set for document fragments."); | 346 "WebKit drop zone can't be set for document fragments."); |
| 338 } | 347 } |
| 339 | 348 |
| 340 void set webkitRegionOverflow(String value) { | 349 void set webkitRegionOverflow(String value) { |
| 341 throw new UnsupportedOperationException( | 350 throw new UnsupportedOperationException( |
| 342 "WebKit region overflow can't be set for document fragments."); | 351 "WebKit region overflow can't be set for document fragments."); |
| 343 } | 352 } |
| 344 | 353 |
| 345 $!MEMBERS | 354 $!MEMBERS |
| 346 } | 355 } |
| OLD | NEW |