Changeset 80383 in webkit
- Timestamp:
- Mar 4, 2011 3:38:47 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r80379 r80383 1 2011-03-04 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r80379. 4 http://trac.webkit.org/changeset/80379 5 https://bugs.webkit.org/show_bug.cgi?id=55799 6 7 "Breaks leopard compile (implicit conversion)" (Requested by 8 tonyg-cr on #webkit). 9 10 * transitions/matched-transform-functions.html: 11 * transitions/retargetted-transition.html: 12 1 13 2011-03-04 Rik Cabanier <cabanier@gmail.com> 2 14 -
trunk/LayoutTests/transitions/matched-transform-functions.html
r80379 r80383 25 25 function test() 26 26 { 27 var c = new WebKitCSSMatrix(window.getComputedStyle(document.getElementById('box')).webkitTransform); 28 var result = (c.f < 200) ? 'PASS' : 'FAIL: transition should still be running, so y < 200'; 27 var t = window.getComputedStyle(document.getElementById('box')).webkitTransform; 28 // grab the last value from the matrix() 29 var lastValueRE = /(\d+)\)$/; 30 var yTranslate = parseInt(lastValueRE.exec(t)); 31 32 var result = (yTranslate < 200) ? 'PASS' : 'FAIL: transition should still be running, so y < 200'; 29 33 document.getElementById('result').innerHTML = result; 30 34 -
trunk/LayoutTests/transitions/retargetted-transition.html
r80379 r80383 24 24 function test() 25 25 { 26 var c = new WebKitCSSMatrix(window.getComputedStyle(document.getElementById('box')).webkitTransform); 27 var result = (c.f < 200) ? 'PASS' : 'FAIL: transition should still be running, so y < 200'; 26 var t = window.getComputedStyle(document.getElementById('box')).webkitTransform; 27 // grab the last value from the matrix() 28 var lastValueRE = /(\d+)\)$/; 29 var yTranslate = parseInt(lastValueRE.exec(t)); 30 31 var result = (yTranslate < 200) ? 'PASS' : 'FAIL: transition should still be running, so y < 200'; 28 32 document.getElementById('result').innerHTML = result; 29 33 -
trunk/Source/WebCore/ChangeLog
r80381 r80383 1 2011-03-04 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r80379. 4 http://trac.webkit.org/changeset/80379 5 https://bugs.webkit.org/show_bug.cgi?id=55799 6 7 "Breaks leopard compile (implicit conversion)" (Requested by 8 tonyg-cr on #webkit). 9 10 * css/CSSStyleSelector.cpp: 11 (WebCore::convertToLength): 12 (WebCore::CSSStyleSelector::applyProperty): 13 (WebCore::CSSStyleSelector::createTransformOperations): 14 * platform/Length.h: 15 (WebCore::Length::Length): 16 (WebCore::Length::operator==): 17 (WebCore::Length::operator!=): 18 (WebCore::Length::rawValue): 19 (WebCore::Length::type): 20 (WebCore::Length::quirk): 21 (WebCore::Length::setValue): 22 (WebCore::Length::setRawValue): 23 (WebCore::Length::calcFloatValue): 24 (WebCore::Length::isZero): 25 (WebCore::Length::blend): 26 * rendering/AutoTableLayout.cpp: 27 (WebCore::AutoTableLayout::recalcColumn): 28 (WebCore::AutoTableLayout::calcEffectiveLogicalWidth): 29 * rendering/FixedTableLayout.cpp: 30 (WebCore::FixedTableLayout::calcWidthArray): 31 1 32 2011-03-04 Jessie Berlin <jberlin@apple.com> 2 33 -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r80379 r80383 3364 3364 // this is mostly boring stuff on how to apply a certain rule to the renderstyle... 3365 3365 3366 static Length convertToLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, bool toFloat,double multiplier = 1, bool *ok = 0)3366 static Length convertToLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, double multiplier = 1, bool *ok = 0) 3367 3367 { 3368 3368 // This function is tolerant of a null style value. The only place style is used is in … … 3379 3379 if (ok) 3380 3380 *ok = false; 3381 } else if (CSSPrimitiveValue::isUnitTypeLength(type)) { 3382 if (toFloat) 3383 l = Length(primitiveValue->computeLengthDouble(style, rootStyle, multiplier), Fixed); 3384 else 3385 l = Length(primitiveValue->computeLengthIntForLength(style, rootStyle, multiplier), Fixed); 3386 } 3381 } else if (CSSPrimitiveValue::isUnitTypeLength(type)) 3382 l = Length(primitiveValue->computeLengthIntForLength(style, rootStyle, multiplier), Fixed); 3387 3383 else if (type == CSSPrimitiveValue::CSS_PERCENTAGE) 3388 3384 l = Length(primitiveValue->getDoubleValue(), Percent); … … 3393 3389 } 3394 3390 return l; 3395 }3396 3397 static Length convertToIntLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, double multiplier = 1, bool *ok = 0)3398 {3399 return convertToLength(primitiveValue, style, rootStyle, false, multiplier, ok);3400 }3401 3402 static Length convertToFloatLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, double multiplier = 1, bool *ok = 0)3403 {3404 return convertToLength(primitiveValue, style, rootStyle, true, multiplier, ok);3405 3391 } 3406 3392 … … 4724 4710 if (!rect) 4725 4711 return; 4726 top = convertTo IntLength(rect->top(), style(), m_rootElementStyle, zoomFactor);4727 right = convertTo IntLength(rect->right(), style(), m_rootElementStyle, zoomFactor);4728 bottom = convertTo IntLength(rect->bottom(), style(), m_rootElementStyle, zoomFactor);4729 left = convertTo IntLength(rect->left(), style(), m_rootElementStyle, zoomFactor);4712 top = convertToLength(rect->top(), style(), m_rootElementStyle, zoomFactor); 4713 right = convertToLength(rect->right(), style(), m_rootElementStyle, zoomFactor); 4714 bottom = convertToLength(rect->bottom(), style(), m_rootElementStyle, zoomFactor); 4715 left = convertToLength(rect->left(), style(), m_rootElementStyle, zoomFactor); 4730 4716 } else if (primitiveValue->getIdent() != CSSValueAuto) { 4731 4717 return; … … 5670 5656 else { 5671 5657 bool ok = true; 5672 Length marqueeLength = convertToIntLength(primitiveValue, style(), m_rootElementStyle, 1, &ok);5658 Length l = convertToLength(primitiveValue, style(), m_rootElementStyle, 1, &ok); 5673 5659 if (ok) 5674 m_style->setMarqueeIncrement( marqueeLength);5660 m_style->setMarqueeIncrement(l); 5675 5661 } 5676 5662 return; … … 5818 5804 DashboardRegion *first = region; 5819 5805 while (region) { 5820 Length top = convertTo IntLength(region->top(), style(), m_rootElementStyle);5821 Length right = convertTo IntLength(region->right(), style(), m_rootElementStyle);5822 Length bottom = convertTo IntLength(region->bottom(), style(), m_rootElementStyle);5823 Length left = convertTo IntLength(region->left(), style(), m_rootElementStyle);5806 Length top = convertToLength(region->top(), style(), m_rootElementStyle); 5807 Length right = convertToLength(region->right(), style(), m_rootElementStyle); 5808 Length bottom = convertToLength(region->bottom(), style(), m_rootElementStyle); 5809 Length left = convertToLength(region->left(), style(), m_rootElementStyle); 5824 5810 if (region->m_isCircle) 5825 5811 m_style->setDashboardRegion(StyleDashboardRegion::Circle, region->m_label, top, right, bottom, left, region == first ? false : true); … … 7279 7265 Length ty = Length(0, Fixed); 7280 7266 if (transformValue->operationType() == WebKitCSSTransformValue::TranslateYTransformOperation) 7281 ty = convertTo FloatLength(firstValue, style, rootStyle, zoomFactor, &ok);7267 ty = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok); 7282 7268 else { 7283 tx = convertTo FloatLength(firstValue, style, rootStyle, zoomFactor, &ok);7269 tx = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok); 7284 7270 if (transformValue->operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) { 7285 7271 if (transformValue->length() > 1) { 7286 7272 CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1)); 7287 ty = convertTo FloatLength(secondValue, style, rootStyle, zoomFactor, &ok);7273 ty = convertToLength(secondValue, style, rootStyle, zoomFactor, &ok); 7288 7274 } 7289 7275 } … … 7303 7289 Length tz = Length(0, Fixed); 7304 7290 if (transformValue->operationType() == WebKitCSSTransformValue::TranslateZTransformOperation) 7305 tz = convertTo FloatLength(firstValue, style, rootStyle, zoomFactor, &ok);7291 tz = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok); 7306 7292 else if (transformValue->operationType() == WebKitCSSTransformValue::TranslateYTransformOperation) 7307 ty = convertTo FloatLength(firstValue, style, rootStyle, zoomFactor, &ok);7293 ty = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok); 7308 7294 else { 7309 tx = convertTo FloatLength(firstValue, style, rootStyle, zoomFactor, &ok);7295 tx = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok); 7310 7296 if (transformValue->operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) { 7311 7297 if (transformValue->length() > 2) { 7312 7298 CSSPrimitiveValue* thirdValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(2)); 7313 tz = convertTo FloatLength(thirdValue, style, rootStyle, zoomFactor, &ok);7299 tz = convertToLength(thirdValue, style, rootStyle, zoomFactor, &ok); 7314 7300 } 7315 7301 if (transformValue->length() > 1) { 7316 7302 CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1)); 7317 ty = convertTo FloatLength(secondValue, style, rootStyle, zoomFactor, &ok);7303 ty = convertToLength(secondValue, style, rootStyle, zoomFactor, &ok); 7318 7304 } 7319 7305 } … … 7446 7432 Length p = Length(0, Fixed); 7447 7433 if (CSSPrimitiveValue::isUnitTypeLength(firstValue->primitiveType())) 7448 p = convertTo FloatLength(firstValue, style, rootStyle, zoomFactor, &ok);7434 p = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok); 7449 7435 else { 7450 7436 // This is a quirk that should go away when 3d transforms are finalized. -
trunk/Source/WebCore/platform/Length.h
r80379 r80383 41 41 public: 42 42 Length() 43 : m_intValue(0), m_quirk(false), m_type(Auto), m_isFloat(false)43 : m_value(0) 44 44 { 45 45 } 46 46 47 47 Length(LengthType t) 48 : m_ intValue(0), m_quirk(false), m_type(t), m_isFloat(false)48 : m_value(t) 49 49 { 50 50 } 51 51 52 52 Length(int v, LengthType t, bool q = false) 53 : m_ intValue(v), m_quirk(q), m_type(t), m_isFloat(false)53 : m_value((v * 16) | (q << 3) | t) // FIXME: Doesn't work if the passed-in value is very large! 54 54 { 55 55 ASSERT(t != Percent); … … 57 57 58 58 Length(double v, LengthType t, bool q = false) 59 : m_quirk(q), m_type(t), m_isFloat(false) 60 { 61 if (m_type == Percent) 62 m_intValue = static_cast<int>(v*percentScaleFactor); 63 else { 64 m_isFloat = true; 65 m_floatValue = static_cast<float>(v); 66 } 67 } 68 69 bool operator==(const Length& o) const { return (getFloatValue() == o.getFloatValue()) && (m_type == o.m_type) && (m_quirk == o.m_quirk); } 70 bool operator!=(const Length& o) const { return (getFloatValue() != o.getFloatValue()) || (m_type != o.m_type) || (m_quirk != o.m_quirk); } 59 : m_value(static_cast<int>(v * percentScaleFactor) * 16 | (q << 3) | t) 60 { 61 ASSERT(t == Percent); 62 } 63 64 bool operator==(const Length& o) const { return m_value == o.m_value; } 65 bool operator!=(const Length& o) const { return m_value != o.m_value; } 71 66 72 67 int value() const { … … 75 70 } 76 71 77 int rawValue() const { return getIntValue(); }72 int rawValue() const { return (m_value & ~0xF) / 16; } 78 73 79 74 double percent() const … … 83 78 } 84 79 85 LengthType type() const { return static_cast<LengthType>(m_ type); }86 bool quirk() const { return m_quirk; }80 LengthType type() const { return static_cast<LengthType>(m_value & 7); } 81 bool quirk() const { return (m_value >> 3) & 1; } 87 82 88 83 void setValue(LengthType t, int value) 89 84 { 90 m_type = t; 91 m_intValue = value; 92 m_isFloat = false; 93 } 85 ASSERT(t != Percent); 86 setRawValue(t, value); 87 } 88 89 void setRawValue(LengthType t, int value) { m_value = value * 16 | (m_value & 0x8) | t; } 94 90 95 91 void setValue(int value) 96 92 { 97 93 ASSERT(!value || type() != Percent); 98 setValue(Fixed, value); 99 } 94 setRawValue(value); 95 } 96 97 void setRawValue(int value) { m_value = value * 16 | (m_value & 0xF); } 100 98 101 99 void setValue(LengthType t, double value) 102 100 { 103 m_type = t; 104 m_floatValue = value; 105 m_isFloat = true; 101 ASSERT(t == Percent); 102 m_value = static_cast<int>(value * percentScaleFactor) * 16 | (m_value & 0x8) | t; 106 103 } 107 104 108 105 void setValue(double value) 109 106 { 110 *this = Length(value, Fixed); 107 ASSERT(type() == Percent); 108 m_value = static_cast<int>(value * percentScaleFactor) * 16 | (m_value & 0xF); 111 109 } 112 110 … … 147 145 switch (type()) { 148 146 case Fixed: 149 return getFloatValue();147 return static_cast<float>(value()); 150 148 case Percent: 151 149 return static_cast<float>(maxValue * percent() / 100.0); … … 158 156 159 157 bool isUndefined() const { return rawValue() == undefinedLength; } 160 bool isZero() const { return ! getIntValue(); }158 bool isZero() const { return !(m_value & ~0xF); } 161 159 bool isPositive() const { return rawValue() > 0; } 162 160 bool isNegative() const { return rawValue() < 0; } … … 187 185 } 188 186 189 doublefromValue = from.isZero() ? 0 : from.value();190 doubletoValue = isZero() ? 0 : value();191 return Length( fromValue + (toValue - fromValue) * progress, resultType);187 int fromValue = from.isZero() ? 0 : from.value(); 188 int toValue = isZero() ? 0 : value(); 189 return Length(int(fromValue + (toValue - fromValue) * progress), resultType); 192 190 } 193 191 194 192 private: 195 int getIntValue() const 196 { 197 if (m_isFloat) 198 return static_cast<int>(m_floatValue); 199 return m_intValue; 200 } 201 202 float getFloatValue() const 203 { 204 if (m_isFloat) 205 return m_floatValue; 206 return m_intValue; 207 } 208 209 union { 210 int m_intValue; 211 float m_floatValue; 212 }; 213 bool m_quirk; 214 unsigned char m_type; 215 bool m_isFloat; 193 int m_value; 216 194 }; 217 195 -
trunk/Source/WebCore/rendering/AutoTableLayout.cpp
r80379 r80383 83 83 // FIXME: What is this arbitrary value? 84 84 if (cellLogicalWidth.rawValue() > 32760) 85 cellLogicalWidth.set Value(32760);85 cellLogicalWidth.setRawValue(32760); 86 86 if (cellLogicalWidth.isNegative()) 87 87 cellLogicalWidth.setValue(0); … … 375 375 percentMissing -= percent; 376 376 if (percent > 0) 377 m_layoutStruct[pos].effectiveLogicalWidth.set Value(Percent, percent);377 m_layoutStruct[pos].effectiveLogicalWidth.setRawValue(Percent, percent); 378 378 else 379 379 m_layoutStruct[pos].effectiveLogicalWidth = Length(); -
trunk/Source/WebCore/rendering/FixedTableLayout.cpp
r80379 r80383 119 119 } 120 120 if ((w.isFixed() || w.isPercent()) && w.isPositive()) { 121 m_width[currentEffectiveColumn].set Value(w.type(), w.rawValue() * spanInCurrentEffectiveColumn);121 m_width[currentEffectiveColumn].setRawValue(w.type(), w.rawValue() * spanInCurrentEffectiveColumn); 122 122 usedWidth += effWidth * spanInCurrentEffectiveColumn; 123 123 } … … 168 168 // Only set if no col element has already set it. 169 169 if (m_width[cCol + i].isAuto() && w.type() != Auto) { 170 m_width[cCol + i].set Value(w.type(), w.rawValue() * eSpan / span);170 m_width[cCol + i].setRawValue(w.type(), w.rawValue() * eSpan / span); 171 171 usedWidth += effWidth * eSpan / span; 172 172 }
Note: See TracChangeset
for help on using the changeset viewer.