| 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 'app.dart'; | 7 import 'app.dart'; |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:collection'; | 9 import 'dart:collection'; |
| 10 import 'dart:mirrors'; | 10 import 'dart:mirrors'; |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 List<UINode> children | 456 List<UINode> children |
| 457 }) : this.children = children == null ? _emptyList : children, | 457 }) : this.children = children == null ? _emptyList : children, |
| 458 super( | 458 super( |
| 459 key: key | 459 key: key |
| 460 ) { | 460 ) { |
| 461 assert(!_debugHasDuplicateIds()); | 461 assert(!_debugHasDuplicateIds()); |
| 462 } | 462 } |
| 463 | 463 |
| 464 void insert(RenderObjectWrapper child, dynamic slot) { | 464 void insert(RenderObjectWrapper child, dynamic slot) { |
| 465 assert(slot == null || slot is RenderObject); | 465 assert(slot == null || slot is RenderObject); |
| 466 assert(root is ContainerRenderObjectMixin); |
| 466 root.add(child.root, before: slot); | 467 root.add(child.root, before: slot); |
| 467 } | 468 } |
| 468 | 469 |
| 469 void removeChild(UINode node) { | 470 void removeChild(UINode node) { |
| 470 assert(root is ContainerRenderObjectMixin); | 471 assert(root is ContainerRenderObjectMixin); |
| 471 root.remove(node.root); | 472 root.remove(node.root); |
| 472 super.removeChild(node); | 473 super.removeChild(node); |
| 473 } | 474 } |
| 474 | 475 |
| 475 void _remove() { | 476 void _remove() { |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 RenderParagraph createNode() => new RenderParagraph(text: text); | 642 RenderParagraph createNode() => new RenderParagraph(text: text); |
| 642 | 643 |
| 643 final String text; | 644 final String text; |
| 644 | 645 |
| 645 Paragraph({ Object key, this.text }) : super(key: key); | 646 Paragraph({ Object key, this.text }) : super(key: key); |
| 646 | 647 |
| 647 void syncRenderObject(UINode old) { | 648 void syncRenderObject(UINode old) { |
| 648 super.syncRenderObject(old); | 649 super.syncRenderObject(old); |
| 649 root.text = text; | 650 root.text = text; |
| 650 } | 651 } |
| 652 |
| 653 void insert(RenderObjectWrapper child, dynamic slot) { |
| 654 assert(false); |
| 655 // Paragraph does not support having children currently |
| 656 } |
| 651 } | 657 } |
| 652 | 658 |
| 653 class FlexContainer extends MultiChildRenderObjectWrapper { | 659 class FlexContainer extends MultiChildRenderObjectWrapper { |
| 654 RenderFlex root; | 660 RenderFlex root; |
| 655 RenderFlex createNode() => new RenderFlex(direction: this.direction); | 661 RenderFlex createNode() => new RenderFlex(direction: this.direction); |
| 656 | 662 |
| 657 final FlexDirection direction; | 663 final FlexDirection direction; |
| 658 | 664 |
| 659 FlexContainer({ | 665 FlexContainer({ |
| 660 Object key, | 666 Object key, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 684 Object key, | 690 Object key, |
| 685 this.src, | 691 this.src, |
| 686 this.size | 692 this.size |
| 687 }) : super(key: key); | 693 }) : super(key: key); |
| 688 | 694 |
| 689 void syncRenderObject(UINode old) { | 695 void syncRenderObject(UINode old) { |
| 690 super.syncRenderObject(old); | 696 super.syncRenderObject(old); |
| 691 root.src = src; | 697 root.src = src; |
| 692 root.requestedSize = size; | 698 root.requestedSize = size; |
| 693 } | 699 } |
| 700 |
| 701 void insert(RenderObjectWrapper child, dynamic slot) { |
| 702 assert(false); |
| 703 // Image does not support having children currently |
| 704 } |
| 694 } | 705 } |
| 695 | 706 |
| 696 | 707 |
| 697 Set<Component> _mountedComponents = new HashSet<Component>(); | 708 Set<Component> _mountedComponents = new HashSet<Component>(); |
| 698 Set<Component> _unmountedComponents = new HashSet<Component>(); | 709 Set<Component> _unmountedComponents = new HashSet<Component>(); |
| 699 | 710 |
| 700 void _enqueueDidMount(Component c) { | 711 void _enqueueDidMount(Component c) { |
| 701 assert(!_notifingMountStatus); | 712 assert(!_notifingMountStatus); |
| 702 _mountedComponents.add(c); | 713 _mountedComponents.add(c); |
| 703 } | 714 } |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 assert(root.parent is RenderView); | 995 assert(root.parent is RenderView); |
| 985 } | 996 } |
| 986 } | 997 } |
| 987 | 998 |
| 988 class Text extends Component { | 999 class Text extends Component { |
| 989 Text(this.data) : super(key: '*text*'); | 1000 Text(this.data) : super(key: '*text*'); |
| 990 final String data; | 1001 final String data; |
| 991 bool get interchangeable => true; | 1002 bool get interchangeable => true; |
| 992 UINode build() => new Paragraph(text: data); | 1003 UINode build() => new Paragraph(text: data); |
| 993 } | 1004 } |
| OLD | NEW |