Changeset 102837 in webkit
- Timestamp:
- Dec 14, 2011 3:39:24 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r102834 r102837 1 2011-12-14 Ojan Vafai <ojan@chromium.org> 2 3 Implement flexDirection and flexWrap and make flexFlow a proper shorthand. 4 https://bugs.webkit.org/show_bug.cgi?id=74542 5 6 Reviewed by Tony Chang. 7 8 * css3/flexbox/css-properties-expected.txt: 9 * css3/flexbox/script-tests/css-properties.js: 10 (testFlexFlowValue): 11 1 12 2011-12-14 Ryosuke Niwa <rniwa@webkit.org> 2 13 -
trunk/LayoutTests/css3/flexbox/css-properties-expected.txt
r102486 r102837 44 44 PASS flexbox.style.webkitFlexAlign is "" 45 45 PASS window.getComputedStyle(flexbox, null).webkitFlexAlign is "stretch" 46 PASS flexbox.style.webkitFlexDirection is "" 47 PASS window.getComputedStyle(flexbox, null).webkitFlexDirection is "row" 48 PASS flexbox.style.webkitFlexDirection is "" 49 PASS flexbox.style.webkitFlexDirection is "row" 50 PASS window.getComputedStyle(flexbox, null).webkitFlexDirection is "row" 51 PASS flexbox.style.webkitFlexDirection is "row-reverse" 52 PASS window.getComputedStyle(flexbox, null).webkitFlexDirection is "row-reverse" 53 PASS flexbox.style.webkitFlexDirection is "column" 54 PASS window.getComputedStyle(flexbox, null).webkitFlexDirection is "column" 55 PASS flexbox.style.webkitFlexDirection is "column-reverse" 56 PASS window.getComputedStyle(flexbox, null).webkitFlexDirection is "column-reverse" 57 PASS flexbox.style.webkitFlexWrap is "" 58 PASS window.getComputedStyle(flexbox, null).webkitFlexWrap is "nowrap" 59 PASS flexbox.style.webkitFlexWrap is "" 60 PASS flexbox.style.webkitFlexWrap is "nowrap" 61 PASS window.getComputedStyle(flexbox, null).webkitFlexWrap is "nowrap" 62 PASS flexbox.style.webkitFlexWrap is "wrap" 63 PASS window.getComputedStyle(flexbox, null).webkitFlexWrap is "wrap" 64 PASS flexbox.style.webkitFlexWrap is "wrap-reverse" 65 PASS window.getComputedStyle(flexbox, null).webkitFlexWrap is "wrap-reverse" 46 66 PASS flexbox.style.webkitFlexFlow is "" 47 67 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row nowrap" … … 49 69 PASS flexbox.style.webkitFlexFlow is "" 50 70 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row nowrap" 51 PASS flexbox.style.webkitFlexFlow is " row nowrap"71 PASS flexbox.style.webkitFlexFlow is "" 52 72 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row nowrap" 53 PASS flexbox.style.webkitFlexFlow is "row wrap" 73 PASS flexbox.style.webkitFlexFlow is "nowrap" 74 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row nowrap" 75 PASS flexbox.style.webkitFlexFlow is "nowrap" 76 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row nowrap" 77 PASS flexbox.style.webkitFlexFlow is "wrap" 54 78 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row wrap" 55 PASS flexbox.style.webkitFlexFlow is "row wrap-reverse" 79 PASS flexbox.style.webkitFlexFlow is "wrap" 80 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row wrap" 81 PASS flexbox.style.webkitFlexFlow is "wrap-reverse" 82 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row wrap-reverse" 83 PASS flexbox.style.webkitFlexFlow is "wrap-reverse" 56 84 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row wrap-reverse" 57 85 PASS flexbox.style.webkitFlexFlow is "row" 86 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row nowrap" 87 PASS flexbox.style.webkitFlexFlow is "row" 88 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row nowrap" 89 PASS flexbox.style.webkitFlexFlow is "row nowrap" 58 90 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row nowrap" 59 91 PASS flexbox.style.webkitFlexFlow is "row nowrap" … … 61 93 PASS flexbox.style.webkitFlexFlow is "row wrap" 62 94 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row wrap" 95 PASS flexbox.style.webkitFlexFlow is "row wrap" 96 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row wrap" 97 PASS flexbox.style.webkitFlexFlow is "row wrap-reverse" 98 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row wrap-reverse" 63 99 PASS flexbox.style.webkitFlexFlow is "row wrap-reverse" 64 100 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row wrap-reverse" 65 101 PASS flexbox.style.webkitFlexFlow is "row-reverse" 102 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row-reverse nowrap" 103 PASS flexbox.style.webkitFlexFlow is "row-reverse" 104 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row-reverse nowrap" 105 PASS flexbox.style.webkitFlexFlow is "row-reverse nowrap" 66 106 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row-reverse nowrap" 67 107 PASS flexbox.style.webkitFlexFlow is "row-reverse nowrap" … … 69 109 PASS flexbox.style.webkitFlexFlow is "row-reverse wrap" 70 110 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row-reverse wrap" 111 PASS flexbox.style.webkitFlexFlow is "row-reverse wrap" 112 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row-reverse wrap" 113 PASS flexbox.style.webkitFlexFlow is "row-reverse wrap-reverse" 114 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row-reverse wrap-reverse" 71 115 PASS flexbox.style.webkitFlexFlow is "row-reverse wrap-reverse" 72 116 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row-reverse wrap-reverse" 73 117 PASS flexbox.style.webkitFlexFlow is "column" 118 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "column nowrap" 119 PASS flexbox.style.webkitFlexFlow is "column" 120 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "column nowrap" 121 PASS flexbox.style.webkitFlexFlow is "column nowrap" 74 122 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "column nowrap" 75 123 PASS flexbox.style.webkitFlexFlow is "column nowrap" … … 77 125 PASS flexbox.style.webkitFlexFlow is "column wrap" 78 126 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "column wrap" 127 PASS flexbox.style.webkitFlexFlow is "column wrap" 128 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "column wrap" 129 PASS flexbox.style.webkitFlexFlow is "column wrap-reverse" 130 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "column wrap-reverse" 79 131 PASS flexbox.style.webkitFlexFlow is "column wrap-reverse" 80 132 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "column wrap-reverse" 81 133 PASS flexbox.style.webkitFlexFlow is "column-reverse" 134 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "column-reverse nowrap" 135 PASS flexbox.style.webkitFlexFlow is "column-reverse" 136 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "column-reverse nowrap" 137 PASS flexbox.style.webkitFlexFlow is "column-reverse nowrap" 82 138 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "column-reverse nowrap" 83 139 PASS flexbox.style.webkitFlexFlow is "column-reverse nowrap" … … 85 141 PASS flexbox.style.webkitFlexFlow is "column-reverse wrap" 86 142 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "column-reverse wrap" 143 PASS flexbox.style.webkitFlexFlow is "column-reverse wrap" 144 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "column-reverse wrap" 145 PASS flexbox.style.webkitFlexFlow is "column-reverse wrap-reverse" 146 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "column-reverse wrap-reverse" 87 147 PASS flexbox.style.webkitFlexFlow is "column-reverse wrap-reverse" 88 148 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "column-reverse wrap-reverse" … … 91 151 PASS flexbox.style.webkitFlexFlow is "" 92 152 PASS flexbox.style.webkitFlexFlow is "" 153 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row nowrap" 154 PASS flexbox.style.webkitFlexFlow is "column" 155 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "column nowrap" 156 PASS flexbox.style.webkitFlexFlow is "column wrap" 157 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "column wrap" 158 PASS flexbox.style.webkitFlexFlow is "row-reverse wrap-reverse" 159 PASS window.getComputedStyle(flexbox, null).webkitFlexFlow is "row-reverse wrap-reverse" 93 160 PASS successfullyParsed is true 94 161 -
trunk/LayoutTests/css3/flexbox/script-tests/css-properties.js
r102486 r102837 101 101 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitFlexAlign', 'stretch'); 102 102 103 shouldBeEqualToString('flexbox.style.webkitFlexDirection', ''); 104 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitFlexDirection', 'row'); 105 106 flexbox.style.webkitFlexDirection = 'foo'; 107 shouldBeEqualToString('flexbox.style.webkitFlexDirection', ''); 108 109 flexbox.style.webkitFlexDirection = 'row'; 110 shouldBeEqualToString('flexbox.style.webkitFlexDirection', 'row'); 111 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitFlexDirection', 'row'); 112 113 flexbox.style.webkitFlexDirection = 'row-reverse'; 114 shouldBeEqualToString('flexbox.style.webkitFlexDirection', 'row-reverse'); 115 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitFlexDirection', 'row-reverse'); 116 117 flexbox.style.webkitFlexDirection = 'column'; 118 shouldBeEqualToString('flexbox.style.webkitFlexDirection', 'column'); 119 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitFlexDirection', 'column'); 120 121 flexbox.style.webkitFlexDirection = 'column-reverse'; 122 shouldBeEqualToString('flexbox.style.webkitFlexDirection', 'column-reverse'); 123 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitFlexDirection', 'column-reverse'); 124 125 shouldBeEqualToString('flexbox.style.webkitFlexWrap', ''); 126 // The initial value is 'stretch'. 127 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitFlexWrap', 'nowrap'); 128 129 flexbox.style.webkitFlexWrap = 'foo'; 130 shouldBeEqualToString('flexbox.style.webkitFlexWrap', ''); 131 132 flexbox.style.webkitFlexWrap = 'nowrap'; 133 shouldBeEqualToString('flexbox.style.webkitFlexWrap', 'nowrap'); 134 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitFlexWrap', 'nowrap'); 135 136 flexbox.style.webkitFlexWrap = 'wrap'; 137 shouldBeEqualToString('flexbox.style.webkitFlexWrap', 'wrap'); 138 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitFlexWrap', 'wrap'); 139 140 flexbox.style.webkitFlexWrap = 'wrap-reverse'; 141 shouldBeEqualToString('flexbox.style.webkitFlexWrap', 'wrap-reverse'); 142 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitFlexWrap', 'wrap-reverse'); 143 144 flexbox.style.webkitFlexFlow = ''; 103 145 shouldBeEqualToString('flexbox.style.webkitFlexFlow', ''); 104 146 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitFlexFlow', 'row nowrap'); … … 107 149 shouldBeEqualToString('flexbox.style.webkitFlexFlow', ''); 108 150 109 var flows = ['', 'row', 'row-reverse', 'column', 'column-reverse']; 151 function testFlexFlowValue(value, expected, expectedComputed) 152 { 153 flexbox.style.webkitFlexFlow = value; 154 shouldBeEqualToString('flexbox.style.webkitFlexFlow', expected.replace(/^ /, '').replace(/ $/, '')); 155 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitFlexFlow', expectedComputed); 156 } 157 158 var directions = ['', 'row', 'row-reverse', 'column', 'column-reverse']; 110 159 var wraps = ['', 'nowrap', 'wrap', 'wrap-reverse']; 111 flows.forEach(function(flow) {160 directions.forEach(function(direction) { 112 161 wraps.forEach(function(wrap) { 113 flexbox.style.webkitFlexFlow = flow + ' ' + wrap; 114 shouldBeEqualToString('flexbox.style.webkitFlexFlow', (flow + ' ' + wrap).replace(/^ /, '').replace(/ $/, '')); 115 if (!flow) 116 flow = 'row'; 117 if (!wrap) 118 wrap = 'nowrap'; 119 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitFlexFlow', flow + ' ' + wrap); 162 var expectedComputed = (direction || 'row') + ' ' + (wrap || 'nowrap'); 163 var expected = direction + ' ' + wrap; 164 testFlexFlowValue(direction + ' ' + wrap, expected, expectedComputed); 165 testFlexFlowValue(wrap + ' ' + direction, expected, expectedComputed); 120 166 }); 121 167 }); 122 168 123 169 flexbox.style.webkitFlexFlow = ''; 170 shouldBeEqualToString('flexbox.style.webkitFlexFlow', ''); 124 171 flexbox.style.webkitFlexFlow = 'wrap wrap-reverse'; 125 shouldBeEqualToString('flexbox.style.webkitFlexFlow', '');126 flexbox.style.webkitFlexFlow = 'wrap-reverse column';127 shouldBeEqualToString('flexbox.style.webkitFlexFlow', '');128 flexbox.style.webkitFlexFlow = 'wrap row';129 172 shouldBeEqualToString('flexbox.style.webkitFlexFlow', ''); 130 173 flexbox.style.webkitFlexFlow = 'column row'; 131 174 shouldBeEqualToString('flexbox.style.webkitFlexFlow', ''); 132 175 176 flexbox.style.webkitFlexFlow = ''; 177 shouldBeEqualToString('flexbox.style.webkitFlexFlow', ''); 178 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitFlexFlow', 'row nowrap'); 179 flexbox.style.webkitFlexDirection = 'column'; 180 shouldBeEqualToString('flexbox.style.webkitFlexFlow', 'column'); 181 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitFlexFlow', 'column nowrap'); 182 flexbox.style.webkitFlexWrap = 'wrap'; 183 shouldBeEqualToString('flexbox.style.webkitFlexFlow', 'column wrap'); 184 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitFlexFlow', 'column wrap'); 185 flexbox.style.webkitFlexFlow = 'row-reverse wrap-reverse'; 186 shouldBeEqualToString('flexbox.style.webkitFlexFlow', 'row-reverse wrap-reverse'); 187 shouldBeEqualToString('window.getComputedStyle(flexbox, null).webkitFlexFlow', 'row-reverse wrap-reverse'); 188 189 133 190 successfullyParsed = true; -
trunk/Source/WebCore/ChangeLog
r102836 r102837 1 2011-12-14 Ojan Vafai <ojan@chromium.org> 2 3 Implement flexDirection and flexWrap and make flexFlow a proper shorthand. 4 https://bugs.webkit.org/show_bug.cgi?id=74542 5 6 Reviewed by Tony Chang. 7 8 In a followup patch, I'll cleanup all the *Flow methods in RenderFlexibleBox. 9 10 Existing tests cover all the rendering behaviors, so only need to test 11 the css property parsing. 12 13 * css/CSSComputedStyleDeclaration.cpp: 14 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 15 * css/CSSMutableStyleDeclaration.cpp: 16 (WebCore::CSSMutableStyleDeclaration::getPropertyValue): 17 * css/CSSParser.cpp: 18 (WebCore::CSSParser::parseValue): 19 * css/CSSPrimitiveValueMappings.h: 20 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): 21 (WebCore::CSSPrimitiveValue::operator EFlexDirection): 22 * css/CSSProperty.cpp: 23 (WebCore::CSSProperty::isInheritedProperty): 24 * css/CSSPropertyLonghand.cpp: 25 (WebCore::initShorthandMap): 26 * css/CSSPropertyNames.in: 27 * css/CSSStyleApplyProperty.cpp: 28 (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty): 29 * css/CSSStyleSelector.cpp: 30 (WebCore::CSSStyleSelector::applyProperty): 31 * rendering/RenderBox.cpp: 32 (WebCore::RenderBox::sizesToIntrinsicLogicalWidth): 33 * rendering/RenderFlexibleBox.cpp: 34 (WebCore::RenderFlexibleBox::isColumnFlow): 35 (WebCore::RenderFlexibleBox::isLeftToRightFlow): 36 (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): 37 (WebCore::RenderFlexibleBox::alignChildren): 38 * rendering/style/RenderStyle.h: 39 (WebCore::InheritedFlags::flexDirection): 40 (WebCore::InheritedFlags::isColumnFlexDirection): 41 (WebCore::InheritedFlags::setFlexDirection): 42 (WebCore::InheritedFlags::initialFlexDirection): 43 * rendering/style/RenderStyleConstants.h: 44 * rendering/style/StyleFlexibleBoxData.cpp: 45 (WebCore::StyleFlexibleBoxData::StyleFlexibleBoxData): 46 (WebCore::StyleFlexibleBoxData::operator==): 47 * rendering/style/StyleFlexibleBoxData.h: 48 1 49 2011-12-13 Jon Lee <jonlee@apple.com> 2 50 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r102486 r102837 219 219 CSSPropertyWebkitFlexPack, 220 220 CSSPropertyWebkitFlexAlign, 221 CSSPropertyWebkitFlexDirection, 221 222 CSSPropertyWebkitFlexFlow, 223 CSSPropertyWebkitFlexWrap, 222 224 CSSPropertyWebkitFontSmoothing, 223 225 #if ENABLE(CSS_GRID_LAYOUT) … … 1485 1487 case CSSPropertyWebkitFlexAlign: 1486 1488 return cssValuePool->createValue(style->flexAlign()); 1489 case CSSPropertyWebkitFlexDirection: 1490 return cssValuePool->createValue(style->flexDirection()); 1491 case CSSPropertyWebkitFlexWrap: 1492 return cssValuePool->createValue(style->flexWrap()); 1487 1493 case CSSPropertyWebkitFlexFlow: { 1488 1494 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 1489 list->append(cssValuePool->createValue(style->flex Flow()));1495 list->append(cssValuePool->createValue(style->flexDirection())); 1490 1496 list->append(cssValuePool->createValue(style->flexWrap())); 1491 1497 return list.release(); -
trunk/Source/WebCore/css/CSSMutableStyleDeclaration.cpp
r102721 r102837 286 286 CSSPropertyBorderBottomStyle, CSSPropertyBorderLeftStyle }; 287 287 return get4Values(properties); 288 } 289 case CSSPropertyWebkitFlexFlow: { 290 const int properties[] = { CSSPropertyWebkitFlexDirection, CSSPropertyWebkitFlexWrap }; 291 return getShorthandValue(properties); 288 292 } 289 293 case CSSPropertyFont: -
trunk/Source/WebCore/css/CSSParser.cpp
r102560 r102837 1621 1621 validPrimitive = id == CSSValueStart || id == CSSValueEnd || id == CSSValueCenter || id == CSSValueBaseline || id == CSSValueStretch; 1622 1622 break; 1623 case CSSPropertyWebkitFlexFlow: 1624 // FIXME: Use parseShorthand once we add flex-direction and flex-wrap. 1625 // [ row | row-reverse | column | column-reverse ] || [ nowrap | wrap | wrap-reverse ]? 1623 case CSSPropertyWebkitFlexDirection: 1626 1624 validPrimitive = id == CSSValueRow || id == CSSValueRowReverse || id == CSSValueColumn || id == CSSValueColumnReverse; 1627 if (!validPrimitive) 1628 validPrimitive = id == CSSValueNowrap || id == CSSValueWrap || id == CSSValueWrapReverse; 1629 else if (validPrimitive && num == 2) { 1630 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 1631 list->append(cssValuePool()->createIdentifierValue(id)); 1632 1633 value = m_valueList->next(); 1634 if (value->id != CSSValueNowrap && value->id != CSSValueWrap && value->id != CSSValueWrapReverse) 1635 return false; 1636 1637 list->append(cssValuePool()->createIdentifierValue(value->id)); 1638 addProperty(propId, list, important); 1639 return true; 1640 } 1625 break; 1626 case CSSPropertyWebkitFlexWrap: 1627 validPrimitive = id == CSSValueNowrap || id == CSSValueWrap || id == CSSValueWrapReverse; 1641 1628 break; 1642 1629 case CSSPropertyWebkitMarquee: { … … 2133 2120 CSSPropertyPaddingBottom, CSSPropertyPaddingLeft }; 2134 2121 return parse4Values(propId, properties, important); 2122 } 2123 case CSSPropertyWebkitFlexFlow: 2124 { 2125 const int properties[] = { CSSPropertyWebkitFlexDirection, CSSPropertyWebkitFlexWrap }; 2126 return parseShorthand(propId, properties, 2, important); 2135 2127 } 2136 2128 case CSSPropertyFont: -
trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h
r102486 r102837 1201 1201 } 1202 1202 1203 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlex Flowe)1203 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlexDirection e) 1204 1204 : CSSValue(PrimitiveClass) 1205 1205 { … … 1221 1221 } 1222 1222 1223 template<> inline CSSPrimitiveValue::operator EFlex Flow() const1223 template<> inline CSSPrimitiveValue::operator EFlexDirection() const 1224 1224 { 1225 1225 switch (m_value.ident) { -
trunk/Source/WebCore/css/CSSProperty.cpp
r101288 r102837 560 560 case CSSPropertyWebkitFlexPack: 561 561 case CSSPropertyWebkitFlexAlign: 562 case CSSPropertyWebkitFlexDirection: 562 563 case CSSPropertyWebkitFlexFlow: 564 case CSSPropertyWebkitFlexWrap: 563 565 case CSSPropertyWebkitFontSizeDelta: 564 566 #if ENABLE(CSS_GRID_LAYOUT) -
trunk/Source/WebCore/css/CSSPropertyLonghand.cpp
r101078 r102837 92 92 SET_SHORTHAND_MAP_ENTRY(shorthandMap, CSSPropertyBorderSpacing, borderSpacingProperties); 93 93 94 static const int flexFlowProperties[] = { CSSPropertyWebkitFlexDirection, CSSPropertyWebkitFlexWrap }; 95 SET_SHORTHAND_MAP_ENTRY(shorthandMap, CSSPropertyWebkitFlexFlow, flexFlowProperties); 96 94 97 static const int listStyleProperties[] = { 95 98 CSSPropertyListStyleImage, -
trunk/Source/WebCore/css/CSSPropertyNames.in
r101288 r102837 255 255 #endif 256 256 -webkit-flex-align 257 -webkit-flex-direction 257 258 -webkit-flex-flow 258 259 -webkit-flex-order 259 260 -webkit-flex-pack 261 -webkit-flex-wrap 260 262 -webkit-font-size-delta 261 263 -webkit-highlight -
trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp
r102650 r102837 1337 1337 }; 1338 1338 1339 class ApplyPropertyFlexFlow {1340 public:1341 static void applyInheritValue(CSSStyleSelector*) { }1342 1343 static void applyInitialValue(CSSStyleSelector* selector)1344 {1345 selector->style()->setFlexFlow(RenderStyle::initialFlexFlow());1346 selector->style()->setFlexWrap(RenderStyle::initialFlexWrap());1347 }1348 1349 static void applyValue(CSSStyleSelector* selector, CSSValue* value)1350 {1351 if (value->isPrimitiveValue()) {1352 selector->style()->setFlexFlow(*static_cast<CSSPrimitiveValue*>(value));1353 return;1354 }1355 if (value->isValueList()) {1356 CSSValueList* list = static_cast<CSSValueList*>(value);1357 if (list->length() != 2)1358 return;1359 1360 selector->style()->setFlexFlow(*static_cast<CSSPrimitiveValue*>(list->itemWithoutBoundsCheck(0)));1361 selector->style()->setFlexWrap(*static_cast<CSSPrimitiveValue*>(list->itemWithoutBoundsCheck(1)));1362 }1363 }1364 1365 static PropertyHandler createHandler()1366 {1367 return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue);1368 }1369 };1370 1371 1339 class ApplyPropertyDisplay { 1372 1340 private: … … 1554 1522 setPropertyHandler(CSSPropertyWebkitFlexPack, ApplyPropertyDefault<EFlexPack, &RenderStyle::flexPack, EFlexPack, &RenderStyle::setFlexPack, EFlexPack, &RenderStyle::initialFlexPack>::createHandler()); 1555 1523 setPropertyHandler(CSSPropertyWebkitFlexAlign, ApplyPropertyDefault<EFlexAlign, &RenderStyle::flexAlign, EFlexAlign, &RenderStyle::setFlexAlign, EFlexAlign, &RenderStyle::initialFlexAlign>::createHandler()); 1556 setPropertyHandler(CSSPropertyWebkitFlexFlow, ApplyPropertyFlexFlow::createHandler()); 1524 setPropertyHandler(CSSPropertyWebkitFlexDirection, ApplyPropertyDefault<EFlexDirection, &RenderStyle::flexDirection, EFlexDirection, &RenderStyle::setFlexDirection, EFlexDirection, &RenderStyle::initialFlexDirection>::createHandler()); 1525 setPropertyHandler(CSSPropertyWebkitFlexWrap, ApplyPropertyDefault<EFlexWrap, &RenderStyle::flexWrap, EFlexWrap, &RenderStyle::setFlexWrap, EFlexWrap, &RenderStyle::initialFlexWrap>::createHandler()); 1526 setPropertyHandler(CSSPropertyWebkitFlexFlow, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitFlexDirection, CSSPropertyWebkitFlexWrap>::createHandler()); 1557 1527 1558 1528 setPropertyHandler(CSSPropertyFontStyle, ApplyPropertyFont<FontItalic, &FontDescription::italic, &FontDescription::setItalic, FontItalicOff>::createHandler()); -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r102835 r102837 3802 3802 case CSSPropertyWebkitFlexPack: 3803 3803 case CSSPropertyWebkitFlexAlign: 3804 case CSSPropertyWebkitFlexDirection: 3804 3805 case CSSPropertyWebkitFlexFlow: 3806 case CSSPropertyWebkitFlexWrap: 3805 3807 case CSSPropertyFontStyle: 3806 3808 case CSSPropertyFontVariant: -
trunk/Source/WebCore/rendering/RenderBox.cpp
r102787 r102837 1796 1796 // In the case of columns that have a stretch alignment, we go ahead and layout at the 1797 1797 // stretched size to avoid an extra layout when applying alignment. 1798 if (parent()->isFlexibleBox() && (!parent()->style()->isColumnFlex Flow() || style()->flexAlign() != AlignStretch))1798 if (parent()->isFlexibleBox() && (!parent()->style()->isColumnFlexDirection() || style()->flexAlign() != AlignStretch)) 1799 1799 return true; 1800 1800 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r102090 r102837 204 204 bool RenderFlexibleBox::isColumnFlow() const 205 205 { 206 return style()->isColumnFlex Flow();206 return style()->isColumnFlexDirection(); 207 207 } 208 208 … … 218 218 if (isColumnFlow()) 219 219 return style()->writingMode() == TopToBottomWritingMode || style()->writingMode() == LeftToRightWritingMode; 220 return style()->isLeftToRightDirection() ^ (style()->flex Flow() == FlowRowReverse);220 return style()->isLeftToRightDirection() ^ (style()->flexDirection() == FlowRowReverse); 221 221 } 222 222 … … 637 637 } 638 638 639 if (style()->flex Flow() == FlowColumnReverse) {639 if (style()->flexDirection() == FlowColumnReverse) { 640 640 // We have to do an extra pass for column-reverse to reposition the flex items since the start depends 641 641 // on the height of the flexbox, which we only know after we've positioned all the flex items. … … 688 688 689 689 for (RenderBox* child = iterator.first(); child; child = iterator.next()) { 690 // direction:rtl + flex- flow:column means the cross-axis direction is flipped.690 // direction:rtl + flex-direction:column means the cross-axis direction is flipped. 691 691 if (!style()->isLeftToRightDirection() && isColumnFlow()) { 692 692 LayoutPoint location = flowAwareLocationForChild(child); -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r102486 r102837 726 726 EFlexPack flexPack() const { return static_cast<EFlexPack>(rareNonInheritedData->m_flexibleBox->m_flexPack); } 727 727 EFlexAlign flexAlign() const { return static_cast<EFlexAlign>(rareNonInheritedData->m_flexibleBox->m_flexAlign); } 728 EFlex Flow flexFlow() const { return static_cast<EFlexFlow>(rareNonInheritedData->m_flexibleBox->m_flexFlow); }729 bool isColumnFlex Flow() const { return flexFlow() == FlowColumn || flexFlow() == FlowColumnReverse; }728 EFlexDirection flexDirection() const { return static_cast<EFlexDirection>(rareNonInheritedData->m_flexibleBox->m_flexDirection); } 729 bool isColumnFlexDirection() const { return flexDirection() == FlowColumn || flexDirection() == FlowColumnReverse; } 730 730 EFlexWrap flexWrap() const { return static_cast<EFlexWrap>(rareNonInheritedData->m_flexibleBox->m_flexWrap); } 731 731 … … 1148 1148 void setFlexPack(EFlexPack p) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexPack, p); } 1149 1149 void setFlexAlign(EFlexAlign a) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexAlign, a); } 1150 void setFlex Flow(EFlexFlow flow) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexFlow, flow); }1150 void setFlexDirection(EFlexDirection direction) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexDirection, direction); } 1151 1151 void setFlexWrap(EFlexWrap w) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexWrap, w); } 1152 1152 #if ENABLE(CSS_GRID_LAYOUT) … … 1472 1472 static EFlexPack initialFlexPack() { return PackStart; } 1473 1473 static EFlexAlign initialFlexAlign() { return AlignStretch; } 1474 static EFlex Flow initialFlexFlow() { return FlowRow; }1474 static EFlexDirection initialFlexDirection() { return FlowRow; } 1475 1475 static EFlexWrap initialFlexWrap() { return FlexNoWrap; } 1476 1476 static int initialMarqueeLoopCount() { return -1; } -
trunk/Source/WebCore/rendering/style/RenderStyleConstants.h
r102486 r102837 178 178 enum EFlexPack { PackStart, PackEnd, PackCenter, PackJustify }; 179 179 enum EFlexAlign { AlignStart, AlignEnd, AlignCenter, AlignStretch, AlignBaseline }; 180 enum EFlex Flow{ FlowRow, FlowRowReverse, FlowColumn, FlowColumnReverse };180 enum EFlexDirection { FlowRow, FlowRowReverse, FlowColumn, FlowColumnReverse }; 181 181 enum EFlexWrap { FlexNoWrap, FlexWrap, FlexWrapReverse }; 182 182 -
trunk/Source/WebCore/rendering/style/StyleFlexibleBoxData.cpp
r102486 r102837 39 39 , m_flexPack(RenderStyle::initialFlexPack()) 40 40 , m_flexAlign(RenderStyle::initialFlexAlign()) 41 , m_flex Flow(RenderStyle::initialFlexFlow())41 , m_flexDirection(RenderStyle::initialFlexDirection()) 42 42 , m_flexWrap(RenderStyle::initialFlexWrap()) 43 43 { … … 53 53 , m_flexPack(o.m_flexPack) 54 54 , m_flexAlign(o.m_flexAlign) 55 , m_flex Flow(o.m_flexFlow)55 , m_flexDirection(o.m_flexDirection) 56 56 , m_flexWrap(o.m_flexWrap) 57 57 { … … 63 63 && m_heightPositiveFlex == o.m_heightPositiveFlex && m_heightNegativeFlex == o.m_heightNegativeFlex 64 64 && m_flexOrder == o.m_flexOrder && m_flexPack == o.m_flexPack && m_flexAlign == o.m_flexAlign 65 && m_flex Flow == o.m_flexFlow&& m_flexWrap == o.m_flexWrap;65 && m_flexDirection == o.m_flexDirection && m_flexWrap == o.m_flexWrap; 66 66 } 67 67 -
trunk/Source/WebCore/rendering/style/StyleFlexibleBoxData.h
r102486 r102837 52 52 unsigned m_flexPack : 2; // EFlexPack 53 53 unsigned m_flexAlign : 3; // EFlexAlign 54 unsigned m_flex Flow : 2; // EFlexFlow54 unsigned m_flexDirection : 2; // EFlexDirection 55 55 unsigned m_flexWrap : 2; // EFlexWrap 56 56
Note: See TracChangeset
for help on using the changeset viewer.