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

Unified Diff: lib/html/dartium/html_dartium.dart

Issue 11367040: Removing Element.rect. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
Index: lib/html/dartium/html_dartium.dart
diff --git a/lib/html/dartium/html_dartium.dart b/lib/html/dartium/html_dartium.dart
index 43d96686e8fa935d2c99c6fc6ff3d535b299abfb..fb61d29a0684670c67b71674f6e3ce6351de45f1 100644
--- a/lib/html/dartium/html_dartium.dart
+++ b/lib/html/dartium/html_dartium.dart
@@ -11625,16 +11625,6 @@ Future<CSSStyleDeclaration> _emptyStyleFuture() {
new Completer<CSSStyleDeclaration>());
}
-class EmptyElementRect implements ElementRect {
- final ClientRect client = const _SimpleClientRect(0, 0, 0, 0);
- final ClientRect offset = const _SimpleClientRect(0, 0, 0, 0);
- final ClientRect scroll = const _SimpleClientRect(0, 0, 0, 0);
- final ClientRect bounding = const _SimpleClientRect(0, 0, 0, 0);
- final List<ClientRect> clientRects = const <ClientRect>[];
-
- const EmptyElementRect();
-}
-
class _FrozenCSSClassSet extends _CssClassSet {
_FrozenCSSClassSet() : super(null);
@@ -11727,11 +11717,6 @@ class _DocumentFragmentImpl extends _NodeImpl implements DocumentFragment {
this.insertAdjacentHTML('beforeend', text);
}
- Future<ElementRect> get rect {
- return _createMeasurementFuture(() => const EmptyElementRect(),
- new Completer<ElementRect>());
- }
-
// 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.
@@ -12292,20 +12277,6 @@ abstract class AttributeMap implements Map<String, String> {
void operator []=(String key, value);
}
-/**
- * All your element measurement needs in one place
- */
-abstract class ElementRect {
- // Relative to offsetParent
- ClientRect get client;
- ClientRect get offset;
- ClientRect get scroll;
- // In global coords
- ClientRect get bounding;
- // In global coords
- List<ClientRect> get clientRects;
-}
-
abstract class NodeSelector {
Element query(String selectors);
List<Element> queryAll(String selectors);
@@ -12362,13 +12333,6 @@ abstract class Element implements Node, NodeSelector {
*/
void addHTML(String html);
- /**
- * @domName getClientRects, getBoundingClientRect, clientHeight, clientWidth,
- * clientTop, clientLeft, offsetHeight, offsetWidth, offsetTop, offsetLeft,
- * scrollHeight, scrollWidth, scrollTop, scrollLeft
- */
- Future<ElementRect> get rect;
-
/** @domName Window.getComputedStyle */
Future<CSSStyleDeclaration> get computedStyle;
@@ -13300,51 +13264,6 @@ class _SimpleClientRect implements ClientRect {
String toString() => "($left, $top, $width, $height)";
}
-// TODO(jacobr): we cannot currently be lazy about calculating the client
-// rects as we must perform all measurement queries at a safe point to avoid
-// triggering unneeded layouts.
-/**
- * All your element measurement needs in one place
- * @domName none
- */
-class _ElementRectImpl implements ElementRect {
- final ClientRect client;
- final ClientRect offset;
- final ClientRect scroll;
-
- // TODO(jacobr): should we move these outside of ElementRect to avoid the
- // overhead of computing them every time even though they are rarely used.
- final _ClientRectImpl _boundingClientRect;
- final _ClientRectListImpl _clientRects;
-
- _ElementRectImpl(_ElementImpl element) :
- client = new _SimpleClientRect(element.clientLeft,
- element.clientTop,
- element.clientWidth,
- element.clientHeight),
- offset = new _SimpleClientRect(element.offsetLeft,
- element.offsetTop,
- element.offsetWidth,
- element.offsetHeight),
- scroll = new _SimpleClientRect(element.scrollLeft,
- element.scrollTop,
- element.scrollWidth,
- element.scrollHeight),
- _boundingClientRect = element.getBoundingClientRect(),
- _clientRects = element.getClientRects();
-
- _ClientRectImpl get bounding => _boundingClientRect;
-
- // TODO(jacobr): cleanup.
- List<ClientRect> get clientRects {
- final out = new List(_clientRects.length);
- for (num i = 0; i < _clientRects.length; i++) {
- out[i] = _clientRects.item(i);
- }
- return out;
- }
-}
-
class _ElementImpl extends _NodeImpl implements Element {
/**
@@ -13393,12 +13312,6 @@ class _ElementImpl extends _NodeImpl implements Element {
}
}
- Future<ElementRect> get rect {
- return _createMeasurementFuture(
- () => new _ElementRectImpl(this),
- new Completer<ElementRect>());
- }
-
Future<CSSStyleDeclaration> get computedStyle {
// TODO(jacobr): last param should be null, see b/5045788
return getComputedStyle('');

Powered by Google App Engine
This is Rietveld 408576698