- Revision
- 112472
- Author
- [email protected]
- Date
- 2012-03-28 16:41:42 -0700 (Wed, 28 Mar 2012)
Log Message
SL bot is hitting SHOULD NEVER BE REACHED in WebCore::valueForLength() on many tests
https://bugs.webkit.org/show_bug.cgi?id=82390
Patch by Joe Thomas <[email protected]> on 2012-03-28
Reviewed by Simon Fraser.
This is an attempt to fix the MAC SL/Lion Bot issue as this issue is not reproducible locally.
The assertion happened when length type is Undefined in valueForLength() function but the assertion for Undefined length type
in RenderBox::computeLogicalWidthInRegionUsing which calls the above said function did not get hit.
This patch passes Length structure as const reference to Length calculation functions which avoids the call to the copy-constructor.
And it ensures that the Length structure is not getting modified during copy-construction.
* css/LengthFunctions.cpp:
(WebCore::minimumValueForLength):
(WebCore::valueForLength):
(WebCore::floatValueForLength):
* css/LengthFunctions.h:
(WebCore):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (112471 => 112472)
--- trunk/Source/WebCore/ChangeLog 2012-03-28 23:29:05 UTC (rev 112471)
+++ trunk/Source/WebCore/ChangeLog 2012-03-28 23:41:42 UTC (rev 112472)
@@ -1,3 +1,24 @@
+2012-03-28 Joe Thomas <[email protected]>
+
+ SL bot is hitting SHOULD NEVER BE REACHED in WebCore::valueForLength() on many tests
+ https://bugs.webkit.org/show_bug.cgi?id=82390
+
+ Reviewed by Simon Fraser.
+
+ This is an attempt to fix the MAC SL/Lion Bot issue as this issue is not reproducible locally.
+ The assertion happened when length type is Undefined in valueForLength() function but the assertion for Undefined length type
+ in RenderBox::computeLogicalWidthInRegionUsing which calls the above said function did not get hit.
+
+ This patch passes Length structure as const reference to Length calculation functions which avoids the call to the copy-constructor.
+ And it ensures that the Length structure is not getting modified during copy-construction.
+
+ * css/LengthFunctions.cpp:
+ (WebCore::minimumValueForLength):
+ (WebCore::valueForLength):
+ (WebCore::floatValueForLength):
+ * css/LengthFunctions.h:
+ (WebCore):
+
2012-03-28 Gavin Barraclough <[email protected]>
Yarr: if we're not using the output array, don't populate it!
Modified: trunk/Source/WebCore/css/LengthFunctions.cpp (112471 => 112472)
--- trunk/Source/WebCore/css/LengthFunctions.cpp 2012-03-28 23:29:05 UTC (rev 112471)
+++ trunk/Source/WebCore/css/LengthFunctions.cpp 2012-03-28 23:41:42 UTC (rev 112472)
@@ -29,7 +29,7 @@
namespace WebCore {
-int minimumValueForLength(Length length, int maximumValue, RenderView* renderView, bool roundPercentages)
+int minimumValueForLength(const Length& length, int maximumValue, RenderView* renderView, bool roundPercentages)
{
switch (length.type()) {
case Fixed:
@@ -68,7 +68,7 @@
return 0;
}
-int valueForLength(Length length, int maximumValue, RenderView* renderView, bool roundPercentages)
+int valueForLength(const Length& length, int maximumValue, RenderView* renderView, bool roundPercentages)
{
switch (length.type()) {
case Fixed:
@@ -96,7 +96,7 @@
}
// FIXME: when subpixel layout is supported this copy of floatValueForLength() can be removed. See bug 71143.
-float floatValueForLength(Length length, int maximumValue, RenderView* renderView)
+float floatValueForLength(const Length& length, int maximumValue, RenderView* renderView)
{
switch (length.type()) {
case Fixed:
@@ -132,7 +132,7 @@
return 0;
}
-float floatValueForLength(Length length, float maximumValue, RenderView* renderView)
+float floatValueForLength(const Length& length, float maximumValue, RenderView* renderView)
{
switch (length.type()) {
case Fixed:
Modified: trunk/Source/WebCore/css/LengthFunctions.h (112471 => 112472)
--- trunk/Source/WebCore/css/LengthFunctions.h 2012-03-28 23:29:05 UTC (rev 112471)
+++ trunk/Source/WebCore/css/LengthFunctions.h 2012-03-28 23:41:42 UTC (rev 112472)
@@ -29,10 +29,10 @@
class RenderView;
struct Length;
-int minimumValueForLength(Length, int maximumValue, RenderView* = 0, bool roundPercentages = false);
-int valueForLength(Length, int maximumValue, RenderView* = 0, bool roundPercentages = false);
-float floatValueForLength(Length, int maximumValue, RenderView* = 0);
-float floatValueForLength(Length, float maximumValue, RenderView* = 0);
+int minimumValueForLength(const Length&, int maximumValue, RenderView* = 0, bool roundPercentages = false);
+int valueForLength(const Length&, int maximumValue, RenderView* = 0, bool roundPercentages = false);
+float floatValueForLength(const Length&, int maximumValue, RenderView* = 0);
+float floatValueForLength(const Length&, float maximumValue, RenderView* = 0);
} // namespace WebCore