Changeset 143546 in webkit


Ignore:
Timestamp:
Feb 20, 2013 6:02:24 PM (11 years ago)
Author:
hyatt@apple.com
Message:

[New Multicolumn] Fix overflow computation for column blocks.
https://bugs.webkit.org/show_bug.cgi?id=110392.

Reviewed by Simon Fraser.

Source/WebCore:

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::addOverflowFromChild):
Exclude in-flow RenderFlowThreads from overflow propagation.

  • rendering/RenderMultiColumnSet.h:
  • rendering/RenderRegion.h:

(WebCore::RenderRegion::shouldHaveAutoLogicalHeight):

  • rendering/RenderRegionSet.h:

(RenderRegionSet):
Override shouldHaveAutoLogicalHeight to always be false
for region sets and for columns. Eventually we're going to try
to leverage this code to do column balancing, and that's why
RenderMultiColumnSet has a unique override.

LayoutTests:

  • fast/multicol/newmulticol/column-rules-fixed-height-expected.html:
  • fast/multicol/newmulticol/column-rules-fixed-height.html:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r143542 r143546  
     12013-02-20  David Hyatt  <hyatt@apple.com>
     2
     3        [New Multicolumn] Fix overflow computation for column blocks.
     4        https://bugs.webkit.org/show_bug.cgi?id=110392.
     5
     6        Reviewed by Simon Fraser.
     7
     8        * fast/multicol/newmulticol/column-rules-fixed-height-expected.html:
     9        * fast/multicol/newmulticol/column-rules-fixed-height.html:
     10
    1112013-02-20  Christian Biesinger  <cbiesinger@chromium.org>
    212
  • trunk/LayoutTests/fast/multicol/newmulticol/column-rules-fixed-height-expected.html

    r143395 r143546  
    1 <body style="overflow:hidden">
     1<body>
    22<div style="-webkit-columns: 3; -webkit-column-rule: 4px solid maroon; padding: 0 10px; border:5px solid black; height:300px;">
    33Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla varius enim ac mi. Curabitur sollicitudin felis quis lectus. Quisque adipiscing rhoncus sem. Proin nulla purus, vulputate vel, varius ut, euismod et, nisi. Sed vitae felis vel orci sagittis aliquam. Cras convallis adipiscing sem. Nam nonummy enim. Nullam bibendum lobortis neque. Vestibulum velit orci, tempus euismod, pretium quis, interdum vitae, nulla. Phasellus eget ante et tortor condimentum vestibulum.
  • trunk/LayoutTests/fast/multicol/newmulticol/column-rules-fixed-height.html

    r143395 r143546  
    22internals.settings.setRegionBasedColumnsEnabled(true)
    33</script>
    4 <body style="overflow:hidden">
     4<body>
    55<div style="-webkit-columns: 3; -webkit-column-rule: 4px solid maroon; padding: 0 10px; border:5px solid black; height:300px;">
    66Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla varius enim ac mi. Curabitur sollicitudin felis quis lectus. Quisque adipiscing rhoncus sem. Proin nulla purus, vulputate vel, varius ut, euismod et, nisi. Sed vitae felis vel orci sagittis aliquam. Cras convallis adipiscing sem. Nam nonummy enim. Nullam bibendum lobortis neque. Vestibulum velit orci, tempus euismod, pretium quis, interdum vitae, nulla. Phasellus eget ante et tortor condimentum vestibulum.
  • trunk/Source/WebCore/ChangeLog

    r143545 r143546  
     12013-02-20  David Hyatt  <hyatt@apple.com>
     2
     3        [New Multicolumn] Fix overflow computation for column blocks.
     4        https://bugs.webkit.org/show_bug.cgi?id=110392.
     5
     6        Reviewed by Simon Fraser.
     7
     8        * rendering/RenderBox.cpp:
     9        (WebCore::RenderBox::addOverflowFromChild):
     10        Exclude in-flow RenderFlowThreads from overflow propagation.
     11
     12        * rendering/RenderMultiColumnSet.h:
     13        * rendering/RenderRegion.h:
     14        (WebCore::RenderRegion::shouldHaveAutoLogicalHeight):
     15         * rendering/RenderRegionSet.h:
     16        (RenderRegionSet):
     17        Override shouldHaveAutoLogicalHeight to always be false
     18        for region sets and for columns. Eventually we're going to try
     19        to leverage this code to do column balancing, and that's why
     20        RenderMultiColumnSet has a unique override.
     21
    1222013-02-20  Brandon Jones  <bajones@google.com>
    223 
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r143539 r143546  
    40264026void RenderBox::addOverflowFromChild(RenderBox* child, const LayoutSize& delta)
    40274027{
     4028    // Never allow flow threads to propagate overflow up to a parent.
     4029    if (child->isRenderFlowThread())
     4030        return;
     4031
    40284032    // Only propagate layout overflow from the child if the child isn't clipping its overflow.  If it is, then
    40294033    // its overflow is internal to it, and we don't care about it.  layoutOverflowRectForPropagation takes care of this
  • trunk/Source/WebCore/rendering/RenderMultiColumnSet.h

    r143506 r143546  
    105105    // FIXME: This will change once we have column sets constrained by enclosing pages, etc.
    106106    virtual LayoutUnit logicalHeightOfAllFlowThreadContent() const OVERRIDE { return m_computedColumnHeight; }
     107
     108    // FIXME: For now we return false, but it's likely we will leverage the auto height region code to do column
     109    // balancing. That's why we have an override of this function that is distinct from RenderRegionSet's override.
     110    virtual bool shouldHaveAutoLogicalHeight() const OVERRIDE { return false; }
    107111   
    108112    virtual void repaintFlowThreadContent(const LayoutRect& repaintRect, bool immediate) const OVERRIDE;
  • trunk/Source/WebCore/rendering/RenderRegion.cpp

    r143467 r143546  
    233233}
    234234
     235bool RenderRegion::shouldHaveAutoLogicalHeight() const
     236{
     237    bool hasSpecifiedEndpointsForHeight = style()->logicalTop().isSpecified() && style()->logicalBottom().isSpecified();
     238    bool hasAnchoredEndpointsForHeight = isOutOfFlowPositioned() && hasSpecifiedEndpointsForHeight;
     239    return style()->logicalHeight().isAuto() && !hasAnchoredEndpointsForHeight;
     240}
     241   
    235242void RenderRegion::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
    236243{
  • trunk/Source/WebCore/rendering/RenderRegion.h

    r143506 r143546  
    136136        const LayoutRect& flowThreadPortionOverflowRect, const LayoutPoint& regionLocation) const;
    137137
     138    virtual bool shouldHaveAutoLogicalHeight() const;
     139
    138140private:
    139141    virtual const char* renderName() const { return "RenderRegion"; }
    140142
    141143    virtual bool canHaveChildren() const OVERRIDE { return false; }
    142 
    143     bool shouldHaveAutoLogicalHeight() const
    144     {
    145         bool hasSpecifiedEndpointsForHeight = style()->logicalTop().isSpecified() && style()->logicalBottom().isSpecified();
    146         bool hasAnchoredEndpointsForHeight = isOutOfFlowPositioned() && hasSpecifiedEndpointsForHeight;
    147         return style()->logicalHeight().isAuto() && !hasAnchoredEndpointsForHeight;
    148     }
    149144
    150145    virtual void insertedIntoTree() OVERRIDE;
  • trunk/Source/WebCore/rendering/RenderRegionSet.h

    r140244 r143546  
    5050    RenderRegionSet(Element*, RenderFlowThread*);
    5151   
     52protected:
     53    virtual bool shouldHaveAutoLogicalHeight() const OVERRIDE { return false; }
     54
    5255private:
    5356    virtual void installFlowThread() OVERRIDE;
Note: See TracChangeset for help on using the changeset viewer.