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

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

Issue 1162023010: Don't crash when removing a radio button (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: more asserts 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
« 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 import 'dart:math' as math; 5 import 'dart:math' as math;
6 import 'dart:sky' as sky; 6 import 'dart:sky' as sky;
7 import 'dart:typed_data'; 7 import 'dart:typed_data';
8 import 'object.dart'; 8 import 'object.dart';
9 import 'package:vector_math/vector_math.dart'; 9 import 'package:vector_math/vector_math.dart';
10 import 'package:sky/framework/net/image_cache.dart' as image_cache; 10 import 'package:sky/framework/net/image_cache.dart' as image_cache;
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 RenderCustomPaint({ 673 RenderCustomPaint({
674 CustomPaintCallback callback, 674 CustomPaintCallback callback,
675 RenderBox child 675 RenderBox child
676 }) : super(child) { 676 }) : super(child) {
677 assert(callback != null); 677 assert(callback != null);
678 _callback = callback; 678 _callback = callback;
679 } 679 }
680 680
681 CustomPaintCallback _callback; 681 CustomPaintCallback _callback;
682 void set callback (CustomPaintCallback value) { 682 void set callback (CustomPaintCallback value) {
683 assert(value != null); 683 assert(value != null || !attached);
684 if (_callback == value) 684 if (_callback == value)
685 return; 685 return;
686 _callback = value; 686 _callback = value;
687 markNeedsPaint(); 687 markNeedsPaint();
688 } 688 }
689 689
690 void attach() {
691 assert(_callback != null);
692 super.attach();
693 }
694
690 void paint(RenderObjectDisplayList canvas) { 695 void paint(RenderObjectDisplayList canvas) {
696 assert(_callback != null);
691 _callback(canvas); 697 _callback(canvas);
692 super.paint(canvas); 698 super.paint(canvas);
693 } 699 }
694 } 700 }
695 701
696 // RENDER VIEW LAYOUT MANAGER 702 // RENDER VIEW LAYOUT MANAGER
697 703
698 class ViewConstraints { 704 class ViewConstraints {
699 705
700 const ViewConstraints({ 706 const ViewConstraints({
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 799
794 void defaultPaint(RenderObjectDisplayList canvas) { 800 void defaultPaint(RenderObjectDisplayList canvas) {
795 RenderBox child = firstChild; 801 RenderBox child = firstChild;
796 while (child != null) { 802 while (child != null) {
797 assert(child.parentData is ParentDataType); 803 assert(child.parentData is ParentDataType);
798 canvas.paintChild(child, child.parentData.position); 804 canvas.paintChild(child, child.parentData.position);
799 child = child.parentData.nextSibling; 805 child = child.parentData.nextSibling;
800 } 806 }
801 } 807 }
802 } 808 }
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