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

Side-by-side diff isn't available for this file because of its large size.
Issue 11046025: Adding synchronous measurement methods to Element. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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:
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 129715eae1eee1981852ec036d4d449860367493..32c7890cefea9cc76cf1510c8cbb839b75acb24a 100644
--- a/lib/html/dartium/html_dartium.dart
+++ b/lib/html/dartium/html_dartium.dart
@@ -12424,11 +12424,32 @@ 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
+ * Synchronous implementation of [rect.client]
+ * If browser layout has been dirtied before this method is called then a
+ * re-layout will be forced and this may impact performance.
*/
- Future<ElementRect> get rect;
+ ClientRect get client;
+
+ /**
+ * Synchronous implementation of [rect.offsetSync]
+ * If browser layout has been dirtied before this method is called then a
+ * re-layout will be forced and this may impact performance.
+ */
+ ClientRect get offset;
+
+ /**
+ * Synchronous implementation of [rect.scroll]
+ * If browser layout has been dirtied before this method is called then a
+ * re-layout will be forced and this may impact performance.
+ */
+ ClientRect get scroll;
+
+ /**
+ * Synchronous implementation of [rect.boundingClientRect]
+ * If browser layout has been dirtied before this method is called then a
+ * re-layout will be forced and this may impact performance.
+ */
+ ClientRect get boundingClientRect;
/** @domName Window.getComputedStyle */
Future<CSSStyleDeclaration> get computedStyle;
@@ -13451,6 +13472,26 @@ class _ElementImpl extends _NodeImpl implements Element {
new Completer<ElementRect>());
}
+ ClientRect get client => new _SimpleClientRect(
+ this.$dom_clientLeft,
+ this.$dom_clientTop,
+ this.$dom_clientWidth,
+ this.$dom_clientHeight);
+
+ ClientRect get offset => new _SimpleClientRect(
+ this.$dom_offsetLeft,
+ this.$dom_offsetTop,
+ this.$dom_offsetWidth,
+ this.$dom_offsetHeight);
+
+ ClientRect get scroll => new _SimpleClientRect(
+ this.$dom_scrollLeft,
+ this.$dom_scrollTop,
+ this.$dom_scrollWidth,
+ this.$dom_scrollHeight);
+
+ ClientRect get boundingClientRect => this.$dom_getBoundingClientRect();
+
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