Changeset 117697 in webkit


Ignore:
Timestamp:
May 19, 2012 1:48:14 PM (12 years ago)
Author:
eae@chromium.org
Message:

Simplify RenderOverflow by using Rects
https://bugs.webkit.org/show_bug.cgi?id=86894

Reviewed by Eric Seidel.

Simplify the RenderOverflow class and the uses of it by storing the
overflow values in rects and using the rects instead of the individual
values where it makes sense.

No new tests, no change in functionality.

  • page/FrameView.cpp:

(WebCore::FrameView::adjustPageHeightDeprecated):
Change to use layoutOverflowRect().maxX() and replace C style casts with
C++ style to comply with style guide.

  • rendering/InlineFlowBox.h:

(WebCore::InlineFlowBox::logicalLeftLayoutOverflow):
(WebCore::InlineFlowBox::logicalRightLayoutOverflow):
(WebCore::InlineFlowBox::logicalTopLayoutOverflow):
(WebCore::InlineFlowBox::logicalBottomLayoutOverflow):
(WebCore::InlineFlowBox::logicalLeftVisualOverflow):
(WebCore::InlineFlowBox::logicalRightVisualOverflow):
(WebCore::InlineFlowBox::logicalTopVisualOverflow):
(WebCore::InlineFlowBox::logicalBottomVisualOverflow):
Change methods to use layoutOverflowRect() and visualOverflowRect().

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::scrollWidth):
(WebCore::RenderBox::scrollHeight):
Change methods to use visualOverflowRect().

(WebCore::RenderBox::clearLayoutOverflow):
Use setLayoutOverflow instead of resetLayoutOverflow (which has been
removed as it did exactly the same thing as the set method).

  • rendering/RenderBox.h:

(WebCore::RenderBox::maxLayoutOverflow):
(WebCore::RenderBox::logicalLeftLayoutOverflow):
(WebCore::RenderBox::logicalRightLayoutOverflow):
(WebCore::RenderBox::logicalLeftVisualOverflow):
(WebCore::RenderBox::logicalRightVisualOverflow):
Remove minYLayoutOverflow, maxYLayoutOverflow, minXLayoutOverflow and
maxXLayoutOverflow and update the remaining methods to use
layoutOverflowRect().

  • rendering/RenderMarquee.cpp:

(WebCore::RenderMarquee::computePosition):
Change to use layoutOverflowRect().

  • rendering/RenderOverflow.h:

(WebCore::RenderOverflow::RenderOverflow):
(WebCore::RenderOverflow::layoutOverflowRect):
(WebCore::RenderOverflow::visualOverflowRect):
(RenderOverflow):
(WebCore::RenderOverflow::setMinYLayoutOverflow):
(WebCore::RenderOverflow::setMaxYLayoutOverflow):
(WebCore::RenderOverflow::setMinXLayoutOverflow):
(WebCore::RenderOverflow::setMaxXLayoutOverflow):
(WebCore::RenderOverflow::setMinYVisualOverflow):
(WebCore::RenderOverflow::setMaxYVisualOverflow):
(WebCore::RenderOverflow::setMinXVisualOverflow):
(WebCore::RenderOverflow::setMaxXVisualOverflow):
(WebCore):
(WebCore::RenderOverflow::move):
(WebCore::RenderOverflow::addLayoutOverflow):
(WebCore::RenderOverflow::addVisualOverflow):
(WebCore::RenderOverflow::setLayoutOverflow):
(WebCore::RenderOverflow::setVisualOverflow):
Change RenderOverflow to use two rects instead of two sets of four
values. Remove [min|max][Layout|Visual]Overflow getters and change the
layoutOverflowRect and visualOverflowRect methods to return the rects.

  • rendering/RenderReplaced.cpp:

(WebCore::RenderReplaced::shouldPaint):
Change to use visualOverflowRect().

  • rendering/RenderTable.cpp:

(WebCore::RenderTable::layout):
Change to use visualOverflowRect().

  • rendering/RenderTableCell.cpp:

(WebCore::RenderTableCell::clippedOverflowRectForRepaint):
Change to use visualOverflowRect().

  • rendering/RenderTreeAsText.cpp:

(WebCore::writeLayers):
Change to use layoutOverflowRect().

