5 Commits

Author SHA1 Message Date
Ojan Vafai
fc1dff4288 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
2015-04-24 13:14:41 -07:00
Ojan Vafai
6bfa21b190 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
2015-04-06 12:53:35 -07:00
Ojan Vafai
ef34102c3b Revert "Revert "First iteration on custom layout.""
This reverts commit 44cf3b689cda2632fa649e2cd3fdbfcb7174f352.
https://codereview.chromium.org/1060443002 fixes the cause
of the test breakage.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1055243002
2015-04-02 15:17:10 -07:00
Benjamin Lerman
f1ee3cc379 Revert "First iteration on custom layout."
This reverts commit 4223122b79f5f7740bb2957138d14a63a2cea8d2.

This breaks sky tests.

TBR=ojan@chromium.org

Review URL: https://codereview.chromium.org/1051713007
2015-04-02 10:38:03 +02:00
Ojan Vafai
aecc73f1f5 First iteration on custom layout.
This allows setting x/y/width/height directly on an element
during a synchronous layout callback. At the moment, you can do
dangerous things (e.g. change tree structure). In a followup patch
we'll make that impossible via an IDL guard.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1023753007
2015-04-01 19:16:29 -07:00