add css parsing for flex-flow: wrap and wrap-reverse
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Dec 2011 23:50:16 +0000 (23:50 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Dec 2011 23:50:16 +0000 (23:50 +0000)
commitd1edc26b6c3d131e98501533d2436173e85f8466
tree09899101cdee297f1c8d08aa353d680971fc0a4c
parentdf7334004ddb635784d69f598659f163e79577a7
add css parsing for flex-flow: wrap and wrap-reverse
https://bugs.webkit.org/show_bug.cgi?id=74008

Patch by Tony Chang <tony@chromium.org> on 2011-12-09
Reviewed by Ojan Vafai.

Source/WebCore:

Also save 2 bits in StyleFlexibleBoxData by changing the size of m_flexFlow (there are only 4 enum values).

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Print the wrap value if it exists.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue): Parse a second token and put the values into a CSSValueList.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator EFlexWrap):
* css/CSSStyleApplyProperty.cpp:
(WebCore::ApplyPropertyFlexFlow::applyInheritValue): Does not inherit.
(WebCore::ApplyPropertyFlexFlow::applyInitialValue):
(WebCore::ApplyPropertyFlexFlow::applyValue): Special handler for setting two render style values from one
CSS property.
(WebCore::ApplyPropertyFlexFlow::createHandler):
(WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):
* css/CSSValueKeywords.in:
* rendering/style/RenderStyle.h:
(WebCore::InheritedFlags::flexWrap):
(WebCore::InheritedFlags::setFlexWrap):
(WebCore::InheritedFlags::initialFlexWrap):
* rendering/style/RenderStyleConstants.h: EFlexWrap to hold flex wrap values.
* rendering/style/StyleFlexibleBoxData.cpp:
(WebCore::StyleFlexibleBoxData::StyleFlexibleBoxData):
(WebCore::StyleFlexibleBoxData::operator==):
* rendering/style/StyleFlexibleBoxData.h: 2 bits is enough to hold the 4 flexFlow values.

LayoutTests:

* css3/flexbox/css-properties-expected.txt:
* css3/flexbox/script-tests/css-properties.js: Test call combinations of flex-flow values.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@102486 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/flexbox/css-properties-expected.txt
LayoutTests/css3/flexbox/script-tests/css-properties.js
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSStyleApplyProperty.cpp
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/rendering/style/StyleFlexibleBoxData.cpp
Source/WebCore/rendering/style/StyleFlexibleBoxData.h