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

Unified Diff: client/samples/total/src/InnerMenuView.dart

Issue 9145004: Revert "Example showing alternate async measurement solution" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/samples/total/src/HtmlTable.dart ('k') | client/samples/total/src/SelectionManager.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/samples/total/src/InnerMenuView.dart
diff --git a/client/samples/total/src/InnerMenuView.dart b/client/samples/total/src/InnerMenuView.dart
index 29e9564fe8c487165977ddff92608f55d413e645..4218ad02fb1e9920d4abb6d89618020b0229de8d 100644
--- a/client/samples/total/src/InnerMenuView.dart
+++ b/client/samples/total/src/InnerMenuView.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -47,14 +47,13 @@ class InnerMenuView {
// cell.
static void _pinHeight(Window window, TableRowElement row) {
Element firstCell = row.cells[0];
- window.requestMeasurementFrame(() {
- final firstCellRect = firstCell.rect;
- final style = firstCell.computedStyle;
-
- int height = firstCell.rect.client.height
- - HtmlUtils.fromPx(style.paddingTop)
- - HtmlUtils.fromPx(style.paddingBottom);
- return () { firstCell.style.height = HtmlUtils.toPx(height); };
+ final firstCellRect = firstCell.rect;
+ final style = firstCell.computedStyle;
+ window.requestLayoutFrame(() {
+ int height = firstCellRect.value.client.height
+ - HtmlUtils.fromPx(style.value.getPropertyValue('padding-top'))
+ - HtmlUtils.fromPx(style.value.getPropertyValue('padding-bottom'));
+ firstCell.style.setProperty('height', HtmlUtils.toPx(height));
});
}
@@ -213,11 +212,13 @@ class InnerMenuView {
}
// Must take into account the top of the table due to scrolling.
- window.requestMeasurementFrame(() {
- int tableTop = _row.offsetParent.rect.bounding.top.toInt();
+ final offsetParentRect = _row.offsetParent.rect;
+ final rowRect = _row.rect;
+ window.requestLayoutFrame(() {
+ int tableTop = offsetParentRect.value.bounding.top.toInt();
// Get the current bounding box of the row we're attached to.
- ClientRect boundingRowRect = _row.rect.bounding;
+ ClientRect boundingRowRect = rowRect.value.bounding;
CSSStyleDeclaration style = _bar.style;
int top = boundingRowRect.top.toInt() + _initialRowHeight - tableTop;
@@ -225,12 +226,10 @@ class InnerMenuView {
_currentRowHeight = height;
- return () {
- style.setProperty("top", HtmlUtils.toPx(top));
- style.setProperty("height", HtmlUtils.toPx(height));
+ style.setProperty("top", HtmlUtils.toPx(top));
+ style.setProperty("height", HtmlUtils.toPx(height));
- _innerMenuMoved();
- };
+ _innerMenuMoved();
});
}
« no previous file with comments | « client/samples/total/src/HtmlTable.dart ('k') | client/samples/total/src/SelectionManager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698