Chromium Code Reviews| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 List<Element> getRange(int start, int length) => | 100 List<Element> getRange(int start, int length) => |
| 101 _filtered.getRange(start, length); | 101 _filtered.getRange(start, length); |
| 102 int indexOf(Element element, int startIndex) => | 102 int indexOf(Element element, int startIndex) => |
| 103 _filtered.indexOf(element, startIndex); | 103 _filtered.indexOf(element, startIndex); |
| 104 int lastIndexOf(Element element, int startIndex) => | 104 int lastIndexOf(Element element, int startIndex) => |
| 105 _filtered.lastIndexOf(element, startIndex); | 105 _filtered.lastIndexOf(element, startIndex); |
| 106 Element last() => _filtered.last(); | 106 Element last() => _filtered.last(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 class EmptyStyleDeclaration extends CSSStyleDeclarationWrappingImplementation { | 109 class EmptyStyleDeclaration extends CSSStyleDeclarationWrappingImplementation { |
| 110 String get cssText() => ""; | 110 // This can't call super(), since that's a factory constructor |
| 111 int get length() => 0; | 111 EmptyStyleDeclaration() |
| 112 CSSRule get parentRule() => null; | 112 : super._wrap(dom.document.createElement('div').style) {} |
|
Jacob
2011/10/25 23:45:51
wouldn't
super._wrap(null);
be sufficient?
also
nweiz
2011/10/26 00:27:37
DOMWrapperBase assumes _ptr is non-null.
Jacob
2011/10/26 01:03:13
I'd suggest adding an alternate
_empty()
construc
Anton Muhin
2011/10/26 13:24:05
Why it's needed? I would really prefer not to hav
nweiz
2011/10/26 17:30:53
I think it's useful to have this constructor wrap
Jacob
2011/10/27 01:03:44
I disagree with this reasoning because if the dumm
| |
| 113 CSSValue getPropertyCSSValue(String propertyName) => null; | |
| 114 String getPropertyPriority(String propertyName) => ""; | |
| 115 String getPropertyShorthand(String propertyName) => null; | |
| 116 String getPropertyValue(String propertyName) => null; | |
| 117 bool isPropertyImplicit(String propertyName) => false; | |
| 118 String item(int index) => ""; | |
| 119 | 113 |
| 120 void set cssText(String value) { | 114 void set cssText(String value) { |
| 121 throw new UnsupportedOperationException( | 115 throw new UnsupportedOperationException( |
| 122 "Can't modify a frozen style declaration."); | 116 "Can't modify a frozen style declaration."); |
| 123 } | 117 } |
| 124 | 118 |
| 125 String removeProperty(String propertyName) { | 119 String removeProperty(String propertyName) { |
| 126 throw new UnsupportedOperationException( | 120 throw new UnsupportedOperationException( |
| 127 "Can't modify a frozen style declaration."); | 121 "Can't modify a frozen style declaration."); |
| 128 } | 122 } |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 362 void set title(String value) { | 356 void set title(String value) { |
| 363 throw new UnsupportedOperationException( | 357 throw new UnsupportedOperationException( |
| 364 "Title can't be set for document fragments."); | 358 "Title can't be set for document fragments."); |
| 365 } | 359 } |
| 366 | 360 |
| 367 void set webkitdropzone(String value) { | 361 void set webkitdropzone(String value) { |
| 368 throw new UnsupportedOperationException( | 362 throw new UnsupportedOperationException( |
| 369 "WebKit drop zone can't be set for document fragments."); | 363 "WebKit drop zone can't be set for document fragments."); |
| 370 } | 364 } |
| 371 } | 365 } |
| OLD | NEW |