Changeset 79876 in webkit
- Timestamp:
- Feb 28, 2011 9:54:42 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r79874 r79876 1 2011-02-28 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r79784. 4 http://trac.webkit.org/changeset/79784 5 https://bugs.webkit.org/show_bug.cgi?id=55386 6 7 This change causes lots of assertion failures in Debug builds 8 (Requested by aroben on #webkit). 9 10 * transitions/matched-transform-functions.html: 11 * transitions/retargetted-transition.html: 12 1 13 2011-02-28 Pavel Feldman <pfeldman@chromium.org> 2 14 -
trunk/LayoutTests/transitions/matched-transform-functions.html
r79784 r79876 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'; 29 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'; 30 33 document.getElementById('result').innerHTML = result; 31 34 -
trunk/LayoutTests/transitions/retargetted-transition.html
r79784 r79876 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
r79875 r79876 1 2011-02-28 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r79784. 4 http://trac.webkit.org/changeset/79784 5 https://bugs.webkit.org/show_bug.cgi?id=55386 6 7 This change causes lots of assertion failures in Debug builds 8 (Requested by aroben 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-02-28 Andreas Kling <kling@webkit.org> 2 33 -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r79861 r79876 3335 3335 // ------------------------------------------------------------------------------------- 3336 3336 // this is mostly boring stuff on how to apply a certain rule to the renderstyle... 3337 static Length convertToLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, bool toFloat, double multiplier = 1, bool *ok = 0) 3337 3338 static Length convertToLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, double multiplier = 1, bool *ok = 0) 3338 3339 { 3339 3340 // This function is tolerant of a null style value. The only place style is used is in … … 3346 3347 } else { 3347 3348 int type = primitiveValue->primitiveType(); 3348 3349 3349 3350 if (!style && (type == CSSPrimitiveValue::CSS_EMS || type == CSSPrimitiveValue::CSS_EXS || type == CSSPrimitiveValue::CSS_REMS)) { 3350 3351 if (ok) 3351 3352 *ok = false; 3352 } else if (CSSPrimitiveValue::isUnitTypeLength(type)) { 3353 if (toFloat) 3354 l = Length(primitiveValue->computeLengthDouble(style, rootStyle, multiplier), Fixed); 3355 else 3356 l = Length(primitiveValue->computeLengthIntForLength(style, rootStyle, multiplier), Fixed); 3357 } 3353 } else if (CSSPrimitiveValue::isUnitTypeLength(type)) 3354 l = Length(primitiveValue->computeLengthIntForLength(style, rootStyle, multiplier), Fixed); 3358 3355 else if (type == CSSPrimitiveValue::CSS_PERCENTAGE) 3359 3356 l = Length(primitiveValue->getDoubleValue(), Percent); … … 3364 3361 } 3365 3362 return l; 3366 }3367 3368 static Length convertToIntLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, double multiplier = 1, bool *ok = 0)3369 {3370 return convertToLength(primitiveValue, style, rootStyle, false, multiplier, ok);3371 }3372 3373 static Length convertToFloatLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, double multiplier = 1, bool *ok = 0)3374 {3375 return convertToLength(primitiveValue, style, rootStyle, true, multiplier, ok);3376 3363 } 3377 3364 … … 4695 4682 if (!rect) 4696 4683 return; 4697 top = convertTo IntLength(rect->top(), style(), m_rootElementStyle, zoomFactor);4698 right = convertTo IntLength(rect->right(), style(), m_rootElementStyle, zoomFactor);4699 bottom = convertTo IntLength(rect->bottom(), style(), m_rootElementStyle, zoomFactor);4700 left = convertTo IntLength(rect->left(), style(), m_rootElementStyle, zoomFactor);4684 top = convertToLength(rect->top(), style(), m_rootElementStyle, zoomFactor); 4685 right = convertToLength(rect->right(), style(), m_rootElementStyle, zoomFactor); 4686 bottom = convertToLength(rect->bottom(), style(), m_rootElementStyle, zoomFactor); 4687 left = convertToLength(rect->left(), style(), m_rootElementStyle, zoomFactor); 4701 4688 } else if (primitiveValue->getIdent() != CSSValueAuto) { 4702 4689 return; … … 5587 5574 else { 5588 5575 bool ok = true; 5589 Length marqueeLength = convertToIntLength(primitiveValue, style(), m_rootElementStyle, 1, &ok);5576 Length l = convertToLength(primitiveValue, style(), m_rootElementStyle, 1, &ok); 5590 5577 if (ok) 5591 m_style->setMarqueeIncrement( marqueeLength);5578 m_style->setMarqueeIncrement(l); 5592 5579 } 5593 5580 return; … … 5735 5722 DashboardRegion *first = region; 5736 5723 while (region) { 5737 Length top = convertTo IntLength(region->top(), style(), m_rootElementStyle);5738 Length right = convertTo IntLength(region->right(), style(), m_rootElementStyle);5739 Length bottom = convertTo IntLength(region->bottom(), style(), m_rootElementStyle);5740 Length left = convertTo IntLength(region->left(), style(), m_rootElementStyle);5724 Length top = convertToLength(region->top(), style(), m_rootElementStyle); 5725 Length right = convertToLength(region->right(), style(), m_rootElementStyle); 5726 Length bottom = convertToLength(region->bottom(), style(), m_rootElementStyle); 5727 Length left = convertToLength(region->left(), style(), m_rootElementStyle); 5741 5728 if (region->m_isCircle) 5742 5729 m_style->setDashboardRegion(StyleDashboardRegion::Circle, region->m_label, top, right, bottom, left, region == first ? false : true); … … 7197 7184 Length ty = Length(0, Fixed); 7198 7185 if (transformValue->operationType() == WebKitCSSTransformValue::TranslateYTransformOperation) 7199 ty = convertTo FloatLength(firstValue, style, rootStyle, zoomFactor, &ok);7186 ty = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok); 7200 7187 else { 7201 tx = convertTo FloatLength(firstValue, style, rootStyle, zoomFactor, &ok);7188 tx = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok); 7202 7189 if (transformValue->operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) { 7203 7190 if (transformValue->length() > 1) { 7204 7191 CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1)); 7205 ty = convertTo FloatLength(secondValue, style, rootStyle, zoomFactor, &ok);7192 ty = convertToLength(secondValue, style, rootStyle, zoomFactor, &ok); 7206 7193 } 7207 7194 } … … 7221 7208 Length tz = Length(0, Fixed); 7222 7209 if (transformValue->operationType() == WebKitCSSTransformValue::TranslateZTransformOperation) 7223 tz = convertTo FloatLength(firstValue, style, rootStyle, zoomFactor, &ok);7210 tz = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok); 7224 7211 else if (transformValue->operationType() == WebKitCSSTransformValue::TranslateYTransformOperation) 7225 ty = convertTo FloatLength(firstValue, style, rootStyle, zoomFactor, &ok);7212 ty = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok); 7226 7213 else { 7227 tx = convertTo FloatLength(firstValue, style, rootStyle, zoomFactor, &ok);7214 tx = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok); 7228 7215 if (transformValue->operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) { 7229 7216 if (transformValue->length() > 2) { 7230 7217 CSSPrimitiveValue* thirdValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(2)); 7231 tz = convertTo FloatLength(thirdValue, style, rootStyle, zoomFactor, &ok);7218 tz = convertToLength(thirdValue, style, rootStyle, zoomFactor, &ok); 7232 7219 } 7233 7220 if (transformValue->length() > 1) { 7234 7221 CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1)); 7235 ty = convertTo FloatLength(secondValue, style, rootStyle, zoomFactor, &ok);7222 ty = convertToLength(secondValue, style, rootStyle, zoomFactor, &ok); 7236 7223 } 7237 7224 } … … 7364 7351 Length p = Length(0, Fixed); 7365 7352 if (CSSPrimitiveValue::isUnitTypeLength(firstValue->primitiveType())) 7366 p = convertTo FloatLength(firstValue, style, rootStyle, zoomFactor, &ok);7353 p = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok); 7367 7354 else { 7368 7355 // This is a quirk that should go away when 3d transforms are finalized. -
trunk/Source/WebCore/platform/Length.h
r79784 r79876 41 41 public: 42 42 Length() 43 : m_ intValue(0), m_quirk(0), m_type(Auto), m_isFloat(0)43 : m_value(0) 44 44 { 45 45 } 46 46 47 47 Length(LengthType t) 48 : m_ intValue(0), m_quirk(0), m_type(t), m_isFloat(0)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(0)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(0) 60 { 61 if (m_type == Percent) 62 m_intValue = static_cast<int>(v*percentScaleFactor); 63 else { 64 m_isFloat = 1; 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); } 71 72 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; } 66 73 67 int value() const { 74 68 ASSERT(type() != Percent); … … 76 70 } 77 71 78 int rawValue() const { return getIntValue(); }72 int rawValue() const { return (m_value & ~0xF) / 16; } 79 73 80 74 double percent() const … … 84 78 } 85 79 86 LengthType type() const { return static_cast<LengthType>(m_ type); }87 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; } 88 82 89 83 void setValue(LengthType t, int value) 90 84 { 91 85 ASSERT(t != Percent); 92 *this = Length(value, t); 93 } 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 *this = Length(value, Fixed); 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 *this = Length(value, t); 101 ASSERT(t == Percent); 102 m_value = static_cast<int>(value * percentScaleFactor) * 16 | (m_value & 0x8) | t; 104 103 } 105 104 106 105 void setValue(double value) 107 106 { 108 *this = Length(value, Fixed); 107 ASSERT(type() == Percent); 108 m_value = static_cast<int>(value * percentScaleFactor) * 16 | (m_value & 0xF); 109 109 } 110 110 … … 145 145 switch (type()) { 146 146 case Fixed: 147 return getFloatValue();147 return static_cast<float>(value()); 148 148 case Percent: 149 149 return static_cast<float>(maxValue * percent() / 100.0); … … 156 156 157 157 bool isUndefined() const { return rawValue() == undefinedLength; } 158 bool isZero() const { return ! getIntValue(); }158 bool isZero() const { return !(m_value & ~0xF); } 159 159 bool isPositive() const { return rawValue() > 0; } 160 160 bool isNegative() const { return rawValue() < 0; } … … 185 185 } 186 186 187 double fromValue = from.isZero() ? 0 : from.getFloatValue();188 double toValue = isZero() ? 0 : getFloatValue();189 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); 190 190 } 191 191 192 192 private: 193 int getIntValue() const 194 { 195 if (m_isFloat) 196 return static_cast<int>(m_floatValue); 197 return m_intValue; 198 } 199 200 float getFloatValue() const 201 { 202 if (m_isFloat) 203 return m_floatValue; 204 return m_intValue; 205 } 206 207 union { 208 int m_intValue; 209 float m_floatValue; 210 }; 211 bool m_quirk; 212 unsigned char m_type; 213 bool m_isFloat; 193 int m_value; 214 194 }; 215 195 -
trunk/Source/WebCore/rendering/AutoTableLayout.cpp
r79784 r79876 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
r79784 r79876 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.