Changeset 124276 in webkit
- Timestamp:
- Jul 31, 2012 5:44:18 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r124258 r124276 1 2012-07-31 Tony Chang <tony@chromium.org> 2 3 -webkit-order should take an integer, not a number 4 https://bugs.webkit.org/show_bug.cgi?id=92688 5 6 Reviewed by Ojan Vafai. 7 8 Update tests. 9 10 * css3/flexbox/css-properties-expected.txt: 11 * css3/flexbox/css-properties.html: 12 * css3/flexbox/flex-order.html: 13 1 14 2012-07-31 Luke Macpherson <macpherson@chromium.org> 2 15 -
trunk/LayoutTests/css3/flexbox/css-properties-expected.txt
r121026 r124276 14 14 PASS flexitem.style.webkitOrder is "0" 15 15 PASS flexitem.style.webkitOrder is "0" 16 PASS flexitem.style.webkitOrder is " 1.5"16 PASS flexitem.style.webkitOrder is "0" 17 17 PASS flexitem.style.webkitOrder is "" 18 18 PASS flexbox.style.webkitJustifyContent is "" -
trunk/LayoutTests/css3/flexbox/css-properties.html
r121026 r124276 41 41 shouldBeEqualToString('flexitem.style.webkitOrder', '0'); 42 42 43 // -webkit-order must be an integer. 44 flexitem.style.webkitOrder = 1.5; 45 shouldBeEqualToString('flexitem.style.webkitOrder', '0'); 46 43 47 flexitem.style.webkitOrder = "test"; 44 48 shouldBeEqualToString('flexitem.style.webkitOrder', '0'); 45 46 flexitem.style.webkitOrder = 1.5;47 shouldBeEqualToString('flexitem.style.webkitOrder', '1.5');48 49 49 50 flexitem.style.webkitOrder = ''; -
trunk/LayoutTests/css3/flexbox/flex-order.html
r120100 r124276 73 73 </div> 74 74 75 <!-- Decimal numbers are OK. -->75 <!-- Floating numbers are ignored and we use the default of 1 instead. --> 76 76 <div class="horizontal-box"> 77 <div class=" fourth" style="-webkit-order: 2.5"></div>78 <div class=" third" style="-webkit-order: 1.1"></div>79 <div class="first" style="-webkit-order: -1 .7"></div>80 <div class=" second"style=""></div>77 <div class="second" style="-webkit-order: 2.5"></div> 78 <div class="fourth" style="-webkit-order: 2"></div> 79 <div class="first" style="-webkit-order: -1"></div> 80 <div class="third" style=""></div> 81 81 </div> 82 82 … … 88 88 </div> 89 89 90 <!-- Values greater than what can be stored in a float are clamped. --> 90 <!-- Values greater than what can be stored in an int are clamped from 91 -2,147,483,646 (int min + 2) to 2,147,483,647. --> 91 92 <div class="horizontal-box"> 92 <div class="third" style="-webkit-order: 99999999999999999999999999999999999999999"></div>93 <div class="fourth" style="-webkit-order: 88888888888888888888888888888888888888888"></div>93 <div class="third" style="-webkit-order: 4000000000"></div> 94 <div class="fourth" style="-webkit-order: 3000000000"></div> 94 95 <div class="first" style=""></div> 95 96 <div class="second" style="-webkit-order: 2147483646"></div> … … 97 98 98 99 <div class="horizontal-box"> 99 <div class=" fourth" style="-webkit-order: 4000000000"></div>100 <div class="second" style="-webkit-order: 4000000000"></div> 100 101 <div class="third" style="-webkit-order: 3000000000"></div> 101 102 <div class="first" style=""></div> 102 <div class=" second" style="-webkit-order: 2147483647"></div>103 <div class="fourth" style="-webkit-order: 2147483647"></div> 103 104 </div> 104 105 105 106 <div class="horizontal-box"> 106 <div class=" first" style="-webkit-order: -99999999999999999999999999999999999999999"></div>107 <div class=" second" style="-webkit-order: -88888888888888888888888888888888888888888"></div>108 <div class=" third" style="-webkit-order: -77777777777777777777777777777777777777777"></div>107 <div class="third" style="-webkit-order: -2147483645"></div> 108 <div class="first" style="-webkit-order: -2147483646"></div> 109 <div class="second" style="-webkit-order: -2147483647"></div> 109 110 <div class="fourth" style=""></div> 110 111 </div> -
trunk/Source/WebCore/ChangeLog
r124275 r124276 1 2012-07-31 Tony Chang <tony@chromium.org> 2 3 -webkit-order should take an integer, not a number 4 https://bugs.webkit.org/show_bug.cgi?id=92688 5 6 Reviewed by Ojan Vafai. 7 8 The spec changed back from floats to integers: 9 http://lists.w3.org/Archives/Public/www-style/2012Jul/0607.html 10 11 Tests: css3/flexbox/css-properties.html: Updated. 12 css3/flexbox/flex-order.html: Test cases modified. 13 14 15 * css/CSSComputedStyleDeclaration.cpp: 16 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 17 * css/CSSParser.cpp: 18 (WebCore::CSSParser::parseValue): 19 * css/StyleBuilder.cpp: 20 (WebCore::StyleBuilder::StyleBuilder): 21 * rendering/RenderFlexibleBox.cpp: 22 (WebCore): 23 (RenderFlexibleBox::OrderHashTraits): 24 (WebCore::RenderFlexibleBox::OrderHashTraits::emptyValue): 25 (WebCore::RenderFlexibleBox::OrderHashTraits::constructDeletedValue): 26 (WebCore::RenderFlexibleBox::OrderHashTraits::isDeletedValue): 27 (RenderFlexibleBox::OrderIterator): 28 * rendering/RenderFlexibleBox.h: 29 * rendering/style/RenderStyle.h: 30 * rendering/style/StyleRareNonInheritedData.h: 31 (StyleRareNonInheritedData): 32 1 33 2012-07-31 James Robinson <jamesr@chromium.org> 2 34 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r123379 r124276 1690 1690 return cssValuePool().createValue(style->justifyContent()); 1691 1691 case CSSPropertyWebkitOrder: 1692 return cssValuePool().createValue(style->order() );1692 return cssValuePool().createValue(style->order(), CSSPrimitiveValue::CSS_NUMBER); 1693 1693 #endif 1694 1694 case CSSPropertyFloat: -
trunk/Source/WebCore/css/CSSParser.cpp
r124233 r124276 2292 2292 break; 2293 2293 case CSSPropertyWebkitOrder: 2294 validPrimitive = validUnit(value, FNumber); 2294 if (validUnit(value, FInteger, CSSStrictMode)) { 2295 // We restrict the smallest value to int min + 2 because we use int min and int min + 1 as special values in a hash set. 2296 parsedValue = cssValuePool().createValue(max(static_cast<double>(std::numeric_limits<int>::min() + 2), value->fValue), 2297 static_cast<CSSPrimitiveValue::UnitTypes>(value->unit)); 2298 m_valueList->next(); 2299 } 2295 2300 break; 2296 2301 #endif -
trunk/Source/WebCore/css/StyleBuilder.cpp
r122896 r124276 1997 1997 setPropertyHandler(CSSPropertyWebkitFlexWrap, ApplyPropertyDefault<EFlexWrap, &RenderStyle::flexWrap, EFlexWrap, &RenderStyle::setFlexWrap, EFlexWrap, &RenderStyle::initialFlexWrap>::createHandler()); 1998 1998 setPropertyHandler(CSSPropertyWebkitJustifyContent, ApplyPropertyDefault<EJustifyContent, &RenderStyle::justifyContent, EJustifyContent, &RenderStyle::setJustifyContent, EJustifyContent, &RenderStyle::initialJustifyContent>::createHandler()); 1999 setPropertyHandler(CSSPropertyWebkitOrder, ApplyPropertyDefault< float, &RenderStyle::order, float, &RenderStyle::setOrder, float, &RenderStyle::initialOrder>::createHandler());1999 setPropertyHandler(CSSPropertyWebkitOrder, ApplyPropertyDefault<int, &RenderStyle::order, int, &RenderStyle::setOrder, int, &RenderStyle::initialOrder>::createHandler()); 2000 2000 #endif 2001 2001 #if ENABLE(CSS_REGIONS) -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r124168 r124276 40 40 namespace WebCore { 41 41 42 // Normally, -1 and 0 are not valid in a HashSet, but these are relatively likely order: values. Instead, 43 // we make the two smallest int values invalid order: values (in the css parser code we clamp them to 44 // int min + 2). 45 struct RenderFlexibleBox::OrderHashTraits : WTF::GenericHashTraits<int> { 46 static const bool emptyValueIsZero = false; 47 static int emptyValue() { return std::numeric_limits<int>::min(); } 48 static void constructDeletedValue(int& slot) { slot = std::numeric_limits<int>::min() + 1; } 49 static bool isDeletedValue(int value) { return value == std::numeric_limits<int>::min() + 1; } 50 }; 51 42 52 class RenderFlexibleBox::OrderIterator { 43 53 public: … … 90 100 RenderFlexibleBox* m_flexibleBox; 91 101 RenderBox* m_currentChild; 92 Vector< float> m_orderValues;93 Vector< float>::const_iterator m_orderValuesIterator;102 Vector<int> m_orderValues; 103 Vector<int>::const_iterator m_orderValuesIterator; 94 104 }; 95 105 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.h
r123909 r124276 63 63 }; 64 64 65 typedef HashSet<float> OrderHashSet; 65 struct OrderHashTraits; 66 typedef HashSet<int, DefaultHash<int>::Hash, OrderHashTraits> OrderHashSet; 66 67 67 68 class OrderIterator; -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r123379 r124276 799 799 EBoxPack boxPack() const { return static_cast<EBoxPack>(rareNonInheritedData->m_deprecatedFlexibleBox->pack); } 800 800 801 float order() const { return rareNonInheritedData->m_order; }801 int order() const { return rareNonInheritedData->m_order; } 802 802 float flexGrow() const { return rareNonInheritedData->m_flexibleBox->m_flexGrow; } 803 803 float flexShrink() const { return rareNonInheritedData->m_flexibleBox->m_flexShrink; } … … 1269 1269 void setFlexShrink(float f) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexShrink, f); } 1270 1270 void setFlexBasis(Length length) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexBasis, length); } 1271 void setOrder( float o) { SET_VAR(rareNonInheritedData, m_order, o); }1271 void setOrder(int o) { SET_VAR(rareNonInheritedData, m_order, o); } 1272 1272 void setAlignContent(EAlignContent p) { SET_VAR(rareNonInheritedData, m_alignContent, p); } 1273 1273 void setAlignItems(EAlignItems a) { SET_VAR(rareNonInheritedData, m_alignItems, a); } … … 1611 1611 static float initialFlexShrink() { return 1; } 1612 1612 static Length initialFlexBasis() { return Length(Auto); } 1613 static float initialOrder() { return 0; }1613 static int initialOrder() { return 0; } 1614 1614 static EAlignContent initialAlignContent() { return AlignContentStretch; } 1615 1615 static EAlignItems initialAlignItems() { return AlignStretch; } -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
r122773 r124276 147 147 Color m_visitedLinkBorderBottomColor; 148 148 149 float m_order;149 int m_order; 150 150 151 151 AtomicString m_flowThread;
Note: See TracChangeset
for help on using the changeset viewer.