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

Unified Diff: sky/framework/fn.dart

Issue 1122413006: [Effen] Move 'flex' out of CSS also. (mark II) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: git cl description Created 5 years, 7 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 | « sky/framework/components/action_bar.dart ('k') | sky/framework/layout.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/fn.dart
diff --git a/sky/framework/fn.dart b/sky/framework/fn.dart
index 1a1118c07e56a04fcb7f0cf7d067e53e6d3bef28..29caedab9276e9801743d4acb639129d1846c760 100644
--- a/sky/framework/fn.dart
+++ b/sky/framework/fn.dart
@@ -148,6 +148,12 @@ class StyleNode extends ContentNode {
StyleNode(UINode content, this.style): super(content);
}
+class ParentDataNode extends ContentNode {
+ final ParentData parentData;
+
+ ParentDataNode(UINode content, this.parentData): super(content);
+}
+
/*
* SkyNodeWrappers correspond to a desired state of a RenderCSS. They are fully
* immutable, with one exception: A UINode which is a Component which lives within
@@ -389,14 +395,28 @@ abstract class SkyElementWrapper extends SkyNodeWrapper {
List<Style> styles = new List<Style>();
if (style != null)
styles.add(style);
+ ParentData parentData = null;
UINode parent = _parent;
while (parent != null && parent is! SkyNodeWrapper) {
if (parent is StyleNode && parent.style != null)
styles.add(parent.style);
+ else
+ if (parent is ParentDataNode && parent.parentData != null) {
+ if (parentData != null)
+ parentData.merge(parent.parentData); // this will throw if the types aren't the same
+ else
+ parentData = parent.parentData;
+ }
parent = parent._parent;
}
_root.updateStyles(styles);
-
+ if (parentData != null) {
+ assert(_root.parentData != null);
+ _root.parentData.merge(parentData); // this will throw if the types aren't approriate
+ assert(parent != null);
+ assert(parent._root != null);
+ parent._root.markNeedsLayout();
+ }
_root.updateInlineStyle(inlineStyle);
_syncChildren(oldSkyElementWrapper);
« no previous file with comments | « sky/framework/components/action_bar.dart ('k') | sky/framework/layout.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698