Changeset 167478 in webkit


Ignore:
Timestamp:
Apr 17, 2014 7:11:12 PM (10 years ago)
Author:
hyatt@apple.com
Message:

[New Multicolumn] Pagination mode messed up with non-inline axis and reversed direction.
https://bugs.webkit.org/show_bug.cgi?id=131811

Reviewed by Dean Jackson.

Source/WebCore:
Added fast/multicol/newmulticol/compare-with-old-impl/BottomToTop-tb.html

With block axis pagination mode, it is possible to set a column height that is not the same
as the available fill height for a block. The new multi-column code had the assumption that
the column height was the same as the amount of fill room you had available. This is not
the case.

To correct the issue, I added a member variable to RenderMultiColumnSet that stores the
available column height as a separate variable from the computed column height. This allows
the pagination API to specify a different column height that is not the same as the view's
content height.

Even though it isn't involved in the solution, I also patched pageOrViewLogicalHeight on
RenderView to work with the new column code as well.

  • rendering/RenderMultiColumnSet.cpp:

(WebCore::RenderMultiColumnSet::RenderMultiColumnSet):
(WebCore::RenderMultiColumnSet::setAndConstrainColumnHeight):
(WebCore::RenderMultiColumnSet::computeLogicalHeight):

  • rendering/RenderMultiColumnSet.h:
  • rendering/RenderView.cpp:

(WebCore::RenderView::pageOrViewLogicalHeight):

LayoutTests:

  • fast/multicol/newmulticol/compare-with-old-impl/BottomToTop-tb-expected.html: Added.
  • fast/multicol/newmulticol/compare-with-old-impl/BottomToTop-tb.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r167472 r167478  
     12014-04-17  David Hyatt  <hyatt@apple.com>
     2
     3        [New Multicolumn] Pagination mode messed up with non-inline axis and reversed direction.
     4        https://bugs.webkit.org/show_bug.cgi?id=131811
     5
     6        Reviewed by Dean Jackson.
     7
     8        * fast/multicol/newmulticol/compare-with-old-impl/BottomToTop-tb-expected.html: Added.
     9        * fast/multicol/newmulticol/compare-with-old-impl/BottomToTop-tb.html: Added.
     10
    1112014-04-16  Huang Dongsung  <luxtella@company100.net>
    212
  • trunk/Source/WebCore/ChangeLog

    r167477 r167478  
     12014-04-17  David Hyatt  <hyatt@apple.com>
     2
     3        [New Multicolumn] Pagination mode messed up with non-inline axis and reversed direction.
     4        https://bugs.webkit.org/show_bug.cgi?id=131811
     5
     6        Reviewed by Dean Jackson.
     7
     8        Added fast/multicol/newmulticol/compare-with-old-impl/BottomToTop-tb.html
     9       
     10        With block axis pagination mode, it is possible to set a column height that is not the same
     11        as the available fill height for a block. The new multi-column code had the assumption that
     12        the column height was the same as the amount of fill room you had available. This is not
     13        the case.
     14       
     15        To correct the issue, I added a member variable to RenderMultiColumnSet that stores the
     16        available column height as a separate variable from the computed column height. This allows
     17        the pagination API to specify a different column height that is not the same as the view's
     18        content height.
     19
     20        Even though it isn't involved in the solution, I also patched pageOrViewLogicalHeight on
     21        RenderView to work with the new column code as well.
     22
     23        * rendering/RenderMultiColumnSet.cpp:
     24        (WebCore::RenderMultiColumnSet::RenderMultiColumnSet):
     25        (WebCore::RenderMultiColumnSet::setAndConstrainColumnHeight):
     26        (WebCore::RenderMultiColumnSet::computeLogicalHeight):
     27        * rendering/RenderMultiColumnSet.h:
     28        * rendering/RenderView.cpp:
     29        (WebCore::RenderView::pageOrViewLogicalHeight):
     30
    1312014-04-17  Anders Carlsson  <andersca@apple.com>
    232
  • trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp

    r167463 r167478  
    2727#include "RenderMultiColumnSet.h"
    2828
     29#include "FrameView.h"
    2930#include "PaintInfo.h"
    3031#include "RenderLayer.h"
    3132#include "RenderMultiColumnFlowThread.h"
    3233#include "RenderMultiColumnSpannerPlaceholder.h"
     34#include "RenderView.h"
    3335
    3436namespace WebCore {
     
    3941    , m_computedColumnWidth(0)
    4042    , m_computedColumnHeight(0)
     43    , m_availableColumnHeight(0)
    4144    , m_maxColumnHeight(RenderFlowThread::maxLogicalHeight())
    4245    , m_minSpaceShortage(RenderFlowThread::maxLogicalHeight())
     
    152155    if (m_computedColumnHeight > m_maxColumnHeight)
    153156        m_computedColumnHeight = m_maxColumnHeight;
     157   
     158    // FIXME: The available column height is not the same as the constrained height specified
     159    // by the pagination API. The column set in this case is allowed to be bigger than the
     160    // height of a single column. We cache available column height in order to use it
     161    // in computeLogicalHeight later. This is pretty gross, and maybe there's a better way
     162    // to formalize the idea of clamped column heights without having a view dependency
     163    // here.
     164    m_availableColumnHeight = m_computedColumnHeight;
     165    if (multiColumnFlowThread() && !multiColumnFlowThread()->progressionIsInline() && parent()->isRenderView()) {
     166        int pageLength = view().frameView().pagination().pageLength;
     167        if (pageLength)
     168            m_computedColumnHeight = pageLength;
     169    }
    154170    // FIXME: the height may also be affected by the enclosing pagination context, if any.
    155171}
     
    397413void RenderMultiColumnSet::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const
    398414{
    399     computedValues.m_extent = m_computedColumnHeight;
     415    computedValues.m_extent = m_availableColumnHeight;
    400416    computedValues.m_position = logicalTop;
    401417}
  • trunk/Source/WebCore/rendering/RenderMultiColumnSet.h

    r167463 r167478  
    179179    LayoutUnit m_computedColumnWidth; // Used column width (the resulting 'W' from the pseudo-algorithm in the multicol spec)
    180180    LayoutUnit m_computedColumnHeight;
     181    LayoutUnit m_availableColumnHeight;
    181182   
    182183    // The following variables are used when balancing the column set.
  • trunk/Source/WebCore/rendering/RenderView.cpp

    r167444 r167478  
    296296        return pageLogicalHeight();
    297297   
    298     if (hasColumns() && !style().hasInlineColumnAxis()) {
     298    if ((hasColumns() || multiColumnFlowThread()) && !style().hasInlineColumnAxis()) {
    299299        if (int pageLength = frameView().pagination().pageLength)
    300300            return pageLength;
Note: See TracChangeset for help on using the changeset viewer.