[webkit-reviews] review granted: [Bug 80552] implement flexbox wrap-reverse : [Attachment 130728] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 7 19:10:57 PST 2012


Ojan Vafai <ojan at chromium.org> has granted Tony Chang <tony at chromium.org>'s
request for review:
Bug 80552: implement flexbox wrap-reverse
https://bugs.webkit.org/show_bug.cgi?id=80552

Attachment 130728: Patch
https://bugs.webkit.org/attachment.cgi?id=130728&action=review

------- Additional Comments from Ojan Vafai <ojan at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=130728&action=review


> Source/WebCore/rendering/RenderFlexibleBox.cpp:130
> +	   return (crossAxisContentExtent - startOffset - lineHeight) -
startOffset;

Nit: I'd rather this be:
return crossAxisContentExtent - lineHeight - (2 * startOffset);

> Source/WebCore/rendering/RenderFlexibleBox.cpp:598
> +	  
wrapReverseContext.addNumberOfChildrenOnLine(orderedChildren.size());
> +	   wrapReverseContext.addCrossAxisOffset(crossAxisOffset);

Nit: I'd rather this be something like:
wrapReverseContext.add(crossAxisOffset, orderedChildren);

void WrapReverseContext::add(LayoutUnit crossAxisOffset, OrderedFlexItemList
childrenOnLine)
{
    if (!isWrapReverse)
	return;
    crossAxisOffsets.append(crossAxisOffset);
    childrenPerLine.append(childrenOnLine.size());
}

> Source/WebCore/rendering/RenderFlexibleBox.cpp:953
> +	       if (style()->flexWrap() == FlexWrapReverse)
> +		   adjustAlignmentForChild(child,
availableAlignmentSpaceForChild(lineCrossAxisExtent, child));

This could use a comment (e.g. FlexWrapReverse means that stretched children
should align to the cross-end edge)

> Source/WebCore/rendering/RenderFlexibleBox.cpp:991
> +	       switch (flexAlignForChild(child)) {
> +	       case AlignBaseline:
> +		   adjustAlignmentForChild(child, minMarginAfterBaseline);
> +		   break;
> +	       case AlignAuto:
> +	       case AlignStretch:
> +	       case AlignStart:
> +	       case AlignEnd:
> +	       case AlignCenter:
> +		   break;
> +	       }

Don't need the switch. Just make it an if statement.

> Source/WebCore/rendering/RenderFlexibleBox.cpp:1021
> +	   LayoutRect oldRect = child->frameRect();

Can you inline this to line 1024?

> Source/WebCore/rendering/RenderFlexibleBox.cpp:1026
> +	   ++currentChild;

Nit: I'd just put this in the if-statement below. I've certainly seen other
WebKit code that does.


More information about the webkit-reviews mailing list