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

Side by Side Diff: sky/sdk/lib/framework/rendering/node.dart

Issue 1160013004: Implement RenderImage and Image for Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Implement code review feedback from Adam and improve demo Created 5 years, 6 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
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 import '../node.dart'; 5 import '../node.dart';
6 import '../scheduler.dart' as scheduler; 6 import '../scheduler.dart' as scheduler;
7 import 'dart:math' as math; 7 import 'dart:math' as math;
8 import 'dart:sky' as sky; 8 import 'dart:sky' as sky;
9 9
10 class ParentData { 10 class ParentData {
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 ChildType _child; 222 ChildType _child;
223 ChildType get child => _child; 223 ChildType get child => _child;
224 void set child (ChildType value) { 224 void set child (ChildType value) {
225 if (_child != null) 225 if (_child != null)
226 dropChild(_child); 226 dropChild(_child);
227 _child = value; 227 _child = value;
228 if (_child != null) 228 if (_child != null)
229 adoptChild(_child); 229 adoptChild(_child);
230 markNeedsLayout(); 230 markNeedsLayout();
231 } 231 }
232 void attachChildren() {
233 if (_child != null)
234 _child.attach();
235 }
236 void detachChildren() {
237 if (_child != null)
238 _child.detach();
239 }
abarth-chromium 2015/06/03 17:53:22 Ideally we'd have a test case that covers this bug
jackson 2015/06/03 22:06:26 Agree, I will investigate after landing this.
232 } 240 }
233 241
234 242
235 // GENERIC MIXIN FOR RENDER NODES WITH A LIST OF CHILDREN 243 // GENERIC MIXIN FOR RENDER NODES WITH A LIST OF CHILDREN
236 244
237 abstract class ContainerParentDataMixin<ChildType extends RenderNode> { 245 abstract class ContainerParentDataMixin<ChildType extends RenderNode> {
238 ChildType previousSibling; 246 ChildType previousSibling;
239 ChildType nextSibling; 247 ChildType nextSibling;
240 void detachSiblings() { 248 void detachSiblings() {
241 if (previousSibling != null) { 249 if (previousSibling != null) {
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 } 382 }
375 } 383 }
376 384
377 ChildType get firstChild => _firstChild; 385 ChildType get firstChild => _firstChild;
378 ChildType get lastChild => _lastChild; 386 ChildType get lastChild => _lastChild;
379 ChildType childAfter(ChildType child) { 387 ChildType childAfter(ChildType child) {
380 assert(child.parentData is ParentDataType); 388 assert(child.parentData is ParentDataType);
381 return child.parentData.nextSibling; 389 return child.parentData.nextSibling;
382 } 390 }
383 } 391 }
OLDNEW
« sky/sdk/lib/framework/rendering/box.dart ('K') | « sky/sdk/lib/framework/rendering/box.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698