From 675ce1c882c892c3f28b6ff8028382a065b5d9d4 Mon Sep 17 00:00:00 2001 From: Ojan Vafai Date: Fri, 24 Apr 2015 13:14:41 -0700 Subject: [PATCH] Expose minContentWidth/maxContentWidth and a callback for computing them. This exposes the last hooks needed to implement flexbox layout. For now, I didn't worry too much about the exact API we're exposing since this will all change with the upcoming redesign (e.g. https://codereview.chromium.org/1093633002). minContentWidth == the width if the element were to wrap at every wrapping point (not including border/padding) maxContentWidth == the width if the element were to only wrap at hard wrapping points (e.g. \n inside a whitespace: pre). R=eseidel@chromium.org Review URL: https://codereview.chromium.org/1101793003 --- .../tests/layout/custom-dirty-bits.sky | 2 +- .../flutter/tests/layout/custom-expected.txt | 3 +- engine/src/flutter/tests/layout/custom.sky | 137 +++++++++++------- 3 files changed, 87 insertions(+), 55 deletions(-) diff --git a/engine/src/flutter/tests/layout/custom-dirty-bits.sky b/engine/src/flutter/tests/layout/custom-dirty-bits.sky index ec5b750956..d8ecf25085 100644 --- a/engine/src/flutter/tests/layout/custom-dirty-bits.sky +++ b/engine/src/flutter/tests/layout/custom-dirty-bits.sky @@ -11,6 +11,6 @@ void main() { // don't need laying out. // This test passes if it doesn't crash and the render tree // has no RenderTexts. - document.querySelector('block').setLayoutManager(() => {}); + document.querySelector('block').setLayoutManager(() {}, () {}); } diff --git a/engine/src/flutter/tests/layout/custom-expected.txt b/engine/src/flutter/tests/layout/custom-expected.txt index 6b56ff0694..3ad6888a02 100644 --- a/engine/src/flutter/tests/layout/custom-expected.txt +++ b/engine/src/flutter/tests/layout/custom-expected.txt @@ -1,6 +1,7 @@ CONSOLE: unittest-suite-wait-for-done CONSOLE: PASS: should have the right sizes after layout +CONSOLE: PASS: intrinsic sizes should apply CONSOLE: -CONSOLE: All 1 tests passed. +CONSOLE: All 2 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 index e212a6e7a0..538fa75441 100644 --- a/engine/src/flutter/tests/layout/custom.sky +++ b/engine/src/flutter/tests/layout/custom.sky @@ -7,6 +7,12 @@ + + + + + +