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

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

Issue 1086983004: [Effen] We need to update the layout manager in _syncNode() also, (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: update per ojan's comments 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 | « no previous file | 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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 style: style, 600 style: style,
601 inlineStyle: inlineStyle 601 inlineStyle: inlineStyle
602 ); 602 );
603 603
604 sky.Node _createNode() { 604 sky.Node _createNode() {
605 var result = super._createNode(); 605 var result = super._createNode();
606 result.setLayoutManager(() => layout(_root)); 606 result.setLayoutManager(() => layout(_root));
607 return result; 607 return result;
608 } 608 }
609 609
610 // If we ever reuse sky nodes for different classes, then we should
611 // call _root.setLayoutManager(null) during _remove() here.
612
610 void _syncNode(SkyNodeWrapper old) { 613 void _syncNode(SkyNodeWrapper old) {
611 super._syncNode(old); 614 super._syncNode(old);
615 _root.setLayoutManager(() => layout(_root));
612 _root.setNeedsLayout(); 616 _root.setNeedsLayout();
613 } 617 }
614 618
615 void layout(sky.Element skyNode); 619 void layout(sky.Element skyNode);
616 // set skyNode.width (e.g., set it to skyNode.parentNode.width) 620 // set skyNode.width (e.g., set it to skyNode.parentNode.width)
617 // for each skyNode.getChildNodes()[i]: 621 // for each skyNode.getChildNodes()[i]:
618 // call .layout() 622 // call .layout()
619 // set .x, .y 623 // set .x, .y
620 // set .width if you want to force a width 624 // set .width if you want to force a width
621 // set .height if you want to force a height 625 // set .height if you want to force a height
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 925
922 abstract class App extends Component { 926 abstract class App extends Component {
923 sky.Node _host; 927 sky.Node _host;
924 928
925 App() : super(stateful: true) { 929 App() : super(stateful: true) {
926 _host = sky.document.createElement('div'); 930 _host = sky.document.createElement('div');
927 sky.document.appendChild(_host); 931 sky.document.appendChild(_host);
928 _scheduleComponentForRender(this); 932 _scheduleComponentForRender(this);
929 } 933 }
930 } 934 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698