Changeset 131972 in webkit


Ignore:
Timestamp:
Oct 19, 2012 6:49:10 PM (12 years ago)
Author:
tony@chromium.org
Message:

RenderFlexibleBox::preferredMainAxisContentExtentForChild can return a negative value
https://bugs.webkit.org/show_bug.cgi?id=97827

Reviewed by Ojan Vafai.

I'm pretty sure this isn't possible (logicalHeight and maxPreferredLogicalWidth should always include
border and padding), so just add an assert.

No new tests, the assert is for code clarity.

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r131971 r131972  
     12012-10-19  Tony Chang  <tony@chromium.org>
     2
     3        RenderFlexibleBox::preferredMainAxisContentExtentForChild can return a negative value
     4        https://bugs.webkit.org/show_bug.cgi?id=97827
     5
     6        Reviewed by Ojan Vafai.
     7
     8        I'm pretty sure this isn't possible (logicalHeight and maxPreferredLogicalWidth should always include
     9        border and padding), so just add an assert.
     10
     11        No new tests, the assert is for code clarity.
     12
     13        * rendering/RenderFlexibleBox.cpp:
     14        (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):
     15
    1162012-10-19  Tony Chang  <tony@chromium.org>
    217
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r131481 r131972  
    665665    if (flexBasis.isAuto()) {
    666666        LayoutUnit mainAxisExtent = hasOrthogonalFlow(child) ? child->logicalHeight() : child->maxPreferredLogicalWidth();
     667        ASSERT(mainAxisExtent - mainAxisBorderAndPaddingExtentForChild(child) >= 0);
    667668        return mainAxisExtent - mainAxisBorderAndPaddingExtentForChild(child);
    668669    }
Note: See TracChangeset for help on using the changeset viewer.