From 08dbc60abd3a6da27591df1792d5e7b287702032 Mon Sep 17 00:00:00 2001 From: Ojan Vafai Date: Mon, 6 Apr 2015 12:53:35 -0700 Subject: [PATCH] Make custom layout actually work. -Temporarily add setting override width as well so that we correctly bypass in RenderBox::computeLogicalWidth. -Add setNeedsLayout so that the author code can force layouts (e.g. when the container's width changes). -Have setLayoutManager force a reattach of the element if it's renderer wasn't a custom layout one before. -Remove the laying out of children from RenderCustomLayout::layout. This is the job of the author code. -Add a test case. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/1055263002 --- .../flutter/tests/layout/custom-expected.txt | 6 ++ engine/src/flutter/tests/layout/custom.sky | 85 +++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 engine/src/flutter/tests/layout/custom-expected.txt create mode 100644 engine/src/flutter/tests/layout/custom.sky diff --git a/engine/src/flutter/tests/layout/custom-expected.txt b/engine/src/flutter/tests/layout/custom-expected.txt new file mode 100644 index 00000000000..6b56ff06943 --- /dev/null +++ b/engine/src/flutter/tests/layout/custom-expected.txt @@ -0,0 +1,6 @@ +CONSOLE: unittest-suite-wait-for-done +CONSOLE: PASS: should have the right sizes after layout +CONSOLE: +CONSOLE: All 1 tests passed. +CONSOLE: unittest-suite-success +DONE diff --git a/engine/src/flutter/tests/layout/custom.sky b/engine/src/flutter/tests/layout/custom.sky new file mode 100644 index 00000000000..fc7399930e3 --- /dev/null +++ b/engine/src/flutter/tests/layout/custom.sky @@ -0,0 +1,85 @@ + + + + + + + +