Bug 73504 - Need to implement flex-flow: column-reverse
Summary: Need to implement flex-flow: column-reverse
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tony Chang
URL:
Keywords:
Depends on:
Blocks: 62048
  Show dependency treegraph
 
Reported: 2011-11-30 17:15 PST by Tony Chang
Modified: 2011-12-02 19:50 PST (History)
3 users (show)

See Also:


Attachments
Patch (29.68 KB, patch)
2011-12-01 15:22 PST, Tony Chang
no flags Details | Formatted Diff | Diff
Patch (30.05 KB, patch)
2011-12-01 15:26 PST, Tony Chang
no flags Details | Formatted Diff | Diff
Patch (32.28 KB, patch)
2011-12-02 13:57 PST, Tony Chang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Chang 2011-11-30 17:15:48 PST
It's not currently implemented.

I'm splitting this off from row reverse because it's considerably more complicated due to needing to repaint above the start of the box.
Comment 1 Tony Chang 2011-12-01 15:22:19 PST
Created attachment 117501 [details]
Patch
Comment 2 Tony Chang 2011-12-01 15:26:20 PST
Created attachment 117502 [details]
Patch
Comment 3 Ojan Vafai 2011-12-01 18:57:41 PST
Comment on attachment 117502 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=117502&action=review

> Source/WebCore/rendering/RenderFlexibleBox.cpp:635
> +        computeLogicalHeight();

If you move this out of the if-statement, you can remove the last computeLogicalHeight() call in layoutBlock(), right?

> Source/WebCore/rendering/RenderFlexibleBox.cpp:646
> +    // This is similar to the logic in layoutAndPlaceChildren, except we place the children
> +    // starting from the end of the flexbox. We also don't need to layout anything since we're
> +    // just moving the children to a new position.

Do we really need to duplicate all this logic? It is not sufficient to just flip the children?
Comment 4 Tony Chang 2011-12-02 13:57:52 PST
Created attachment 117685 [details]
Patch
Comment 5 Tony Chang 2011-12-02 13:59:05 PST
(In reply to comment #3)
> (From update of attachment 117502 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=117502&action=review
> 
> > Source/WebCore/rendering/RenderFlexibleBox.cpp:635
> > +        computeLogicalHeight();
> 
> If you move this out of the if-statement, you can remove the last computeLogicalHeight() call in layoutBlock(), right?

If we do that, then in the non-column-reverse case, we lose the overflow (clientLogicalBottom() will be called after we set the height to the computed height).

> > Source/WebCore/rendering/RenderFlexibleBox.cpp:646
> > +    // This is similar to the logic in layoutAndPlaceChildren, except we place the children
> > +    // starting from the end of the flexbox. We also don't need to layout anything since we're
> > +    // just moving the children to a new position.
> 
> Do we really need to duplicate all this logic? It is not sufficient to just flip the children?

It's a bit complicated because of how the padding and margins are applied. Based on offline discussion, I consolidated the flex-pack logic into some helper functions to cut down on duplicate code.
Comment 6 Ojan Vafai 2011-12-02 14:13:12 PST
Comment on attachment 117685 [details]
Patch

LGTM. I'll leave it for Hyatt to r+ though.
Comment 7 Dave Hyatt 2011-12-02 14:23:42 PST
Comment on attachment 117685 [details]
Patch

r=me
Comment 8 WebKit Review Bot 2011-12-02 19:50:41 PST
Comment on attachment 117685 [details]
Patch

Clearing flags on attachment: 117685

Committed r101897: <http://trac.webkit.org/changeset/101897>
Comment 9 WebKit Review Bot 2011-12-02 19:50:46 PST
All reviewed patches have been landed.  Closing bug.