Changeset 140576 in webkit


Ignore:
Timestamp:
Jan 23, 2013, 12:54:07 PM (12 years ago)
Author:
tony@chromium.org
Message:

Incorrect scrollable height during simplified layout
https://bugs.webkit.org/show_bug.cgi?id=107193

Reviewed by David Hyatt.

Source/WebCore:

When computing overflow we need the height of the block before
it was clamped (i.e., before updateLogicalHeight() has been called).

During simplified layout, we don't have this information and we were
using the clamped height by mistake. To fix this, we now store the
pre-clamped height on RenderOverflow so we can properly compute
overflow.

Test: fast/overflow/height-during-simplified-layout.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::computeOverflow): Save the height if we have overflow.
(WebCore::RenderBlock::simplifiedLayout): If we have overflow, use the height that we saved
in computeOverflow.

  • rendering/RenderOverflow.h:

(WebCore::RenderOverflow::layoutClientAfterEdge):
(WebCore::RenderOverflow::setLayoutClientAfterEdge):
(RenderOverflow): Add a member variable to save the height.

LayoutTests:

  • fast/overflow/height-during-simplified-layout-expected.txt: Added.
  • fast/overflow/height-during-simplified-layout.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r140570 r140576  
     12013-01-23  Tony Chang  <tony@chromium.org>
     2
     3        Incorrect scrollable height during simplified layout
     4        https://bugs.webkit.org/show_bug.cgi?id=107193
     5
     6        Reviewed by David Hyatt.
     7
     8        * fast/overflow/height-during-simplified-layout-expected.txt: Added.
     9        * fast/overflow/height-during-simplified-layout.html: Added.
     10
    1112013-01-23  Robert Hogan  <robert@webkit.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r140575 r140576  
     12013-01-23  Tony Chang  <tony@chromium.org>
     2
     3        Incorrect scrollable height during simplified layout
     4        https://bugs.webkit.org/show_bug.cgi?id=107193
     5
     6        Reviewed by David Hyatt.
     7
     8        When computing overflow we need the height of the block before
     9        it was clamped (i.e., before updateLogicalHeight() has been called).
     10
     11        During simplified layout, we don't have this information and we were
     12        using the clamped height by mistake. To fix this, we now store the
     13        pre-clamped height on RenderOverflow so we can properly compute
     14        overflow.
     15
     16        Test: fast/overflow/height-during-simplified-layout.html
     17
     18        * rendering/RenderBlock.cpp:
     19        (WebCore::RenderBlock::computeOverflow): Save the height if we have overflow.
     20        (WebCore::RenderBlock::simplifiedLayout): If we have overflow, use the height that we saved
     21        in computeOverflow.
     22        * rendering/RenderOverflow.h:
     23        (WebCore::RenderOverflow::layoutClientAfterEdge):
     24        (WebCore::RenderOverflow::setLayoutClientAfterEdge):
     25        (RenderOverflow): Add a member variable to save the height.
     26
    1272013-01-23  Tom Sepez  <tsepez@chromium.org>
    228
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r140570 r140576  
    16751675            rectToApply = LayoutRect(clientRect.x(), clientRect.y(), max<LayoutUnit>(0, oldClientAfterEdge - clientRect.x()), 1);
    16761676        addLayoutOverflow(rectToApply);
     1677        if (hasRenderOverflow())
     1678            m_overflow->setLayoutClientAfterEdge(oldClientAfterEdge);
    16771679    }
    16781680       
     
    26072609    // For now just always recompute overflow.  This is no worse performance-wise than the old code that called rightmostPosition and
    26082610    // lowestPosition on every relayout so it's not a regression.
     2611    // computeOverflow expects the bottom edge before we clamp our height. Since this information isn't available during
     2612    // simplifiedLayout, we cache the value in m_overflow.
     2613    LayoutUnit oldClientAfterEdge = hasRenderOverflow() ? m_overflow->layoutClientAfterEdge() : clientLogicalBottom();
    26092614    m_overflow.clear();
    2610     computeOverflow(clientLogicalBottom(), true);
     2615    computeOverflow(oldClientAfterEdge, true);
    26112616
    26122617    statePusher.pop();
  • trunk/Source/WebCore/rendering/RenderOverflow.h

    r133779 r140576  
    6868    void setVisualOverflow(const LayoutRect&);
    6969
     70    LayoutUnit layoutClientAfterEdge() const { return m_layoutClientAfterEdge; }
     71    void setLayoutClientAfterEdge(LayoutUnit clientAfterEdge) { m_layoutClientAfterEdge = clientAfterEdge; }
     72
    7073private:
    7174    LayoutRect m_layoutOverflow;
    7275    LayoutRect m_visualOverflow;
     76
     77    LayoutUnit m_layoutClientAfterEdge;
    7378};
    7479
Note: See TracChangeset for help on using the changeset viewer.