Changeset 52566 in webkit


Ignore:
Timestamp:
Dec 26, 2009 5:27:29 PM (14 years ago)
Author:
mitz@apple.com
Message:

REGRESSION (r47255): Extra Large Amount of Empty Space
https://bugs.webkit.org/show_bug.cgi?id=32690

Reviewed by Sam Weinig.

WebCore:

Test: fast/block/float/clear-to-fit.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::getClearDelta): Only clear floats as needed to
fit the child on the line.

LayoutTests:

  • fast/block/float/clear-to-fit-expected.checksum: Added.
  • fast/block/float/clear-to-fit-expected.png: Added.
  • fast/block/float/clear-to-fit-expected.txt: Added.
  • fast/block/float/clear-to-fit.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r52565 r52566  
     12009-12-26  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        REGRESSION (r47255): Extra Large Amount of Empty Space
     6        https://bugs.webkit.org/show_bug.cgi?id=32690
     7
     8        * fast/block/float/clear-to-fit-expected.checksum: Added.
     9        * fast/block/float/clear-to-fit-expected.png: Added.
     10        * fast/block/float/clear-to-fit-expected.txt: Added.
     11        * fast/block/float/clear-to-fit.html: Added.
     12
    1132009-12-26  Csaba Osztrogonác  <ossy@webkit.org>
    214
  • trunk/WebCore/ChangeLog

    r52564 r52566  
     12009-12-26  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        REGRESSION (r47255): Extra Large Amount of Empty Space
     6        https://bugs.webkit.org/show_bug.cgi?id=32690
     7
     8        Test: fast/block/float/clear-to-fit.html
     9
     10        * rendering/RenderBlock.cpp:
     11        (WebCore::RenderBlock::getClearDelta): Only clear floats as needed to
     12        fit the child on the line.
     13
    1142009-12-25  Kent Tamura  <tkent@chromium.org>
    215
  • trunk/WebCore/rendering/RenderBlock.cpp

    r52127 r52566  
    31923192
    31933193    // We also clear floats if we are too big to sit on the same line as a float (and wish to avoid floats by default).
    3194     // FIXME: Note that the remaining space checks aren't quite accurate, since you should be able to clear only some floats (the minimum # needed
    3195     // to fit) and not all (we should be using nextFloatBottomBelow and looping).
    31963194    int result = clearSet ? max(0, bottom - yPos) : 0;
    31973195    if (!result && child->avoidsFloats()) {
    3198         int widthAtCurrentHeight = lineWidth(yPos, false);
    31993196        int availableWidth = this->availableWidth();
    3200         if (widthAtCurrentHeight < availableWidth) {
    3201             int oldYPos = child->y();
    3202             int oldWidth = child->width();
    3203             child->setY(yPos);
     3197        if (child->minPrefWidth() > availableWidth)
     3198            return 0;
     3199
     3200        int y = yPos;
     3201        while (true) {
     3202            int widthAtY = lineWidth(y, false);
     3203            if (widthAtY == availableWidth)
     3204                return y - yPos;
     3205
     3206            int oldChildY = child->y();
     3207            int oldChildWidth = child->width();
     3208            child->setY(y);
    32043209            child->calcWidth();
    3205             if (child->width() > widthAtCurrentHeight && child->minPrefWidth() <= availableWidth)
    3206                 result = max(0, floatBottom() - yPos);
    3207             child->setY(oldYPos);
    3208             child->setWidth(oldWidth);
    3209         }
     3210            int childWidthAtY = child->width();
     3211            child->setY(oldChildY);
     3212            child->setWidth(oldChildWidth);
     3213
     3214            if (childWidthAtY <= widthAtY)
     3215                return y - yPos;
     3216
     3217            y = nextFloatBottomBelow(y);
     3218            ASSERT(y >= yPos);
     3219            if (y < yPos)
     3220                break;
     3221        }
     3222        ASSERT_NOT_REACHED();
    32103223    }
    32113224    return result;
Note: See TracChangeset for help on using the changeset viewer.