Changeset 121728 in webkit


Ignore:
Timestamp:
Jul 2, 2012 9:08:04 PM (12 years ago)
Author:
mitz@apple.com
Message:

Column height and count calculation ignores most overflow
https://bugs.webkit.org/show_bug.cgi?id=90392

Reviewed by Dean Jackson.

Source/WebCore:

Test: fast/multicol/overflow-content.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::relayoutForPagination): Changed to compute the overflow from children
and use the layout overflow height rather the content height.

LayoutTests:

  • fast/multicol/overflow-content-expected.html: Added.
  • fast/multicol/overflow-content.html: Added.
  • fast/multicol/vertical-rl/rules-with-border-before-expected.png:
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r121719 r121728  
     12012-07-02  Dan Bernstein  <mitz@apple.com>
     2
     3        Column height and count calculation ignores most overflow
     4        https://bugs.webkit.org/show_bug.cgi?id=90392
     5
     6        Reviewed by Dean Jackson.
     7
     8        * fast/multicol/overflow-content-expected.html: Added.
     9        * fast/multicol/overflow-content.html: Added.
     10        * fast/multicol/vertical-rl/rules-with-border-before-expected.png:
     11
    1122012-07-02  Yoshifumi Inoue  <yosin@chromium.org>
    213
  • trunk/Source/WebCore/ChangeLog

    r121727 r121728  
     12012-07-02  Dan Bernstein  <mitz@apple.com>
     2
     3        Column height and count calculation ignores most overflow
     4        https://bugs.webkit.org/show_bug.cgi?id=90392
     5
     6        Reviewed by Dean Jackson.
     7
     8        Test: fast/multicol/overflow-content.html
     9
     10        * rendering/RenderBlock.cpp:
     11        (WebCore::RenderBlock::relayoutForPagination): Changed to compute the overflow from children
     12        and use the layout overflow height rather the content height.
     13
    1142012-07-02  Chris Guan  <chris.guan@torchmobile.com.cn>
    215
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r121697 r121728  
    50845084        return false;
    50855085
     5086    OwnPtr<RenderOverflow> savedOverflow = m_overflow.release();
     5087    if (childrenInline())
     5088        addOverflowFromInlineChildren();
     5089    else
     5090        addOverflowFromBlockChildren();
     5091    LayoutUnit layoutOverflowLogicalBottom = (isHorizontalWritingMode() ? layoutOverflowRect().maxY() : layoutOverflowRect().maxX()) - borderBefore() - paddingBefore();
     5092
    50865093    // FIXME: We don't balance properly at all in the presence of forced page breaks.  We need to understand what
    50875094    // the distance between forced page breaks is so that we can avoid making the minimum column height too tall.
     
    50965103            if (!pageLogicalHeight) {
    50975104                LayoutUnit distanceBetweenBreaks = max<LayoutUnit>(colInfo->maximumDistanceBetweenForcedBreaks(),
    5098                                                                    view()->layoutState()->pageLogicalOffset(this, borderBefore() + paddingBefore() + contentLogicalHeight()) - colInfo->forcedBreakOffset());
     5105                                                                   view()->layoutState()->pageLogicalOffset(this, borderBefore() + paddingBefore() + layoutOverflowLogicalBottom) - colInfo->forcedBreakOffset());
    50995106                columnHeight = max(colInfo->minimumColumnHeight(), distanceBetweenBreaks);
    51005107            }
    5101         } else if (contentLogicalHeight() > boundedMultiply(pageLogicalHeight, desiredColumnCount)) {
     5108        } else if (layoutOverflowLogicalBottom > boundedMultiply(pageLogicalHeight, desiredColumnCount)) {
    51025109            // Now that we know the intrinsic height of the columns, we have to rebalance them.
    5103             columnHeight = max<LayoutUnit>(colInfo->minimumColumnHeight(), ceilf((float)contentLogicalHeight() / desiredColumnCount));
     5110            columnHeight = max<LayoutUnit>(colInfo->minimumColumnHeight(), ceilf((float)layoutOverflowLogicalBottom / desiredColumnCount));
    51045111        }
    51055112       
     
    51115118        }
    51125119    }
    5113    
     5120
    51145121    if (pageLogicalHeight)
    5115         colInfo->setColumnCountAndHeight(ceilf((float)contentLogicalHeight() / pageLogicalHeight), pageLogicalHeight);
     5122        colInfo->setColumnCountAndHeight(ceilf((float)layoutOverflowLogicalBottom / pageLogicalHeight), pageLogicalHeight);
    51165123
    51175124    if (columnCount(colInfo)) {
    51185125        setLogicalHeight(borderBefore() + paddingBefore() + colInfo->columnHeight() + borderAfter() + paddingAfter() + scrollbarLogicalHeight());
    51195126        m_overflow.clear();
    5120     }
     5127    } else
     5128        m_overflow = savedOverflow.release();
    51215129   
    51225130    return false;
Note: See TracChangeset for help on using the changeset viewer.