| 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 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 _dirty = false; | 879 _dirty = false; |
| 880 _root = _built._root; | 880 _root = _built._root; |
| 881 assert(_root != null); | 881 assert(_root != null); |
| 882 } | 882 } |
| 883 | 883 |
| 884 void _buildIfDirty() { | 884 void _buildIfDirty() { |
| 885 if (!_dirty || _defunct) | 885 if (!_dirty || _defunct) |
| 886 return; | 886 return; |
| 887 | 887 |
| 888 _trace('$_key rebuilding...'); | 888 _trace('$_key rebuilding...'); |
| 889 _sync(null, null, null); // TODO(ianh): figure out how passing "null, null,
null" here is ok | 889 _sync(null, _root.parent, _root.parent.childAfter(_root)); |
| 890 } | 890 } |
| 891 | 891 |
| 892 void scheduleBuild() { | 892 void scheduleBuild() { |
| 893 setState(() {}); | 893 setState(() {}); |
| 894 } | 894 } |
| 895 | 895 |
| 896 void setState(Function fn()) { | 896 void setState(Function fn()) { |
| 897 _stateful = true; | 897 _stateful = true; |
| 898 fn(); | 898 fn(); |
| 899 if (_isBuilding || _dirty || _defunct) | 899 if (_isBuilding || _dirty || _defunct) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 922 _sync(null, _host, _root); | 922 _sync(null, _host, _root); |
| 923 } | 923 } |
| 924 } | 924 } |
| 925 | 925 |
| 926 class Text extends Component { | 926 class Text extends Component { |
| 927 Text(this.data) : super(key: '*text*'); | 927 Text(this.data) : super(key: '*text*'); |
| 928 final String data; | 928 final String data; |
| 929 bool get interchangeable => true; | 929 bool get interchangeable => true; |
| 930 UINode build() => new Paragraph(children: [new TextFragment(data)]); | 930 UINode build() => new Paragraph(children: [new TextFragment(data)]); |
| 931 } | 931 } |
| OLD | NEW |