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:mirrors'; | 9 import 'dart:mirrors'; |
10 import 'dart:sky' as sky; | 10 import 'dart:sky' as sky; |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 | 617 |
618 static List<UINode> _positionNodesToFill(List<UINode> input) { | 618 static List<UINode> _positionNodesToFill(List<UINode> input) { |
619 if (input == null) | 619 if (input == null) |
620 return null; | 620 return null; |
621 return input.map((node) { | 621 return input.map((node) { |
622 return new ParentDataNode(node, _fillParentData); | 622 return new ParentDataNode(node, _fillParentData); |
623 }).toList(); | 623 }).toList(); |
624 } | 624 } |
625 } | 625 } |
626 | 626 |
| 627 abstract class OneChildRenderNodeWrapper extends RenderNodeWrapper { |
| 628 |
| 629 final UINode child; |
| 630 RenderNodeWithChildMixin root; |
| 631 |
| 632 OneChildRenderNodeWrapper({ |
| 633 Object key, |
| 634 this.child |
| 635 }) : super(key: key); |
| 636 |
| 637 void insert(RenderNodeWrapper child, dynamic slot) { |
| 638 assert(slot == null); |
| 639 root.child = child.root; |
| 640 } |
| 641 |
| 642 void _remove() { |
| 643 assert(child != null); |
| 644 removeChild(child); |
| 645 super._remove(); |
| 646 } |
| 647 } |
| 648 |
627 class TextFragment extends RenderNodeWrapper { | 649 class TextFragment extends RenderNodeWrapper { |
628 | 650 |
629 RenderCSSInline root; | 651 RenderCSSInline root; |
630 RenderCSSInline createNode() => new RenderCSSInline(this, this.data); | 652 RenderCSSInline createNode() => new RenderCSSInline(this, this.data); |
631 | 653 |
632 static final TextFragment _emptyText = new TextFragment(''); | 654 static final TextFragment _emptyText = new TextFragment(''); |
633 | 655 |
634 RenderNodeWrapper get emptyNode => _emptyText; | 656 RenderNodeWrapper get emptyNode => _emptyText; |
635 | 657 |
636 final String data; | 658 final String data; |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 | 982 |
961 final int color; | 983 final int color; |
962 | 984 |
963 RenderSolidColor root; | 985 RenderSolidColor root; |
964 RenderSolidColor createNode() => new RenderSolidColor(color, desiredWidth: 40.
0, desiredHeight: 130.0); | 986 RenderSolidColor createNode() => new RenderSolidColor(color, desiredWidth: 40.
0, desiredHeight: 130.0); |
965 | 987 |
966 static final Rectangle _emptyRectangle = new Rectangle(0); | 988 static final Rectangle _emptyRectangle = new Rectangle(0); |
967 RenderNodeWrapper get emptyNode => _emptyRectangle; | 989 RenderNodeWrapper get emptyNode => _emptyRectangle; |
968 | 990 |
969 } | 991 } |
OLD | NEW |