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

Unified Diff: sky/sdk/lib/widgets/tabs.dart

Issue 1217533002: Add RenderObject.childCount (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Removed extraneous blank lines 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/rendering/object.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/tabs.dart
diff --git a/sky/sdk/lib/widgets/tabs.dart b/sky/sdk/lib/widgets/tabs.dart
index 741594d2bf5bde7b5d2775a985ce93a26f829307..a0b615f39a839f5f6e15a7c1bcdf6b241a8f8ce1 100644
--- a/sky/sdk/lib/widgets/tabs.dart
+++ b/sky/sdk/lib/widgets/tabs.dart
@@ -63,11 +63,9 @@ class RenderTabBar extends RenderBox with
BoxConstraints widthConstraints =
new BoxConstraints(maxWidth: constraints.maxWidth, maxHeight: constraints.maxHeight);
double maxWidth = 0.0;
- int childCount = 0;
RenderBox child = firstChild;
while (child != null) {
maxWidth = math.max(maxWidth, child.getMinIntrinsicWidth(widthConstraints));
- ++childCount;
assert(child.parentData is TabBarParentData);
child = child.parentData.nextSibling;
}
@@ -78,11 +76,9 @@ class RenderTabBar extends RenderBox with
BoxConstraints widthConstraints =
new BoxConstraints(maxWidth: constraints.maxWidth, maxHeight: constraints.maxHeight);
double maxWidth = 0.0;
- int childCount = 0;
RenderBox child = firstChild;
while (child != null) {
maxWidth = math.max(maxWidth, child.getMaxIntrinsicWidth(widthConstraints));
- ++childCount;
assert(child.parentData is TabBarParentData);
child = child.parentData.nextSibling;
}
@@ -95,25 +91,12 @@ class RenderTabBar extends RenderBox with
double getMaxIntrinsicHeight(BoxConstraints constraints) => _getIntrinsicHeight(constraints);
- // TODO(hansmuller): track this value in the parent rather than computing it.
- int _childCount() {
- int childCount = 0;
- RenderBox child = firstChild;
- while (child != null) {
- ++childCount;
- assert(child.parentData is TabBarParentData);
- child = child.parentData.nextSibling;
- }
- return childCount;
- }
-
void performLayout() {
assert(constraints is BoxConstraints);
size = constraints.constrain(new Size(constraints.maxWidth, _kTabBarHeight));
assert(!size.isInfinite);
- int childCount = _childCount();
if (childCount == 0)
return;
« no previous file with comments | « sky/sdk/lib/rendering/object.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698