OLD | NEW |
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. | 3 // This version of layout.dart is a shim version of layout2.dart that is backed
using CSS and <div>s. |
4 | 4 |
5 import 'node.dart'; | 5 import 'node.dart'; |
6 import 'dart:sky' as sky; | 6 import 'dart:sky' as sky; |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 // UTILS | 9 // UTILS |
10 | 10 |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 child.parentData = new FlexBoxParentData(); | 370 child.parentData = new FlexBoxParentData(); |
371 } | 371 } |
372 | 372 |
373 static final Style _displayFlex = new Style._addToCache('display:flex'); | 373 static final Style _displayFlex = new Style._addToCache('display:flex'); |
374 static final Style _displayFlexRow = new Style._addToCache('flex-direction:row
'); | 374 static final Style _displayFlexRow = new Style._addToCache('flex-direction:row
'); |
375 static final Style _displayFlexColumn = new Style._addToCache('flex-direction:
column'); | 375 static final Style _displayFlexColumn = new Style._addToCache('flex-direction:
column'); |
376 | 376 |
377 String stylesToClasses(List<Style> styles) { | 377 String stylesToClasses(List<Style> styles) { |
378 var settings = _displayFlex._className; | 378 var settings = _displayFlex._className; |
379 switch (_direction) { | 379 switch (_direction) { |
380 case FlexDirection.Row: settings += ' ' + _displayFlexRow._className; brea
k; | 380 case FlexDirection.horizontal: settings += ' ' + _displayFlexRow._classNam
e; break; |
381 case FlexDirection.Column: settings += ' ' + _displayFlexColumn._className
; break; | 381 case FlexDirection.vertical: settings += ' ' + _displayFlexColumn._classNa
me; break; |
382 } | 382 } |
383 return super.stylesToClasses(styles) + ' ' + settings; | 383 return super.stylesToClasses(styles) + ' ' + settings; |
384 } | 384 } |
385 | 385 |
386 void markNeedsLayout() { | 386 void markNeedsLayout() { |
387 super.markNeedsLayout(); | 387 super.markNeedsLayout(); |
388 | 388 |
389 // pretend we did the layout: | 389 // pretend we did the layout: |
390 RenderCSS child = _firstChild; | 390 RenderCSS child = _firstChild; |
391 while (child != null) { | 391 while (child != null) { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 print(prefix + node.toString() + _attributes(node)); | 553 print(prefix + node.toString() + _attributes(node)); |
554 var children = node.getChildNodes(); | 554 var children = node.getChildNodes(); |
555 prefix = prefix + ' '; | 555 prefix = prefix + ' '; |
556 for (var child in children) | 556 for (var child in children) |
557 _serialiseDOM(child, prefix); | 557 _serialiseDOM(child, prefix); |
558 } | 558 } |
559 | 559 |
560 void dumpState() { | 560 void dumpState() { |
561 _serialiseDOM(sky.document); | 561 _serialiseDOM(sky.document); |
562 } | 562 } |
OLD | NEW |