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

Side by Side Diff: sky/sdk/lib/framework/layout.dart

Issue 1093633002: Layout API prototype, for discussion (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: git cl land 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 unified diff | Download patch
« no previous file with comments | « no previous file | sky/sdk/lib/framework/layout2.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library layout; 1 library layout;
2 2
3 // This version of layout.dart is a shim version of layout2.dart that is backed using CSS and <div>s.
4
3 import 'node.dart'; 5 import 'node.dart';
4 import 'dart:sky' as sky; 6 import 'dart:sky' as sky;
5 import 'dart:collection'; 7 import 'dart:collection';
6 8
7 // UTILS 9 // UTILS
8 10
9 // Bridge to legacy CSS-like style specification 11 // Bridge to legacy CSS-like style specification
10 // Eventually we'll replace this with something else 12 // Eventually we'll replace this with something else
11 class Style { 13 class Style {
12 final String _className; 14 final String _className;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 void detach() { 59 void detach() {
58 detachSiblings(); 60 detachSiblings();
59 } 61 }
60 void detachSiblings() { } // workaround for lack of inter-class mixins in Dart 62 void detachSiblings() { } // workaround for lack of inter-class mixins in Dart
61 void merge(ParentData other) { 63 void merge(ParentData other) {
62 // override this in subclasses to merge in data from other into this 64 // override this in subclasses to merge in data from other into this
63 assert(other.runtimeType == this.runtimeType); 65 assert(other.runtimeType == this.runtimeType);
64 } 66 }
65 } 67 }
66 68
67 abstract class RenderNode extends Node { 69 abstract class RenderNode extends AbstractNode {
68 70
69 // LAYOUT 71 // LAYOUT
70 72
71 // parentData is only for use by the RenderNode that actually lays this 73 // parentData is only for use by the RenderNode that actually lays this
72 // node out, and any other nodes who happen to know exactly what 74 // node out, and any other nodes who happen to know exactly what
73 // kind of node that is. 75 // kind of node that is.
74 ParentData parentData; 76 ParentData parentData;
75 void setupPos(RenderNode child) { 77 void setupPos(RenderNode child) {
76 // override this to setup .parentData correctly for your class 78 // override this to setup .parentData correctly for your class
77 if (child.parentData is! ParentData) 79 if (child.parentData is! ParentData)
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 print(prefix + node.toString() + _attributes(node)); 553 print(prefix + node.toString() + _attributes(node));
552 var children = node.getChildNodes(); 554 var children = node.getChildNodes();
553 prefix = prefix + ' '; 555 prefix = prefix + ' ';
554 for (var child in children) 556 for (var child in children)
555 _serialiseDOM(child, prefix); 557 _serialiseDOM(child, prefix);
556 } 558 }
557 559
558 void dumpState() { 560 void dumpState() {
559 _serialiseDOM(sky.document); 561 _serialiseDOM(sky.document);
560 } 562 }
OLDNEW
« no previous file with comments | « no previous file | sky/sdk/lib/framework/layout2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698