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

Unified Diff: client/layout/ViewLayout.dart

Issue 8360025: Move the individual property definitions from client/base/Css to CSSStyleDeclaration. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 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:
View side-by-side diff with in-line comments
Download patch
Index: client/layout/ViewLayout.dart
diff --git a/client/layout/ViewLayout.dart b/client/layout/ViewLayout.dart
index bb4c0174d42366cdd337b55c72a10cdf4faf7e97..b86155c720463a840f98df3503ba2bde729572fe 100644
--- a/client/layout/ViewLayout.dart
+++ b/client/layout/ViewLayout.dart
@@ -27,12 +27,12 @@ interface Positionable {
class LayoutParams {
// TODO(jmesserly): should be const, but there's a bug in DartC preventing us
// from calling "window." in an initializer. See b/5332777
- Css style;
+ CSSStyleDeclaration style;
int get layer() => 0;
LayoutParams(Element node) {
- style = new Css(window.getComputedStyle(node, ''));
+ style = window.getComputedStyle(node, '');
}
}
@@ -101,7 +101,7 @@ class ViewLayout {
return view.customStyle['display'] == "-dart-grid";
}
- Css get _style() => layoutParams.style;
+ CSSStyleDeclaration get _style() => layoutParams.style;
int get currentWidth() => view.node.offsetWidth;
int get currentHeight() => view.node.offsetHeight;
@@ -137,13 +137,13 @@ class ViewLayout {
void applyLayout() {
if (_measuredLeft != null) {
// TODO(jmesserly): benchmark the performance of this DOM interaction
- final css = new Css(view.node.style);
- css.position = 'absolute';
- css.left = '${_measuredLeft}px';
- css.top = '${_measuredTop}px';
- css.width = '${_measuredWidth}px';
- css.height = '${_measuredHeight}px';
- css.zIndex = '${layoutParams.layer}';
+ final style = view.node.style;
+ style.position = 'absolute';
+ style.left = '${_measuredLeft}px';
+ style.top = '${_measuredTop}px';
+ style.width = '${_measuredWidth}px';
+ style.height = '${_measuredHeight}px';
+ style.zIndex = '${layoutParams.layer}';
_measuredLeft = null;
_measuredTop = null;

Powered by Google App Engine
This is Rietveld 408576698