Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 library fn; | 5 library fn; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:sky' as sky; | 9 import 'dart:sky' as sky; |
| 10 import 'reflect.dart' as reflect; | 10 import 'reflect.dart' as reflect; |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 536 Style style, | 536 Style style, |
| 537 String inlineStyle | 537 String inlineStyle |
| 538 }) : super( | 538 }) : super( |
| 539 key: key, | 539 key: key, |
| 540 children: children, | 540 children: children, |
| 541 style: style, | 541 style: style, |
| 542 inlineStyle: inlineStyle | 542 inlineStyle: inlineStyle |
| 543 ); | 543 ); |
| 544 } | 544 } |
| 545 | 545 |
| 546 class FlexContainer extends SkyElementWrapper { | |
| 547 | |
| 548 RenderCSSFlex _root; | |
| 549 RenderCSSFlex _createNode() => new RenderCSSFlex(this, this.direction); | |
| 550 | |
| 551 static final FlexContainer _emptyContainer = new FlexContainer(); | |
| 552 // direction doesn't matter if it's empty | |
| 553 | |
| 554 SkyNodeWrapper get _emptyNode => _emptyContainer; | |
| 555 | |
| 556 final FlexDirection direction; | |
| 557 | |
| 558 FlexContainer({ | |
| 559 Object key, | |
| 560 List<UINode> children, | |
| 561 Style style, | |
| 562 String inlineStyle, | |
| 563 this.direction | |
|
eseidel
2015/05/11 22:04:24
Is this OK defaulting to null?
Hixie
2015/05/11 22:06:07
fixed to default to row.
| |
| 564 }) : super( | |
| 565 key: key, | |
| 566 children: children, | |
| 567 style: style, | |
| 568 inlineStyle: inlineStyle | |
| 569 ); | |
| 570 | |
| 571 void _syncNode(UINode old) { | |
| 572 super._syncNode(old); | |
| 573 _root.direction = direction; | |
| 574 } | |
| 575 } | |
| 576 | |
| 546 class Image extends SkyElementWrapper { | 577 class Image extends SkyElementWrapper { |
| 547 | 578 |
| 548 RenderCSSImage _root; | 579 RenderCSSImage _root; |
| 549 RenderCSSImage _createNode() => new RenderCSSImage(this, this.src, this.width, this.height); | 580 RenderCSSImage _createNode() => new RenderCSSImage(this, this.src, this.width, this.height); |
| 550 | 581 |
| 551 static final Image _emptyImage = new Image(); | 582 static final Image _emptyImage = new Image(); |
| 552 | 583 |
| 553 SkyNodeWrapper get _emptyNode => _emptyImage; | 584 SkyNodeWrapper get _emptyNode => _emptyImage; |
| 554 | 585 |
| 555 final String src; | 586 final String src; |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 797 } | 828 } |
| 798 | 829 |
| 799 void _buildIfDirty() { | 830 void _buildIfDirty() { |
| 800 if (!_dirty || _defunct) | 831 if (!_dirty || _defunct) |
| 801 return; | 832 return; |
| 802 | 833 |
| 803 _trace('$_key rebuilding...'); | 834 _trace('$_key rebuilding...'); |
| 804 _sync(null, _host, _root); | 835 _sync(null, _host, _root); |
| 805 } | 836 } |
| 806 } | 837 } |
| OLD | NEW |