Chromium Code Reviews| Index: client/html/src/DocumentFragmentWrappingImplementation.dart |
| diff --git a/client/html/src/DocumentFragmentWrappingImplementation.dart b/client/html/src/DocumentFragmentWrappingImplementation.dart |
| index 54b9644270c644e46ebb47b3d345c6e82aae628b..1374ea03442891000bd5cb08cc5d263b767d9358 100644 |
| --- a/client/html/src/DocumentFragmentWrappingImplementation.dart |
| +++ b/client/html/src/DocumentFragmentWrappingImplementation.dart |
| @@ -127,13 +127,18 @@ class EmptyStyleDeclaration extends CSSStyleDeclarationWrappingImplementation { |
| } |
| } |
| -class EmptyClientRect implements ClientRect { |
| - num get bottom() => 0; |
| - num get top() => 0; |
| - num get left() => 0; |
| - num get right() => 0; |
| - num get height() => 0; |
| - num get width() => 0; |
| +Future<CSSStyleDeclaration> _emptyStyleFuture() { |
| + final completer = new Completer<CSSStyleDeclaration>(); |
| + completer.complete(new EmptyStyleDeclaration()); |
| + return completer.future; |
| +} |
| + |
| +class EmptyElementRect implements ElementRect { |
| + ClientRect get client() => new SimpleClientRect(0, 0, 0, 0); |
|
arv (Not doing code reviews)
2011/10/27 03:16:13
Does this still work?
const SimpleClientRect(0, 0
Jacob
2011/10/27 20:59:25
Done. Switched these all to fields and took advan
|
| + ClientRect get offset() => new SimpleClientRect(0, 0, 0, 0); |
| + ClientRect get scroll() => new SimpleClientRect(0, 0, 0, 0); |
| + ClientRect get bounding() => new SimpleClientRect(0, 0, 0, 0); |
| + List<ClientRect> get clientRects() => const <SimpleClientRect>[]; |
| } |
| class DocumentFragmentWrappingImplementation extends NodeWrappingImplementation implements DocumentFragment { |
| @@ -222,6 +227,12 @@ class DocumentFragmentWrappingImplementation extends NodeWrappingImplementation |
| return _on; |
| } |
| + Future<ElementRect> get rect() { |
| + final completer = new Completer<ElementRect>(); |
| + completer.complete(new EmptyElementRect()); |
| + return completer.future; |
| + } |
| + |
| Element query(String selectors) => |
| LevelDom.wrapElement(_ptr.querySelector(selectors)); |
| @@ -231,18 +242,6 @@ class DocumentFragmentWrappingImplementation extends NodeWrappingImplementation |
| // If we can come up with a semi-reasonable default value for an Element |
| // getter, we'll use it. In general, these return the same values as an |
| // element that has no parent. |
| - int get clientHeight() => 0; |
| - int get clientWidth() => 0; |
| - int get offsetHeight() => 0; |
| - int get offsetWidth() => 0; |
| - int get scrollHeight() => 0; |
| - int get scrollWidth() => 0; |
| - int get clientLeft() => 0; |
| - int get clientTop() => 0; |
| - int get offsetLeft() => 0; |
| - int get offsetTop() => 0; |
| - int get scrollLeft() => 0; |
| - int get scrollTop() => 0; |
| String get contentEditable() => "false"; |
| bool get isContentEditable() => false; |
| bool get draggable() => false; |
| @@ -264,8 +263,10 @@ class DocumentFragmentWrappingImplementation extends NodeWrappingImplementation |
| Set<String> get classes() => new Set<String>(); |
| Map<String, String> get dataAttributes() => const {}; |
| CSSStyleDeclaration get style() => new EmptyStyleDeclaration(); |
| - ClientRect getBoundingClientRect() => new EmptyClientRect(); |
| - List<ClientRect> getClientRects() => const []; |
| + Future<CSSStyleDeclaration> get computedStyle() => |
| + _emptyStyleFuture(); |
| + Future<CSSStyleDeclaration> getComputedStyle(String pseudoElement) => |
| + _emptyStyleFuture(); |
| bool matchesSelector([String selectors]) => false; |
| // Imperative Element methods are made into no-ops, as they are on parentless |
| @@ -362,4 +363,4 @@ class DocumentFragmentWrappingImplementation extends NodeWrappingImplementation |
| throw new UnsupportedOperationException( |
| "WebKit drop zone can't be set for document fragments."); |
| } |
| -} |
| +} |