| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 _mountedChanged.clear(); | 79 _mountedChanged.clear(); |
| 80 } finally { | 80 } finally { |
| 81 _notifyingMountStatus = false; | 81 _notifyingMountStatus = false; |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 void didMount() { } | 84 void didMount() { } |
| 85 void didUnmount() { } | 85 void didUnmount() { } |
| 86 | 86 |
| 87 RenderObject root; | 87 RenderObject _root; |
| 88 RenderObject get root => _root; |
| 88 | 89 |
| 89 // Subclasses which implements Nodes that become stateful may return true | 90 // Subclasses which implements Nodes that become stateful may return true |
| 90 // if the |old| node has become stateful and should be retained. | 91 // if the |old| node has become stateful and should be retained. |
| 91 // This is called immediately before _sync(). | 92 // This is called immediately before _sync(). |
| 92 // Component._retainStatefulNodeIfPossible() calls syncFields(). | 93 // Component._retainStatefulNodeIfPossible() calls syncFields(). |
| 93 bool _retainStatefulNodeIfPossible(UINode old) => false; | 94 bool _retainStatefulNodeIfPossible(UINode old) => false; |
| 94 | 95 |
| 95 bool get interchangeable => false; // if true, then keys can be duplicated | 96 bool get interchangeable => false; // if true, then keys can be duplicated |
| 96 | 97 |
| 97 void _sync(UINode old, dynamic slot); | 98 void _sync(UINode old, dynamic slot); |
| 98 // 'slot' is the identifier that the parent RenderObjectWrapper uses to know | 99 // 'slot' is the identifier that the parent RenderObjectWrapper uses to know |
| 99 // where to put this descendant | 100 // where to put this descendant |
| 100 | 101 |
| 101 void remove() { | 102 void remove() { |
| 102 root = null; | 103 _root = null; |
| 103 setParent(null); | 104 setParent(null); |
| 104 } | 105 } |
| 105 | 106 |
| 106 UINode findAncestor(Type targetType) { | 107 UINode findAncestor(Type targetType) { |
| 107 var ancestor = _parent; | 108 var ancestor = _parent; |
| 108 while (ancestor != null && !reflectClass(ancestor.runtimeType).isSubtypeOf(r
eflectClass(targetType))) | 109 while (ancestor != null && !reflectClass(ancestor.runtimeType).isSubtypeOf(r
eflectClass(targetType))) |
| 109 ancestor = ancestor._parent; | 110 ancestor = ancestor._parent; |
| 110 return ancestor; | 111 return ancestor; |
| 111 } | 112 } |
| 112 | 113 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 abstract class TagNode extends UINode { | 161 abstract class TagNode extends UINode { |
| 161 | 162 |
| 162 TagNode(UINode content, { Object key }) : this.content = content, super(key: k
ey); | 163 TagNode(UINode content, { Object key }) : this.content = content, super(key: k
ey); |
| 163 | 164 |
| 164 UINode content; | 165 UINode content; |
| 165 | 166 |
| 166 void _sync(UINode old, dynamic slot) { | 167 void _sync(UINode old, dynamic slot) { |
| 167 UINode oldContent = old == null ? null : (old as TagNode).content; | 168 UINode oldContent = old == null ? null : (old as TagNode).content; |
| 168 content = syncChild(content, oldContent, slot); | 169 content = syncChild(content, oldContent, slot); |
| 169 assert(content.root != null); | 170 assert(content.root != null); |
| 170 root = content.root; | 171 _root = content.root; |
| 172 assert(_root == root); // in case a subclass reintroduces it |
| 171 } | 173 } |
| 172 | 174 |
| 173 void remove() { | 175 void remove() { |
| 174 if (content != null) | 176 if (content != null) |
| 175 removeChild(content); | 177 removeChild(content); |
| 176 super.remove(); | 178 super.remove(); |
| 177 } | 179 } |
| 178 | 180 |
| 179 } | 181 } |
| 180 | 182 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 void insert(RenderObjectWrapper child, dynamic slot); | 293 void insert(RenderObjectWrapper child, dynamic slot); |
| 292 | 294 |
| 293 static final Map<RenderObject, RenderObjectWrapper> _nodeMap = | 295 static final Map<RenderObject, RenderObjectWrapper> _nodeMap = |
| 294 new HashMap<RenderObject, RenderObjectWrapper>(); | 296 new HashMap<RenderObject, RenderObjectWrapper>(); |
| 295 | 297 |
| 296 static RenderObjectWrapper _getMounted(RenderObject node) => _nodeMap[node]; | 298 static RenderObjectWrapper _getMounted(RenderObject node) => _nodeMap[node]; |
| 297 | 299 |
| 298 void _sync(UINode old, dynamic slot) { | 300 void _sync(UINode old, dynamic slot) { |
| 299 assert(parent != null); | 301 assert(parent != null); |
| 300 if (old == null) { | 302 if (old == null) { |
| 301 root = createNode(); | 303 _root = createNode(); |
| 302 assert(root != null); | |
| 303 var ancestor = findAncestor(RenderObjectWrapper); | 304 var ancestor = findAncestor(RenderObjectWrapper); |
| 304 if (ancestor is RenderObjectWrapper) | 305 if (ancestor is RenderObjectWrapper) |
| 305 ancestor.insert(this, slot); | 306 ancestor.insert(this, slot); |
| 306 } else { | 307 } else { |
| 307 root = old.root; | 308 _root = old.root; |
| 308 } | 309 } |
| 310 assert(_root == root); // in case a subclass reintroduces it |
| 311 assert(root != null); |
| 309 assert(mounted); | 312 assert(mounted); |
| 310 assert(root != null); | |
| 311 _nodeMap[root] = this; | 313 _nodeMap[root] = this; |
| 312 syncRenderObject(old); | 314 syncRenderObject(old); |
| 313 } | 315 } |
| 314 | 316 |
| 315 void syncRenderObject(RenderObjectWrapper old) { | 317 void syncRenderObject(RenderObjectWrapper old) { |
| 316 ParentData parentData = null; | 318 ParentData parentData = null; |
| 317 UINode ancestor = parent; | 319 UINode ancestor = parent; |
| 318 while (ancestor != null && ancestor is! RenderObjectWrapper) { | 320 while (ancestor != null && ancestor is! RenderObjectWrapper) { |
| 319 if (ancestor is ParentDataNode && ancestor.parentData != null) { | 321 if (ancestor is ParentDataNode && ancestor.parentData != null) { |
| 320 if (parentData != null) | 322 if (parentData != null) |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 super.remove(); | 376 super.remove(); |
| 375 } | 377 } |
| 376 | 378 |
| 377 } | 379 } |
| 378 | 380 |
| 379 class Clip extends OneChildRenderObjectWrapper { | 381 class Clip extends OneChildRenderObjectWrapper { |
| 380 | 382 |
| 381 Clip({ UINode child, Object key }) | 383 Clip({ UINode child, Object key }) |
| 382 : super(child: child, key: key); | 384 : super(child: child, key: key); |
| 383 | 385 |
| 384 RenderClip root; | 386 RenderClip get root => super.root as RenderClip; |
| 385 RenderClip createNode() => new RenderClip(); | 387 RenderClip createNode() => new RenderClip(); |
| 386 | 388 |
| 387 } | 389 } |
| 388 | 390 |
| 389 class Padding extends OneChildRenderObjectWrapper { | 391 class Padding extends OneChildRenderObjectWrapper { |
| 390 | 392 |
| 391 Padding({ this.padding, UINode child, Object key }) | 393 Padding({ this.padding, UINode child, Object key }) |
| 392 : super(child: child, key: key); | 394 : super(child: child, key: key); |
| 393 | 395 |
| 394 RenderPadding root; | 396 RenderPadding get root => super.root as RenderPadding; |
| 395 final EdgeDims padding; | 397 final EdgeDims padding; |
| 396 | 398 |
| 397 RenderPadding createNode() => new RenderPadding(padding: padding); | 399 RenderPadding createNode() => new RenderPadding(padding: padding); |
| 398 | 400 |
| 399 void syncRenderObject(Padding old) { | 401 void syncRenderObject(Padding old) { |
| 400 super.syncRenderObject(old); | 402 super.syncRenderObject(old); |
| 401 root.padding = padding; | 403 root.padding = padding; |
| 402 } | 404 } |
| 403 | 405 |
| 404 } | 406 } |
| 405 | 407 |
| 406 class DecoratedBox extends OneChildRenderObjectWrapper { | 408 class DecoratedBox extends OneChildRenderObjectWrapper { |
| 407 | 409 |
| 408 DecoratedBox({ this.decoration, UINode child, Object key }) | 410 DecoratedBox({ this.decoration, UINode child, Object key }) |
| 409 : super(child: child, key: key); | 411 : super(child: child, key: key); |
| 410 | 412 |
| 411 RenderDecoratedBox root; | 413 RenderDecoratedBox get root => super.root as RenderDecoratedBox; |
| 412 final BoxDecoration decoration; | 414 final BoxDecoration decoration; |
| 413 | 415 |
| 414 RenderDecoratedBox createNode() => new RenderDecoratedBox(decoration: decorati
on); | 416 RenderDecoratedBox createNode() => new RenderDecoratedBox(decoration: decorati
on); |
| 415 | 417 |
| 416 void syncRenderObject(DecoratedBox old) { | 418 void syncRenderObject(DecoratedBox old) { |
| 417 super.syncRenderObject(old); | 419 super.syncRenderObject(old); |
| 418 root.decoration = decoration; | 420 root.decoration = decoration; |
| 419 } | 421 } |
| 420 | 422 |
| 421 } | 423 } |
| 422 | 424 |
| 423 class SizedBox extends OneChildRenderObjectWrapper { | 425 class SizedBox extends OneChildRenderObjectWrapper { |
| 424 | 426 |
| 425 SizedBox({ | 427 SizedBox({ |
| 426 double width: double.INFINITY, | 428 double width: double.INFINITY, |
| 427 double height: double.INFINITY, | 429 double height: double.INFINITY, |
| 428 UINode child, | 430 UINode child, |
| 429 Object key | 431 Object key |
| 430 }) : desiredSize = new Size(width, height), super(child: child, key: key); | 432 }) : desiredSize = new Size(width, height), super(child: child, key: key); |
| 431 | 433 |
| 432 RenderSizedBox root; | 434 RenderSizedBox get root => super.root as RenderSizedBox; |
| 433 final Size desiredSize; | 435 final Size desiredSize; |
| 434 | 436 |
| 435 RenderSizedBox createNode() => new RenderSizedBox(desiredSize: desiredSize); | 437 RenderSizedBox createNode() => new RenderSizedBox(desiredSize: desiredSize); |
| 436 | 438 |
| 437 void syncRenderObject(SizedBox old) { | 439 void syncRenderObject(SizedBox old) { |
| 438 super.syncRenderObject(old); | 440 super.syncRenderObject(old); |
| 439 root.desiredSize = desiredSize; | 441 root.desiredSize = desiredSize; |
| 440 } | 442 } |
| 441 | 443 |
| 442 } | 444 } |
| 443 | 445 |
| 444 class ConstrainedBox extends OneChildRenderObjectWrapper { | 446 class ConstrainedBox extends OneChildRenderObjectWrapper { |
| 445 | 447 |
| 446 ConstrainedBox({ this.constraints, UINode child, Object key }) | 448 ConstrainedBox({ this.constraints, UINode child, Object key }) |
| 447 : super(child: child, key: key); | 449 : super(child: child, key: key); |
| 448 | 450 |
| 449 RenderConstrainedBox root; | 451 RenderConstrainedBox get root => super.root as RenderConstrainedBox; |
| 450 final BoxConstraints constraints; | 452 final BoxConstraints constraints; |
| 451 | 453 |
| 452 RenderConstrainedBox createNode() => new RenderConstrainedBox(additionalConstr
aints: constraints); | 454 RenderConstrainedBox createNode() => new RenderConstrainedBox(additionalConstr
aints: constraints); |
| 453 | 455 |
| 454 void syncRenderObject(ConstrainedBox old) { | 456 void syncRenderObject(ConstrainedBox old) { |
| 455 super.syncRenderObject(old); | 457 super.syncRenderObject(old); |
| 456 root.additionalConstraints = constraints; | 458 root.additionalConstraints = constraints; |
| 457 } | 459 } |
| 458 | 460 |
| 459 } | 461 } |
| 460 | 462 |
| 461 class ShrinkWrapWidth extends OneChildRenderObjectWrapper { | 463 class ShrinkWrapWidth extends OneChildRenderObjectWrapper { |
| 462 | 464 |
| 463 ShrinkWrapWidth({ UINode child, Object key }) : super(child: child, key: key); | 465 ShrinkWrapWidth({ UINode child, Object key }) : super(child: child, key: key); |
| 464 | 466 |
| 465 RenderShrinkWrapWidth root; | 467 RenderShrinkWrapWidth get root => super.root as RenderShrinkWrapWidth; |
| 466 | 468 |
| 467 RenderShrinkWrapWidth createNode() => new RenderShrinkWrapWidth(); | 469 RenderShrinkWrapWidth createNode() => new RenderShrinkWrapWidth(); |
| 468 | 470 |
| 469 } | 471 } |
| 470 | 472 |
| 471 class Transform extends OneChildRenderObjectWrapper { | 473 class Transform extends OneChildRenderObjectWrapper { |
| 472 | 474 |
| 473 Transform({ this.transform, UINode child, Object key }) | 475 Transform({ this.transform, UINode child, Object key }) |
| 474 : super(child: child, key: key); | 476 : super(child: child, key: key); |
| 475 | 477 |
| 476 RenderTransform root; | 478 RenderTransform get root => super.root as RenderTransform; |
| 477 final Matrix4 transform; | 479 final Matrix4 transform; |
| 478 | 480 |
| 479 RenderTransform createNode() => new RenderTransform(transform: transform); | 481 RenderTransform createNode() => new RenderTransform(transform: transform); |
| 480 | 482 |
| 481 void syncRenderObject(Transform old) { | 483 void syncRenderObject(Transform old) { |
| 482 super.syncRenderObject(old); | 484 super.syncRenderObject(old); |
| 483 root.transform = transform; | 485 root.transform = transform; |
| 484 } | 486 } |
| 485 | 487 |
| 486 } | 488 } |
| 487 | 489 |
| 488 class SizeObserver extends OneChildRenderObjectWrapper { | 490 class SizeObserver extends OneChildRenderObjectWrapper { |
| 489 | 491 |
| 490 SizeObserver({ this.callback, UINode child, Object key }) | 492 SizeObserver({ this.callback, UINode child, Object key }) |
| 491 : super(child: child, key: key); | 493 : super(child: child, key: key); |
| 492 | 494 |
| 493 RenderSizeObserver root; | 495 RenderSizeObserver get root => super.root as RenderSizeObserver; |
| 494 final SizeChangedCallback callback; | 496 final SizeChangedCallback callback; |
| 495 | 497 |
| 496 RenderSizeObserver createNode() => new RenderSizeObserver(callback: callback); | 498 RenderSizeObserver createNode() => new RenderSizeObserver(callback: callback); |
| 497 | 499 |
| 498 void syncRenderObject(SizeObserver old) { | 500 void syncRenderObject(SizeObserver old) { |
| 499 super.syncRenderObject(old); | 501 super.syncRenderObject(old); |
| 500 root.callback = callback; | 502 root.callback = callback; |
| 501 } | 503 } |
| 502 | 504 |
| 503 void remove() { | 505 void remove() { |
| 504 root.callback = null; | 506 root.callback = null; |
| 505 super.remove(); | 507 super.remove(); |
| 506 } | 508 } |
| 507 | 509 |
| 508 } | 510 } |
| 509 | 511 |
| 510 // TODO(jackson) need a mechanism for marking the RenderCustomPaint as needing p
aint | 512 // TODO(jackson) need a mechanism for marking the RenderCustomPaint as needing p
aint |
| 511 class CustomPaint extends OneChildRenderObjectWrapper { | 513 class CustomPaint extends OneChildRenderObjectWrapper { |
| 512 | 514 |
| 513 CustomPaint({ this.callback, UINode child, Object key }) | 515 CustomPaint({ this.callback, UINode child, Object key }) |
| 514 : super(child: child, key: key); | 516 : super(child: child, key: key); |
| 515 | 517 |
| 516 RenderCustomPaint root; | 518 RenderCustomPaint get root => super.root as RenderCustomPaint; |
| 517 final CustomPaintCallback callback; | 519 final CustomPaintCallback callback; |
| 518 | 520 |
| 519 RenderCustomPaint createNode() => new RenderCustomPaint(callback: callback); | 521 RenderCustomPaint createNode() => new RenderCustomPaint(callback: callback); |
| 520 | 522 |
| 521 void syncRenderObject(CustomPaint old) { | 523 void syncRenderObject(CustomPaint old) { |
| 522 super.syncRenderObject(old); | 524 super.syncRenderObject(old); |
| 523 root.callback = callback; | 525 root.callback = callback; |
| 524 } | 526 } |
| 525 | 527 |
| 526 void remove() { | 528 void remove() { |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 assert(root == this.root); // TODO(ianh): Remove this once the analyzer is c
leverer | 715 assert(root == this.root); // TODO(ianh): Remove this once the analyzer is c
leverer |
| 714 } | 716 } |
| 715 | 717 |
| 716 } | 718 } |
| 717 | 719 |
| 718 class BlockContainer extends MultiChildRenderObjectWrapper { | 720 class BlockContainer extends MultiChildRenderObjectWrapper { |
| 719 | 721 |
| 720 BlockContainer({ Object key, List<UINode> children }) | 722 BlockContainer({ Object key, List<UINode> children }) |
| 721 : super(key: key, children: children); | 723 : super(key: key, children: children); |
| 722 | 724 |
| 723 RenderBlock root; | 725 RenderBlock get root => super.root as RenderBlock; |
| 724 RenderBlock createNode() => new RenderBlock(); | 726 RenderBlock createNode() => new RenderBlock(); |
| 725 | 727 |
| 726 } | 728 } |
| 727 | 729 |
| 728 class StackContainer extends MultiChildRenderObjectWrapper { | 730 class StackContainer extends MultiChildRenderObjectWrapper { |
| 729 | 731 |
| 730 StackContainer({ Object key, List<UINode> children }) | 732 StackContainer({ Object key, List<UINode> children }) |
| 731 : super(key: key, children: children); | 733 : super(key: key, children: children); |
| 732 | 734 |
| 733 RenderStack root; | 735 RenderStack get root => super.root as RenderStack; |
| 734 RenderStack createNode() => new RenderStack(); | 736 RenderStack createNode() => new RenderStack(); |
| 735 | 737 |
| 736 } | 738 } |
| 737 | 739 |
| 738 class StackPositionedChild extends ParentDataNode { | 740 class StackPositionedChild extends ParentDataNode { |
| 739 StackPositionedChild(UINode content, { | 741 StackPositionedChild(UINode content, { |
| 740 double top, double right, double bottom, double left | 742 double top, double right, double bottom, double left |
| 741 }) : super(content, new StackParentData()..top = top | 743 }) : super(content, new StackParentData()..top = top |
| 742 ..right = right | 744 ..right = right |
| 743 ..bottom = bottom | 745 ..bottom = bottom |
| 744 ..left = left); | 746 ..left = left); |
| 745 } | 747 } |
| 746 | 748 |
| 747 class Paragraph extends RenderObjectWrapper { | 749 class Paragraph extends RenderObjectWrapper { |
| 748 | 750 |
| 749 Paragraph({ Object key, this.text }) : super(key: key); | 751 Paragraph({ Object key, this.text }) : super(key: key); |
| 750 | 752 |
| 751 RenderParagraph root; | 753 RenderParagraph get root => super.root as RenderParagraph; |
| 752 RenderParagraph createNode() => new RenderParagraph(text: text); | 754 RenderParagraph createNode() => new RenderParagraph(text: text); |
| 753 | 755 |
| 754 final String text; | 756 final String text; |
| 755 | 757 |
| 756 void syncRenderObject(UINode old) { | 758 void syncRenderObject(UINode old) { |
| 757 super.syncRenderObject(old); | 759 super.syncRenderObject(old); |
| 758 root.text = text; | 760 root.text = text; |
| 759 } | 761 } |
| 760 | 762 |
| 761 void insert(RenderObjectWrapper child, dynamic slot) { | 763 void insert(RenderObjectWrapper child, dynamic slot) { |
| 762 assert(false); | 764 assert(false); |
| 763 // Paragraph does not support having children currently | 765 // Paragraph does not support having children currently |
| 764 } | 766 } |
| 765 | 767 |
| 766 } | 768 } |
| 767 | 769 |
| 768 class FlexContainer extends MultiChildRenderObjectWrapper { | 770 class FlexContainer extends MultiChildRenderObjectWrapper { |
| 769 | 771 |
| 770 FlexContainer({ | 772 FlexContainer({ |
| 771 Object key, | 773 Object key, |
| 772 List<UINode> children, | 774 List<UINode> children, |
| 773 this.direction: FlexDirection.horizontal, | 775 this.direction: FlexDirection.horizontal, |
| 774 this.justifyContent: FlexJustifyContent.flexStart | 776 this.justifyContent: FlexJustifyContent.flexStart |
| 775 }) : super(key: key, children: children); | 777 }) : super(key: key, children: children); |
| 776 | 778 |
| 777 RenderFlex root; | 779 RenderFlex get root => super.root as RenderFlex; |
| 778 RenderFlex createNode() => new RenderFlex(direction: this.direction); | 780 RenderFlex createNode() => new RenderFlex(direction: this.direction); |
| 779 | 781 |
| 780 final FlexDirection direction; | 782 final FlexDirection direction; |
| 781 final FlexJustifyContent justifyContent; | 783 final FlexJustifyContent justifyContent; |
| 782 | 784 |
| 783 void syncRenderObject(UINode old) { | 785 void syncRenderObject(UINode old) { |
| 784 super.syncRenderObject(old); | 786 super.syncRenderObject(old); |
| 785 root.direction = direction; | 787 root.direction = direction; |
| 786 root.justifyContent = justifyContent; | 788 root.justifyContent = justifyContent; |
| 787 } | 789 } |
| 788 | 790 |
| 789 } | 791 } |
| 790 | 792 |
| 791 class FlexExpandingChild extends ParentDataNode { | 793 class FlexExpandingChild extends ParentDataNode { |
| 792 FlexExpandingChild(UINode content, { int flex: 1, Object key }) | 794 FlexExpandingChild(UINode content, { int flex: 1, Object key }) |
| 793 : super(content, new FlexBoxParentData()..flex = flex, key: key); | 795 : super(content, new FlexBoxParentData()..flex = flex, key: key); |
| 794 } | 796 } |
| 795 | 797 |
| 796 class Image extends RenderObjectWrapper { | 798 class Image extends RenderObjectWrapper { |
| 797 | 799 |
| 798 Image({ | 800 Image({ |
| 799 Object key, | 801 Object key, |
| 800 this.src, | 802 this.src, |
| 801 this.size | 803 this.size |
| 802 }) : super(key: key); | 804 }) : super(key: key); |
| 803 | 805 |
| 804 RenderImage root; | 806 RenderImage get root => super.root as RenderImage; |
| 805 RenderImage createNode() => new RenderImage(this.src, this.size); | 807 RenderImage createNode() => new RenderImage(this.src, this.size); |
| 806 | 808 |
| 807 final String src; | 809 final String src; |
| 808 final Size size; | 810 final Size size; |
| 809 | 811 |
| 810 void syncRenderObject(UINode old) { | 812 void syncRenderObject(UINode old) { |
| 811 super.syncRenderObject(old); | 813 super.syncRenderObject(old); |
| 812 root.src = src; | 814 root.src = src; |
| 813 root.requestedSize = size; | 815 root.requestedSize = size; |
| 814 } | 816 } |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 _currentOrder = _order; | 964 _currentOrder = _order; |
| 963 _currentlyBuilding = this; | 965 _currentlyBuilding = this; |
| 964 _built = build(); | 966 _built = build(); |
| 965 assert(_built != null); | 967 assert(_built != null); |
| 966 _currentlyBuilding = null; | 968 _currentlyBuilding = null; |
| 967 _currentOrder = lastOrder; | 969 _currentOrder = lastOrder; |
| 968 | 970 |
| 969 _built = syncChild(_built, oldBuilt, slot); | 971 _built = syncChild(_built, oldBuilt, slot); |
| 970 assert(_built != null); | 972 assert(_built != null); |
| 971 _dirty = false; | 973 _dirty = false; |
| 972 root = _built.root; | 974 _root = _built.root; |
| 975 assert(_root == root); // in case a subclass reintroduces it |
| 973 assert(root != null); | 976 assert(root != null); |
| 974 } | 977 } |
| 975 | 978 |
| 976 void _buildIfDirty() { | 979 void _buildIfDirty() { |
| 977 assert(!_disqualifiedFromEverAppearingAgain); | 980 assert(!_disqualifiedFromEverAppearingAgain); |
| 978 if (!_dirty || !_mounted) | 981 if (!_dirty || !_mounted) |
| 979 return; | 982 return; |
| 980 | 983 |
| 981 assert(root != null); | 984 assert(root != null); |
| 982 _sync(null, _slot); | 985 _sync(null, _slot); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 } | 1098 } |
| 1096 | 1099 |
| 1097 } | 1100 } |
| 1098 | 1101 |
| 1099 class Text extends Component { | 1102 class Text extends Component { |
| 1100 Text(this.data) : super(key: '*text*'); | 1103 Text(this.data) : super(key: '*text*'); |
| 1101 final String data; | 1104 final String data; |
| 1102 bool get interchangeable => true; | 1105 bool get interchangeable => true; |
| 1103 UINode build() => new Paragraph(text: data); | 1106 UINode build() => new Paragraph(text: data); |
| 1104 } | 1107 } |
| OLD | NEW |