Diff
Modified: trunk/Source/WebCore/ChangeLog (91968 => 91969)
--- trunk/Source/WebCore/ChangeLog 2011-07-29 01:37:14 UTC (rev 91968)
+++ trunk/Source/WebCore/ChangeLog 2011-07-29 01:46:50 UTC (rev 91969)
@@ -1,3 +1,27 @@
+2011-07-28 Luke Macpherson <[email protected]>
+
+ Remove remaining uses of CSSPrimitiveValue::computeLengthIntForLength()
+ https://bugs.webkit.org/show_bug.cgi?id=64919
+
+ Reviewed by Darin Adler.
+
+ No new tests / cleanup only.
+
+ * css/CSSPrimitiveValue.cpp:
+ (WebCore::CSSPrimitiveValue::computeLength):
+ Remove implementation of computeLengthIntForLength()
+ * css/CSSPrimitiveValue.h:
+ Remove definition of computeLengthIntForLength()
+ * css/CSSStyleApplyProperty.cpp:
+ (WebCore::ApplyPropertyLength::applyValue):
+ Remove use of computeLengthIntForLength()
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+ Remove use of computeLengthIntForLength()
+ * platform/Length.h:
+ (WebCore::Length::setQuirk):
+ Adds the ability to set the m_quirk member variable after construction.
+
2011-07-28 Anders Carlsson <[email protected]>
Unreviewed, rolling out r88601. (Requested by Sam Weinig).
Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (91968 => 91969)
--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp 2011-07-29 01:37:14 UTC (rev 91968)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp 2011-07-29 01:46:50 UTC (rev 91969)
@@ -274,16 +274,10 @@
return roundForImpreciseConversion<int, INT_MAX, INT_MIN>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize));
}
-// Lengths expect an int that is only 28-bits, so we have to check for a
-// different overflow.
-int CSSPrimitiveValue::computeLengthIntForLength(RenderStyle* style, RenderStyle* rootStyle, double multiplier, bool computingFontSize)
-{
- return roundForImpreciseConversion<int, intMaxForLength, intMinForLength>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize));
-}
-
template<> Length CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyle* rootStyle, double multiplier, bool computingFontSize)
{
- return Length(computeLengthIntForLength(style, rootStyle, multiplier, computingFontSize), Fixed);
+ // FIXME: Length.h no longer expects 28 bit integers, so these bounds should be INT_MAX and INT_MIN
+ return Length(roundForImpreciseConversion<int, intMaxForLength, intMinForLength>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize)), Fixed);
}
template<> short CSSPrimitiveValue::computeLength(RenderStyle* style, RenderStyle* rootStyle, double multiplier, bool computingFontSize)
Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.h (91968 => 91969)
--- trunk/Source/WebCore/css/CSSPrimitiveValue.h 2011-07-29 01:37:14 UTC (rev 91968)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.h 2011-07-29 01:46:50 UTC (rev 91969)
@@ -146,7 +146,6 @@
* and some tool to calibrate.
*/
template<typename T> T computeLength(RenderStyle* currStyle, RenderStyle* rootStyle, double multiplier = 1.0, bool computingFontSize = false);
- int computeLengthIntForLength(RenderStyle* currStyle, RenderStyle* rootStyle, double multiplier = 1.0, bool computingFontSize = false);
// use with care!!!
void setPrimitiveType(unsigned short type) { m_type = type; }
Modified: trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp (91968 => 91969)
--- trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp 2011-07-29 01:37:14 UTC (rev 91968)
+++ trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp 2011-07-29 01:46:50 UTC (rev 91969)
@@ -322,9 +322,11 @@
setValue(selector->style(), Length());
else {
int type = primitiveValue->primitiveType();
- if (CSSPrimitiveValue::isUnitTypeLength(type))
- setValue(selector->style(), Length(primitiveValue->computeLengthIntForLength(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom()), Fixed, primitiveValue->isQuirkValue()));
- else if (type == CSSPrimitiveValue::CSS_PERCENTAGE)
+ if (CSSPrimitiveValue::isUnitTypeLength(type)) {
+ Length length = primitiveValue->computeLength<Length>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom());
+ length.setQuirk(primitiveValue->isQuirkValue());
+ setValue(selector->style(), length);
+ } else if (type == CSSPrimitiveValue::CSS_PERCENTAGE)
setValue(selector->style(), Length(primitiveValue->getDoubleValue(), Percent));
}
}
Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (91968 => 91969)
--- trunk/Source/WebCore/css/CSSStyleSelector.cpp 2011-07-29 01:37:14 UTC (rev 91968)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp 2011-07-29 01:46:50 UTC (rev 91969)
@@ -4900,7 +4900,7 @@
float perspectiveValue;
int type = primitiveValue->primitiveType();
if (CSSPrimitiveValue::isUnitTypeLength(type))
- perspectiveValue = static_cast<float>(primitiveValue->computeLengthIntForLength(style(), m_rootElementStyle, zoomFactor));
+ perspectiveValue = primitiveValue->computeLength<float>(style(), m_rootElementStyle, zoomFactor);
else if (type == CSSPrimitiveValue::CSS_NUMBER) {
// For backward compatibility, treat valueless numbers as px.
perspectiveValue = CSSPrimitiveValue::create(primitiveValue->getDoubleValue(), CSSPrimitiveValue::CSS_PX)->computeLength<float>(style(), m_rootElementStyle, zoomFactor);
Modified: trunk/Source/WebCore/platform/Length.h (91968 => 91969)
--- trunk/Source/WebCore/platform/Length.h 2011-07-29 01:37:14 UTC (rev 91968)
+++ trunk/Source/WebCore/platform/Length.h 2011-07-29 01:46:50 UTC (rev 91969)
@@ -91,6 +91,11 @@
LengthType type() const { return static_cast<LengthType>(m_type); }
bool quirk() const { return m_quirk; }
+ void setQuirk(bool quirk)
+ {
+ m_quirk = quirk;
+ }
+
void setValue(LengthType t, int value)
{
m_type = t;