Changeset 112472 in webkit


Ignore:
Timestamp:
Mar 28, 2012 4:41:42 PM (12 years ago)
Author:
commit-queue@webkit.org
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 <joethomas@motorola.com> 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):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112454 r112472  
     12012-03-28  Joe Thomas  <joethomas@motorola.com>
     2
     3        SL bot is hitting SHOULD NEVER BE REACHED in WebCore::valueForLength() on many tests
     4        https://bugs.webkit.org/show_bug.cgi?id=82390
     5
     6        Reviewed by Simon Fraser.
     7
     8        This is an attempt to fix the MAC SL/Lion Bot issue as this issue is not reproducible locally.
     9        The assertion happened when length type is Undefined in valueForLength() function but the assertion for Undefined length type
     10        in RenderBox::computeLogicalWidthInRegionUsing which calls the above said function did not get hit.
     11
     12        This patch passes Length structure as const reference to Length calculation functions which avoids the call to the copy-constructor.
     13        And it ensures that the Length structure is not getting modified during copy-construction.
     14
     15        * css/LengthFunctions.cpp:
     16        (WebCore::minimumValueForLength):
     17        (WebCore::valueForLength):
     18        (WebCore::floatValueForLength):
     19        * css/LengthFunctions.h:
     20        (WebCore):
     21
    1222012-03-28  Gavin Barraclough  <barraclough@apple.com>
    223
  • trunk/Source/WebCore/css/LengthFunctions.cpp

    r112336 r112472  
    3030namespace WebCore {
    3131
    32 int minimumValueForLength(Length length, int maximumValue, RenderView* renderView, bool roundPercentages)
     32int minimumValueForLength(const Length& length, int maximumValue, RenderView* renderView, bool roundPercentages)
    3333{
    3434    switch (length.type()) {
     
    6969}
    7070
    71 int valueForLength(Length length, int maximumValue, RenderView* renderView, bool roundPercentages)
     71int valueForLength(const Length& length, int maximumValue, RenderView* renderView, bool roundPercentages)
    7272{
    7373    switch (length.type()) {
     
    9797
    9898// FIXME: when subpixel layout is supported this copy of floatValueForLength() can be removed. See bug 71143.
    99 float floatValueForLength(Length length, int maximumValue, RenderView* renderView)
     99float floatValueForLength(const Length& length, int maximumValue, RenderView* renderView)
    100100{
    101101    switch (length.type()) {
     
    133133}
    134134
    135 float floatValueForLength(Length length, float maximumValue, RenderView* renderView)
     135float floatValueForLength(const Length& length, float maximumValue, RenderView* renderView)
    136136{
    137137    switch (length.type()) {
  • trunk/Source/WebCore/css/LengthFunctions.h

    r112301 r112472  
    3030struct Length;
    3131
    32 int minimumValueForLength(Length, int maximumValue, RenderView* = 0, bool roundPercentages = false);
    33 int valueForLength(Length, int maximumValue, RenderView* = 0, bool roundPercentages = false);
    34 float floatValueForLength(Length, int maximumValue, RenderView* = 0);
    35 float floatValueForLength(Length, float maximumValue, RenderView* = 0);
     32int minimumValueForLength(const Length&, int maximumValue, RenderView* = 0, bool roundPercentages = false);
     33int valueForLength(const Length&, int maximumValue, RenderView* = 0, bool roundPercentages = false);
     34float floatValueForLength(const Length&, int maximumValue, RenderView* = 0);
     35float floatValueForLength(const Length&, float maximumValue, RenderView* = 0);
    3636
    3737} // namespace WebCore
Note: See TracChangeset for help on using the changeset viewer.