Skip to content
  • tony@chromium.org's avatar
    implement -webkit-flex-order · a61f407d
    tony@chromium.org authored
    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
    a61f407d