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

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

Issue 994553003: Ensure that sky Nodes are in the document when didMount() is fired. Refactor FixedHeightScrollable … (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: typo Created 5 years, 9 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/examples/stocks-fn/stockrow.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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 240
241 bool _sync(Node old, sky.ParentNode host, sky.Node insertBefore) { 241 bool _sync(Node old, sky.ParentNode host, sky.Node insertBefore) {
242 // print("---Syncing children of $_key"); 242 // print("---Syncing children of $_key");
243 243
244 Element oldElement = old as Element; 244 Element oldElement = old as Element;
245 245
246 if (oldElement == null) { 246 if (oldElement == null) {
247 // print("...no oldElement, initial render"); 247 // print("...no oldElement, initial render");
248 248
249 _root = sky.document.createElement(_tagName); 249 _root = sky.document.createElement(_tagName);
250 _parentInsertBefore(host, _root, insertBefore);
250 _syncNode(); 251 _syncNode();
251 252
252 for (var child in _children) { 253 for (var child in _children) {
253 child._sync(null, _root, null); 254 child._sync(null, _root, null);
254 assert(child._root is sky.Node); 255 assert(child._root is sky.Node);
255 } 256 }
256 257
257 _parentInsertBefore(host, _root, insertBefore);
258 return false; 258 return false;
259 } 259 }
260 260
261 _root = oldElement._root; 261 _root = oldElement._root;
262 oldElement._root = null; 262 oldElement._root = null;
263 sky.Element root = (_root as sky.Element); 263 sky.Element root = (_root as sky.Element);
264 264
265 _syncNode(oldElement); 265 _syncNode(oldElement);
266 266
267 var startIndex = 0; 267 var startIndex = 0;
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 676
677 _sync(null, _host, null); 677 _sync(null, _host, null);
678 assert(_root is sky.Node); 678 assert(_root is sky.Node);
679 679
680 sw.stop(); 680 sw.stop();
681 if (_shouldLogRenderDuration) 681 if (_shouldLogRenderDuration)
682 print("Initial render: ${sw.elapsedMicroseconds} microseconds"); 682 print("Initial render: ${sw.elapsedMicroseconds} microseconds");
683 }); 683 });
684 } 684 }
685 } 685 }
OLDNEW
« no previous file with comments | « sky/examples/stocks-fn/stockrow.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698