Title: [113612] branches/subpixellayout/Source/WebCore
- Revision
- 113612
- Author
- [email protected]
- Date
- 2012-04-09 13:31:32 -0700 (Mon, 09 Apr 2012)
Log Message
Adding more missing double overloads to avoid unnecessary static_casting.
Modified Paths
Diff
Modified: branches/subpixellayout/Source/WebCore/html/shadow/SliderThumbElement.cpp (113611 => 113612)
--- branches/subpixellayout/Source/WebCore/html/shadow/SliderThumbElement.cpp 2012-04-09 20:31:15 UTC (rev 113611)
+++ branches/subpixellayout/Source/WebCore/html/shadow/SliderThumbElement.cpp 2012-04-09 20:31:32 UTC (rev 113612)
@@ -236,7 +236,7 @@
return;
StepRange range(input);
- double fraction = static_cast<double>(position) / static_cast<double>(trackSize);
+ double fraction = static_cast<double>(position) / trackSize;
if (isVertical || !renderBox()->style()->isLeftToRightDirection())
fraction = 1 - fraction;
double value = range.clampValue(range.valueFromProportion(fraction));
Modified: branches/subpixellayout/Source/WebCore/platform/FractionalLayoutUnit.h (113611 => 113612)
--- branches/subpixellayout/Source/WebCore/platform/FractionalLayoutUnit.h 2012-04-09 20:31:15 UTC (rev 113611)
+++ branches/subpixellayout/Source/WebCore/platform/FractionalLayoutUnit.h 2012-04-09 20:31:32 UTC (rev 113612)
@@ -384,6 +384,11 @@
return a / b.toFloat();
}
+inline double operator/(const double a, const FractionalLayoutUnit& b)
+{
+ return a / b.toDouble();
+}
+
inline FractionalLayoutUnit operator/(const int a, const FractionalLayoutUnit& b)
{
return FractionalLayoutUnit(a) / b;
@@ -426,6 +431,11 @@
return a + b.toFloat();
}
+inline double operator+(const double a, const FractionalLayoutUnit& b)
+{
+ return a + b.toDouble();
+}
+
inline FractionalLayoutUnit operator-(const FractionalLayoutUnit& a, const FractionalLayoutUnit& b)
{
FractionalLayoutUnit returnVal;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes