Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: sky/framework/fn.dart

Issue 1092423003: [Effen] Reduce splashes when scrolling. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fix comments from eseidel Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/framework/components/scrollable.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 enum _SyncOperation { IDENTICAL, INSERTION, STATEFUL, STATELESS, REMOVAL } 56 enum _SyncOperation { IDENTICAL, INSERTION, STATEFUL, STATELESS, REMOVAL }
57 57
58 /* 58 /*
59 * All Effen nodes derive from UINode. All nodes have a _parent, a _key and 59 * All Effen nodes derive from UINode. All nodes have a _parent, a _key and
60 * can be sync'd. 60 * can be sync'd.
61 */ 61 */
62 abstract class UINode { 62 abstract class UINode {
63 String _key; 63 String _key;
64 UINode _parent; 64 UINode _parent;
65 UINode get parent => _parent;
65 sky.Node _root; 66 sky.Node _root;
66 bool _defunct = false; 67 bool _defunct = false;
67 68
68 UINode({ Object key }) { 69 UINode({ Object key }) {
69 _key = key == null ? "$runtimeType" : "$runtimeType-$key"; 70 _key = key == null ? "$runtimeType" : "$runtimeType-$key";
70 } 71 }
71 72
72 // Subclasses which implements Nodes that become stateful may return true 73 // Subclasses which implements Nodes that become stateful may return true
73 // if the |old| node has become stateful and should be retained. 74 // if the |old| node has become stateful and should be retained.
74 bool _willSync(UINode old) => false; 75 bool _willSync(UINode old) => false;
75 76
76 void _sync(UINode old, sky.ParentNode host, sky.Node insertBefore); 77 void _sync(UINode old, sky.ParentNode host, sky.Node insertBefore);
77 78
78 void _remove() { 79 void _remove() {
79 _defunct = true; 80 _defunct = true;
80 _root = null; 81 _root = null;
82 handleRemoved();
81 } 83 }
84 void handleRemoved() { }
82 85
83 int _nodeDepth; 86 int _nodeDepth;
84 void _ensureDepth() { 87 void _ensureDepth() {
85 if (_nodeDepth == null) { 88 if (_nodeDepth == null) {
86 if (_parent != null) { 89 if (_parent != null) {
87 _parent._ensureDepth(); 90 _parent._ensureDepth();
88 _nodeDepth = _parent._nodeDepth + 1; 91 _nodeDepth = _parent._nodeDepth + 1;
89 } else { 92 } else {
90 _nodeDepth = 0; 93 _nodeDepth = 0;
91 } 94 }
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 928
926 abstract class App extends Component { 929 abstract class App extends Component {
927 sky.Node _host; 930 sky.Node _host;
928 931
929 App() : super(stateful: true) { 932 App() : super(stateful: true) {
930 _host = sky.document.createElement('div'); 933 _host = sky.document.createElement('div');
931 sky.document.appendChild(_host); 934 sky.document.appendChild(_host);
932 _scheduleComponentForRender(this); 935 _scheduleComponentForRender(this);
933 } 936 }
934 } 937 }
OLDNEW
« no previous file with comments | « sky/framework/components/scrollable.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698