Location:
trunk/Source/WebCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r117696 r117697  
     12012-05-19  Emil A Eklund  <eae@chromium.org>
     2
     3        Simplify RenderOverflow by using Rects
     4        https://bugs.webkit.org/show_bug.cgi?id=86894
     5
     6        Reviewed by Eric Seidel.
     7
     8        Simplify the RenderOverflow class and the uses of it by storing the
     9        overflow values in rects and using the rects instead of the individual
     10        values where it makes sense.
     11
     12        No new tests, no change in functionality.
     13
     14        * page/FrameView.cpp:
     15        (WebCore::FrameView::adjustPageHeightDeprecated):
     16        Change to use layoutOverflowRect().maxX() and replace C style casts with
     17        C++ style to comply with style guide.
     18       
     19        * rendering/InlineFlowBox.h:
     20        (WebCore::InlineFlowBox::logicalLeftLayoutOverflow):
     21        (WebCore::InlineFlowBox::logicalRightLayoutOverflow):
     22        (WebCore::InlineFlowBox::logicalTopLayoutOverflow):
     23        (WebCore::InlineFlowBox::logicalBottomLayoutOverflow):
     24        (WebCore::InlineFlowBox::logicalLeftVisualOverflow):
     25        (WebCore::InlineFlowBox::logicalRightVisualOverflow):
     26        (WebCore::InlineFlowBox::logicalTopVisualOverflow):
     27        (WebCore::InlineFlowBox::logicalBottomVisualOverflow):
     28        Change methods to use layoutOverflowRect() and visualOverflowRect().
     29       
     30        * rendering/RenderBox.cpp:
     31        (WebCore::RenderBox::scrollWidth):
     32        (WebCore::RenderBox::scrollHeight):
     33        Change methods to use visualOverflowRect().
     34       
     35        (WebCore::RenderBox::clearLayoutOverflow):
     36        Use setLayoutOverflow instead of resetLayoutOverflow (which has been
     37        removed as it did exactly the same thing as the set method).
     38       
     39        * rendering/RenderBox.h:
     40        (WebCore::RenderBox::maxLayoutOverflow):
     41        (WebCore::RenderBox::logicalLeftLayoutOverflow):
     42        (WebCore::RenderBox::logicalRightLayoutOverflow):
     43        (WebCore::RenderBox::logicalLeftVisualOverflow):
     44        (WebCore::RenderBox::logicalRightVisualOverflow):
     45        Remove minYLayoutOverflow, maxYLayoutOverflow, minXLayoutOverflow and
     46        maxXLayoutOverflow and update the remaining methods to use
     47        layoutOverflowRect().
     48       
     49        * rendering/RenderMarquee.cpp:
     50        (WebCore::RenderMarquee::computePosition):
     51        Change to use layoutOverflowRect().
     52       
     53        * rendering/RenderOverflow.h:
     54        (WebCore::RenderOverflow::RenderOverflow):
     55        (WebCore::RenderOverflow::layoutOverflowRect):
     56        (WebCore::RenderOverflow::visualOverflowRect):
     57        (RenderOverflow):
     58        (WebCore::RenderOverflow::setMinYLayoutOverflow):
     59        (WebCore::RenderOverflow::setMaxYLayoutOverflow):
     60        (WebCore::RenderOverflow::setMinXLayoutOverflow):
     61        (WebCore::RenderOverflow::setMaxXLayoutOverflow):
     62        (WebCore::RenderOverflow::setMinYVisualOverflow):
     63        (WebCore::RenderOverflow::setMaxYVisualOverflow):
     64        (WebCore::RenderOverflow::setMinXVisualOverflow):
     65        (WebCore::RenderOverflow::setMaxXVisualOverflow):
     66        (WebCore):
     67        (WebCore::RenderOverflow::move):
     68        (WebCore::RenderOverflow::addLayoutOverflow):
     69        (WebCore::RenderOverflow::addVisualOverflow):
     70        (WebCore::RenderOverflow::setLayoutOverflow):
     71        (WebCore::RenderOverflow::setVisualOverflow):
     72        Change RenderOverflow to use two rects instead of two sets of four
     73        values. Remove [min|max][Layout|Visual]Overflow getters and change the
     74        layoutOverflowRect and visualOverflowRect methods to return the rects.
     75       
     76        * rendering/RenderReplaced.cpp:
     77        (WebCore::RenderReplaced::shouldPaint):
     78        Change to use visualOverflowRect().
     79       
     80        * rendering/RenderTable.cpp:
     81        (WebCore::RenderTable::layout):
     82        Change to use visualOverflowRect().
     83       
     84        * rendering/RenderTableCell.cpp:
     85        (WebCore::RenderTableCell::clippedOverflowRectForRepaint):
     86        Change to use visualOverflowRect().
     87       
     88        * rendering/RenderTreeAsText.cpp:
     89        (WebCore::writeLayers):
     90        Change to use layoutOverflowRect().
     91
    1922012-05-19  Rob Buis  <rbuis@rim.com>
    293
  • trunk/Source/WebCore/page/FrameView.cpp

    r117313 r117697  
    32803280        // Use a context with painting disabled.
    32813281        GraphicsContext context((PlatformGraphicsContext*)0);
    3282         root->setTruncatedAt((int)floorf(oldBottom));
    3283         IntRect dirtyRect(0, (int)floorf(oldTop), root->maxXLayoutOverflow(), (int)ceilf(oldBottom - oldTop));
     3282        root->setTruncatedAt(static_cast<int>(floorf(oldBottom)));
     3283        IntRect dirtyRect(0, static_cast<int>(floorf(oldTop)), root->layoutOverflowRect().maxX(), static_cast<int>(ceilf(oldBottom - oldTop)));
    32843284        root->setPrintRect(dirtyRect);
    32853285        root->layer()->paint(&context, dirtyRect);
  • trunk/Source/WebCore/rendering/InlineFlowBox.h

    r116202 r117697  
    208208        return m_overflow ? m_overflow->layoutOverflowRect() : enclosingLayoutRect(frameRectIncludingLineHeight(lineTop, lineBottom));
    209209    }
    210     LayoutUnit logicalLeftLayoutOverflow() const { return m_overflow ? (isHorizontal() ? m_overflow->minXLayoutOverflow() : m_overflow->minYLayoutOverflow()) : static_cast<LayoutUnit>(logicalLeft()); }
    211     LayoutUnit logicalRightLayoutOverflow() const { return m_overflow ? (isHorizontal() ? m_overflow->maxXLayoutOverflow() : m_overflow->maxYLayoutOverflow()) : static_cast<LayoutUnit>(ceilf(logicalRight())); }
     210    LayoutUnit logicalLeftLayoutOverflow() const
     211    {
     212        return m_overflow ? (isHorizontal() ? m_overflow->layoutOverflowRect().x() : m_overflow->layoutOverflowRect().y()) :
     213                            static_cast<LayoutUnit>(logicalLeft());
     214    }
     215    LayoutUnit logicalRightLayoutOverflow() const
     216    {
     217        return m_overflow ? (isHorizontal() ? m_overflow->layoutOverflowRect().maxX() : m_overflow->layoutOverflowRect().maxY()) :
     218                            static_cast<LayoutUnit>(ceilf(logicalRight()));
     219    }
    212220    LayoutUnit logicalTopLayoutOverflow(LayoutUnit lineTop) const
    213221    {
    214222        if (m_overflow)
    215             return isHorizontal() ? m_overflow->minYLayoutOverflow() : m_overflow->minXLayoutOverflow();
     223            return isHorizontal() ? m_overflow->layoutOverflowRect().y() : m_overflow->layoutOverflowRect().x();
    216224        return lineTop;
    217225    }
     
    219227    {
    220228        if (m_overflow)
    221             return isHorizontal() ? m_overflow->maxYLayoutOverflow() : m_overflow->maxXLayoutOverflow();
     229            return isHorizontal() ? m_overflow->layoutOverflowRect().maxY() : m_overflow->layoutOverflowRect().maxX();
    222230        return lineBottom;
    223231    }
     
    234242        return m_overflow ? m_overflow->visualOverflowRect() : enclosingLayoutRect(frameRectIncludingLineHeight(lineTop, lineBottom));
    235243    }
    236     LayoutUnit logicalLeftVisualOverflow() const { return m_overflow ? (isHorizontal() ? m_overflow->minXVisualOverflow() : m_overflow->minYVisualOverflow()) : static_cast<LayoutUnit>(logicalLeft()); }
    237     LayoutUnit logicalRightVisualOverflow() const { return m_overflow ? (isHorizontal() ? m_overflow->maxXVisualOverflow() : m_overflow->maxYVisualOverflow()) : static_cast<LayoutUnit>(ceilf(logicalRight())); }
     244    LayoutUnit logicalLeftVisualOverflow() const { return m_overflow ? (isHorizontal() ? m_overflow->visualOverflowRect().x() : m_overflow->visualOverflowRect().y()) : static_cast<LayoutUnit>(logicalLeft()); }
     245    LayoutUnit logicalRightVisualOverflow() const { return m_overflow ? (isHorizontal() ? m_overflow->visualOverflowRect().maxX() : m_overflow->visualOverflowRect().maxY()) : static_cast<LayoutUnit>(ceilf(logicalRight())); }
    238246    LayoutUnit logicalTopVisualOverflow(LayoutUnit lineTop) const
    239247    {
    240248        if (m_overflow)
    241             return isHorizontal() ? m_overflow->minYVisualOverflow() : m_overflow->minXVisualOverflow();
     249            return isHorizontal() ? m_overflow->visualOverflowRect().y() : m_overflow->visualOverflowRect().x();
    242250        return lineTop;
    243251    }
     
    245253    {
    246254        if (m_overflow)
    247             return isHorizontal() ? m_overflow->maxYVisualOverflow() : m_overflow->maxXVisualOverflow();
     255            return isHorizontal() ? m_overflow->visualOverflowRect().maxY() : m_overflow->visualOverflowRect().maxX();
    248256        return lineBottom;
    249257    }
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r117633 r117697  
    500500    // FIXME: Need to work right with writing modes.
    501501    if (style()->isLeftToRightDirection())
    502         return snapSizeToPixel(max(clientWidth(), maxXLayoutOverflow() - borderLeft()), clientLeft());
    503     return clientWidth() - min(ZERO_LAYOUT_UNIT, minXLayoutOverflow() - borderLeft());
     502        return snapSizeToPixel(max(clientWidth(), layoutOverflowRect().maxX() - borderLeft()), clientLeft());
     503    return clientWidth() - min(ZERO_LAYOUT_UNIT, layoutOverflowRect().x() - borderLeft());
    504504}
    505505
     
    510510    // For objects with visible overflow, this matches IE.
    511511    // FIXME: Need to work right with writing modes.
    512     return snapSizeToPixel(max(clientHeight(), maxYLayoutOverflow() - borderTop()), clientTop());
     512    return snapSizeToPixel(max(clientHeight(), layoutOverflowRect().maxY() - borderTop()), clientTop());
    513513}
    514514
     
    37363736    }
    37373737   
    3738     m_overflow->resetLayoutOverflow(borderBoxRect());
     3738    m_overflow->setLayoutOverflow(borderBoxRect());
    37393739}
    37403740
  • trunk/Source/WebCore/rendering/RenderBox.h

    r117482 r117697  
    164164    LayoutRect layoutOverflowRect() const { return m_overflow ? m_overflow->layoutOverflowRect() : clientBoxRect(); }
    165165    IntRect pixelSnappedLayoutOverflowRect() const { return pixelSnappedIntRect(layoutOverflowRect()); }
    166     LayoutUnit minYLayoutOverflow() const { return m_overflow? m_overflow->minYLayoutOverflow() : static_cast<LayoutUnit>(borderTop()); }
    167     LayoutUnit maxYLayoutOverflow() const { return m_overflow ? m_overflow->maxYLayoutOverflow() : static_cast<LayoutUnit>(borderTop()) + clientHeight(); }
    168     LayoutUnit minXLayoutOverflow() const { return m_overflow ? m_overflow->minXLayoutOverflow() : static_cast<LayoutUnit>(borderLeft()); }
    169     LayoutUnit maxXLayoutOverflow() const { return m_overflow ? m_overflow->maxXLayoutOverflow() : static_cast<LayoutUnit>(borderLeft()) + clientWidth(); }
    170     LayoutSize maxLayoutOverflow() const { return LayoutSize(maxXLayoutOverflow(), maxYLayoutOverflow()); }
    171     LayoutUnit logicalLeftLayoutOverflow() const { return style()->isHorizontalWritingMode() ? minXLayoutOverflow() : minYLayoutOverflow(); }
    172     LayoutUnit logicalRightLayoutOverflow() const { return style()->isHorizontalWritingMode() ? maxXLayoutOverflow() : maxYLayoutOverflow(); }
     166    LayoutSize maxLayoutOverflow() const { return LayoutSize(layoutOverflowRect().maxX(), layoutOverflowRect().maxY()); }
     167    LayoutUnit logicalLeftLayoutOverflow() const { return style()->isHorizontalWritingMode() ? layoutOverflowRect().x() : layoutOverflowRect().y(); }
     168    LayoutUnit logicalRightLayoutOverflow() const { return style()->isHorizontalWritingMode() ? layoutOverflowRect().maxX() : layoutOverflowRect().maxY(); }
    173169   
    174170    virtual LayoutRect visualOverflowRect() const { return m_overflow ? m_overflow->visualOverflowRect() : borderBoxRect(); }
    175     LayoutUnit minYVisualOverflow() const { return m_overflow? m_overflow->minYVisualOverflow() : ZERO_LAYOUT_UNIT; }
    176     LayoutUnit maxYVisualOverflow() const { return m_overflow ? m_overflow->maxYVisualOverflow() : height(); }
    177     LayoutUnit minXVisualOverflow() const { return m_overflow ? m_overflow->minXVisualOverflow() : ZERO_LAYOUT_UNIT; }
    178     LayoutUnit maxXVisualOverflow() const { return m_overflow ? m_overflow->maxXVisualOverflow() : width(); }
    179     LayoutUnit logicalLeftVisualOverflow() const { return style()->isHorizontalWritingMode() ? minXVisualOverflow() : minYVisualOverflow(); }
    180     LayoutUnit logicalRightVisualOverflow() const { return style()->isHorizontalWritingMode() ? maxXVisualOverflow() : maxYVisualOverflow(); }
     171    LayoutUnit logicalLeftVisualOverflow() const { return style()->isHorizontalWritingMode() ? visualOverflowRect().x() : visualOverflowRect().y(); }
     172    LayoutUnit logicalRightVisualOverflow() const { return style()->isHorizontalWritingMode() ? visualOverflowRect().maxX() : visualOverflowRect().maxY(); }
    181173   
    182174    void addLayoutOverflow(const LayoutRect&);
  • trunk/Source/WebCore/rendering/RenderMarquee.cpp

    r114079 r117697  
    138138    }
    139139    else {
    140         int contentHeight = box->maxYLayoutOverflow() - box->borderTop() + box->paddingBottom();
     140        int contentHeight = box->layoutOverflowRect().maxY() - box->borderTop() + box->paddingBottom();
    141141        int clientHeight = box->clientHeight();
    142142        if (dir == MUP) {
  • trunk/Source/WebCore/rendering/RenderOverflow.h

    r95901 r117697  
    4242public:
    4343    RenderOverflow(const LayoutRect& layoutRect, const LayoutRect& visualRect)
    44         : m_minYLayoutOverflow(layoutRect.y())
    45         , m_maxYLayoutOverflow(layoutRect.maxY())
    46         , m_minXLayoutOverflow(layoutRect.x())
    47         , m_maxXLayoutOverflow(layoutRect.maxX())
    48         , m_minYVisualOverflow(visualRect.y())
    49         , m_maxYVisualOverflow(visualRect.maxY())
    50         , m_minXVisualOverflow(visualRect.x())
    51         , m_maxXVisualOverflow(visualRect.maxX())
     44        : m_layoutOverflow(layoutRect)
     45        , m_visualOverflow(visualRect)
    5246    {
    5347    }
    5448   
    55     LayoutUnit minYLayoutOverflow() const { return m_minYLayoutOverflow; }
    56     LayoutUnit maxYLayoutOverflow() const { return m_maxYLayoutOverflow; }
    57     LayoutUnit minXLayoutOverflow() const { return m_minXLayoutOverflow; }
    58     LayoutUnit maxXLayoutOverflow() const { return m_maxXLayoutOverflow; }
    59     LayoutRect layoutOverflowRect() const;
     49    const LayoutRect layoutOverflowRect() const { return m_layoutOverflow; }
     50    const LayoutRect visualOverflowRect() const { return m_visualOverflow; }
    6051
    61     LayoutUnit minYVisualOverflow() const { return m_minYVisualOverflow; }
    62     LayoutUnit maxYVisualOverflow() const { return m_maxYVisualOverflow; }
    63     LayoutUnit minXVisualOverflow() const { return m_minXVisualOverflow; }
    64     LayoutUnit maxXVisualOverflow() const { return m_maxXVisualOverflow; }
    65     LayoutRect visualOverflowRect() const;
    66 
    67     void setMinYLayoutOverflow(LayoutUnit overflow) { m_minYLayoutOverflow = overflow; }
    68     void setMaxYLayoutOverflow(LayoutUnit overflow) { m_maxYLayoutOverflow = overflow; }
    69     void setMinXLayoutOverflow(LayoutUnit overflow) { m_minXLayoutOverflow = overflow; }
    70     void setMaxXLayoutOverflow(LayoutUnit overflow) { m_maxXLayoutOverflow = overflow; }
     52    void setMinYLayoutOverflow(LayoutUnit overflow) { m_layoutOverflow.setY(overflow); }
     53    void setMaxYLayoutOverflow(LayoutUnit overflow) { m_layoutOverflow.setHeight(overflow - m_layoutOverflow.y()); }
     54    void setMinXLayoutOverflow(LayoutUnit overflow) { m_layoutOverflow.setX(overflow); }
     55    void setMaxXLayoutOverflow(LayoutUnit overflow) { m_layoutOverflow.setWidth(overflow - m_layoutOverflow.x()); }
    7156   
    72     void setMinYVisualOverflow(LayoutUnit overflow) { m_minYVisualOverflow = overflow; }
    73     void setMaxYVisualOverflow(LayoutUnit overflow) { m_maxYVisualOverflow = overflow; }
    74     void setMinXVisualOverflow(LayoutUnit overflow) { m_minXVisualOverflow = overflow; }
    75     void setMaxXVisualOverflow(LayoutUnit overflow) { m_maxXVisualOverflow = overflow; }
     57    void setMinYVisualOverflow(LayoutUnit overflow) { m_visualOverflow.setY(overflow); }
     58    void setMaxYVisualOverflow(LayoutUnit overflow) { m_visualOverflow.setHeight(overflow - m_layoutOverflow.y()); }
     59    void setMinXVisualOverflow(LayoutUnit overflow) { m_visualOverflow.setX(overflow); }
     60    void setMaxXVisualOverflow(LayoutUnit overflow) { m_visualOverflow.setWidth(overflow - m_layoutOverflow.x()); }
    7661   
    7762    void move(LayoutUnit dx, LayoutUnit dy);
     
    8368    void setVisualOverflow(const LayoutRect&);
    8469
    85     void resetLayoutOverflow(const LayoutRect& defaultRect);
    86 
    8770private:
    88     LayoutUnit m_minYLayoutOverflow;
    89     LayoutUnit m_maxYLayoutOverflow;
    90     LayoutUnit m_minXLayoutOverflow;
    91     LayoutUnit m_maxXLayoutOverflow;
    92 
    93     LayoutUnit m_minYVisualOverflow;
    94     LayoutUnit m_maxYVisualOverflow;
    95     LayoutUnit m_minXVisualOverflow;
    96     LayoutUnit m_maxXVisualOverflow;
     71    LayoutRect m_layoutOverflow;
     72    LayoutRect m_visualOverflow;
    9773};
    98 
    99 inline LayoutRect RenderOverflow::layoutOverflowRect() const
    100 {
    101     return LayoutRect(m_minXLayoutOverflow, m_minYLayoutOverflow, m_maxXLayoutOverflow - m_minXLayoutOverflow, m_maxYLayoutOverflow - m_minYLayoutOverflow);
    102 }
    103 
    104 inline LayoutRect RenderOverflow::visualOverflowRect() const
    105 {
    106     return LayoutRect(m_minXVisualOverflow, m_minYVisualOverflow, m_maxXVisualOverflow - m_minXVisualOverflow, m_maxYVisualOverflow - m_minYVisualOverflow);
    107 }
    10874
    10975inline void RenderOverflow::move(LayoutUnit dx, LayoutUnit dy)
    11076{
    111     m_minYLayoutOverflow += dy;
    112     m_maxYLayoutOverflow += dy;
    113     m_minXLayoutOverflow += dx;
    114     m_maxXLayoutOverflow += dx;
    115    
    116     m_minYVisualOverflow += dy;
    117     m_maxYVisualOverflow += dy;
    118     m_minXVisualOverflow += dx;
    119     m_maxXVisualOverflow += dx;
     77    m_layoutOverflow.move(dx, dy);
     78    m_visualOverflow.move(dx, dy);
    12079}
    12180
    12281inline void RenderOverflow::addLayoutOverflow(const LayoutRect& rect)
    12382{
    124     m_minYLayoutOverflow = std::min(rect.y(), m_minYLayoutOverflow);
    125     m_maxYLayoutOverflow = std::max(rect.maxY(), m_maxYLayoutOverflow);
    126     m_minXLayoutOverflow = std::min(rect.x(), m_minXLayoutOverflow);
    127     m_maxXLayoutOverflow = std::max(rect.maxX(), m_maxXLayoutOverflow);
     83    LayoutUnit maxX = std::max(rect.maxX(), m_layoutOverflow.maxX());
     84    LayoutUnit maxY = std::max(rect.maxY(), m_layoutOverflow.maxY());
     85    m_layoutOverflow.setX(std::min(rect.x(), m_layoutOverflow.x()));
     86    m_layoutOverflow.setY(std::min(rect.y(), m_layoutOverflow.y()));
     87    m_layoutOverflow.setWidth(maxX - m_layoutOverflow.x());
     88    m_layoutOverflow.setHeight(maxY - m_layoutOverflow.y());
    12889}
    12990
    13091inline void RenderOverflow::addVisualOverflow(const LayoutRect& rect)
    13192{
    132     m_minYVisualOverflow = std::min(rect.y(), m_minYVisualOverflow);
    133     m_maxYVisualOverflow = std::max(rect.maxY(), m_maxYVisualOverflow);
    134     m_minXVisualOverflow = std::min(rect.x(), m_minXVisualOverflow);
    135     m_maxXVisualOverflow = std::max(rect.maxX(), m_maxXVisualOverflow);
     93    LayoutUnit maxX = std::max(rect.maxX(), m_visualOverflow.maxX());
     94    LayoutUnit maxY = std::max(rect.maxY(), m_visualOverflow.maxY());
     95    m_visualOverflow.setX(std::min(rect.x(), m_visualOverflow.x()));
     96    m_visualOverflow.setY(std::min(rect.y(), m_visualOverflow.y()));
     97    m_visualOverflow.setWidth(maxX - m_visualOverflow.x());
     98    m_visualOverflow.setHeight(maxY - m_visualOverflow.y());
    13699}
    137100
    138101inline void RenderOverflow::setLayoutOverflow(const LayoutRect& rect)
    139102{
    140     m_minYLayoutOverflow = rect.y();
    141     m_maxYLayoutOverflow = rect.maxY();
    142     m_minXLayoutOverflow = rect.x();
    143     m_maxXLayoutOverflow = rect.maxX();
     103    m_layoutOverflow = rect;
    144104}
    145105
    146106inline void RenderOverflow::setVisualOverflow(const LayoutRect& rect)
    147107{
    148     m_minYVisualOverflow = rect.y();
    149     m_maxYVisualOverflow = rect.maxY();
    150     m_minXVisualOverflow = rect.x();
    151     m_maxXVisualOverflow = rect.maxX();
    152 }
    153 
    154 inline void RenderOverflow::resetLayoutOverflow(const LayoutRect& rect)
    155 {
    156     m_minYLayoutOverflow = rect.y();
    157     m_maxYLayoutOverflow = rect.maxY();
    158     m_minXLayoutOverflow = rect.x();
    159     m_maxXLayoutOverflow = rect.maxX();
     108    m_visualOverflow = rect;
    160109}
    161110
  • trunk/Source/WebCore/rendering/RenderReplaced.cpp

    r113665 r117697  
    182182
    183183    // Early exit if the element touches the edges.
    184     LayoutUnit top = adjustedPaintOffset.y() + minYVisualOverflow();
    185     LayoutUnit bottom = adjustedPaintOffset.y() + maxYVisualOverflow();
     184    LayoutUnit top = adjustedPaintOffset.y() + visualOverflowRect().y();
     185    LayoutUnit bottom = adjustedPaintOffset.y() + visualOverflowRect().maxY();
    186186    if (isSelected() && m_inlineBoxWrapper) {
    187187        LayoutUnit selTop = paintOffset.y() + m_inlineBoxWrapper->root()->selectionTop();
     
    193193    LayoutRect localRepaintRect = paintInfo.rect;
    194194    localRepaintRect.inflate(maximalOutlineSize(paintInfo.phase));
    195     if (adjustedPaintOffset.x() + minXVisualOverflow() >= localRepaintRect.maxX() || adjustedPaintOffset.x() + maxXVisualOverflow() <= localRepaintRect.x())
     195    if (adjustedPaintOffset.x() + visualOverflowRect().x() >= localRepaintRect.maxX() || adjustedPaintOffset.x() + visualOverflowRect().maxX() <= localRepaintRect.x())
    196196        return false;
    197197
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r117484 r117697  
    424424        if (!sectionMoved && section->logicalTop() != logicalHeight()) {
    425425            sectionMoved = true;
    426             movedSectionLogicalTop = min(logicalHeight(), section->logicalTop()) + (style()->isHorizontalWritingMode() ? section->minYVisualOverflow() : section->minXVisualOverflow());
     426            movedSectionLogicalTop = min(logicalHeight(), section->logicalTop()) + (style()->isHorizontalWritingMode() ? section->visualOverflowRect().y() : section->visualOverflowRect().x());
    427427        }
    428428        section->setLogicalLocation(LayoutPoint(sectionLogicalLeft, logicalHeight()));
     
    463463    if (!didFullRepaint && sectionMoved) {
    464464        if (style()->isHorizontalWritingMode())
    465             repaintRectangle(LayoutRect(minXVisualOverflow(), movedSectionLogicalTop, maxXVisualOverflow() - minXVisualOverflow(), maxYVisualOverflow() - movedSectionLogicalTop));
     465            repaintRectangle(LayoutRect(visualOverflowRect().x(), movedSectionLogicalTop, visualOverflowRect().width(), visualOverflowRect().maxY() - movedSectionLogicalTop));
    466466        else
    467             repaintRectangle(LayoutRect(movedSectionLogicalTop, minYVisualOverflow(), maxXVisualOverflow() - movedSectionLogicalTop, maxYVisualOverflow() - minYVisualOverflow()));
     467            repaintRectangle(LayoutRect(movedSectionLogicalTop, visualOverflowRect().y(), visualOverflowRect().maxX() - movedSectionLogicalTop, visualOverflowRect().height()));
    468468    }
    469469
  • trunk/Source/WebCore/rendering/RenderTableCell.cpp

    r117309 r117697  
    291291        }
    292292    }
    293     LayoutPoint location(max<LayoutUnit>(left, -minXVisualOverflow()), max<LayoutUnit>(top, -minYVisualOverflow()));
    294     LayoutRect r(-location.x(), -location.y(), location.x() + max(width() + right, maxXVisualOverflow()), location.y() + max(height() + bottom, maxYVisualOverflow()));
     293    LayoutPoint location(max<LayoutUnit>(left, -visualOverflowRect().x()), max<LayoutUnit>(top, -visualOverflowRect().y()));
     294    LayoutRect r(-location.x(), -location.y(), location.x() + max(width() + right, visualOverflowRect().maxX()), location.y() + max(height() + bottom, visualOverflowRect().maxY()));
    295295
    296296    if (RenderView* v = view()) {
  • trunk/Source/WebCore/rendering/RenderTreeAsText.cpp

    r116013 r117697  
    711711    LayoutRect paintDirtyRect(paintRect);
    712712    if (rootLayer == l) {
    713         paintDirtyRect.setWidth(max<LayoutUnit>(paintDirtyRect.width(), rootLayer->renderBox()->maxXLayoutOverflow()));
    714         paintDirtyRect.setHeight(max<LayoutUnit>(paintDirtyRect.height(), rootLayer->renderBox()->maxYLayoutOverflow()));
     713        paintDirtyRect.setWidth(max<LayoutUnit>(paintDirtyRect.width(), rootLayer->renderBox()->layoutOverflowRect().maxX()));
     714        paintDirtyRect.setHeight(max<LayoutUnit>(paintDirtyRect.height(), rootLayer->renderBox()->layoutOverflowRect().maxY()));
    715715        l->setSize(l->size().expandedTo(pixelSnappedIntSize(l->renderBox()->maxLayoutOverflow(), LayoutPoint(0, 0))));
    716716    }
Note: See TracChangeset for help on using the changeset viewer.