implement -webkit-flex-order
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Sep 2011 04:54:42 +0000 (04:54 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Sep 2011 04:54:42 +0000 (04:54 +0000)
commita61f407d5a070fbc2f7148cbe74e2743754c8941
treed97ed71c8ab05f231ced813303bf3646fbe4ff04
parent52da3ae53fcb49f65d44b3ff7b5478966a929794
implement -webkit-flex-order
https://bugs.webkit.org/show_bug.cgi?id=67432

Reviewed by Ojan Vafai.

Source/WebCore:

flex-order can be an int (including negative), but we disallow the two
smallest values so we can put the numbers into a hash set.

Also, create two iterators: one that goes in render tree order (we use
this for the first pass and to collect the possible flex order values)
and one that goes in flex order.

Test: css3/flexbox/flex-order.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
* rendering/RenderFlexibleBox.cpp:
(WebCore::FlexOrderHashTraits::emptyValue):
(WebCore::FlexOrderHashTraits::constructDeletedValue):
(WebCore::FlexOrderHashTraits::isDeletedValue):
(WebCore::RenderFlexibleBox::TreeOrderIterator::TreeOrderIterator): A simple iterator
    that goes in render tree order.
(WebCore::RenderFlexibleBox::TreeOrderIterator::next):
(WebCore::RenderFlexibleBox::TreeOrderIterator::reset):
(WebCore::RenderFlexibleBox::TreeOrderIterator::flexOrderValues):
(WebCore::RenderFlexibleBox::FlexOrderIterator::FlexOrderIterator): An iterator that
    goes in flex-order order.  Creating this involves sorting, so only create it once
    and pass it around.
(WebCore::RenderFlexibleBox::FlexOrderIterator::first):
(WebCore::RenderFlexibleBox::FlexOrderIterator::next):
(WebCore::RenderFlexibleBox::FlexOrderIterator::reset):
(WebCore::RenderFlexibleBox::layoutHorizontalBlock):
(WebCore::RenderFlexibleBox::computePreferredLogicalWidth):
(WebCore::RenderFlexibleBox::runFreeSpaceAllocationAlgorithmInlineDirection):
(WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection):
* rendering/RenderFlexibleBox.h:

LayoutTests:

* css3/flexbox/flex-order-expected.png: Added.
* css3/flexbox/flex-order-expected.txt: Added.
* css3/flexbox/flex-order.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/css3/flexbox/flex-order-expected.png [new file with mode: 0644]
LayoutTests/css3/flexbox/flex-order-expected.txt [new file with mode: 0644]
LayoutTests/css3/flexbox/flex-order.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSParser.cpp
Source/WebCore/rendering/RenderFlexibleBox.cpp
Source/WebCore/rendering/RenderFlexibleBox.h