Changeset 167820 in webkit


Ignore:
Timestamp:
Apr 25, 2014 2:05:59 PM (10 years ago)
Author:
hyatt@apple.com
Message:

Column rules not respecting scroll offsets.
https://bugs.webkit.org/show_bug.cgi?id=109683

Reviewed by Dean Jackson.

Source/WebCore:
Added fast/multicol/scrolling-column-rules.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::paintColumnRules):
Make paintColumnRules virtual so that it works with both column implementations.

(WebCore::RenderBlock::paintObject):
Changed to call paintColumnRules with the adjusted scroll offset and to do it after
bailing on the root background only check.

  • rendering/RenderBlock.h:

paintColumnRules is now virtual.

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::paintColumnRules):
(WebCore::RenderBlockFlow::paintBoxDecorations): Deleted.

  • rendering/RenderBlockFlow.h:

Got rid of paintBoxDecorations override since it failed when hasBoxDecorations was false
anyway. Override paintColumnRules instead to paint at the right time.

LayoutTests:

  • fast/multicol/scrolling-column-rules.html: Added.
  • platform/mac/fast/multicol/scrolling-column-rules-expected.png: Added.
  • platform/mac/fast/multicol/scrolling-column-rules-expected.txt: Added.
Location:
trunk
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r167818 r167820  
     12014-04-25  David Hyatt  <hyatt@apple.com>
     2
     3        Column rules not respecting scroll offsets.
     4        https://bugs.webkit.org/show_bug.cgi?id=109683
     5
     6        Reviewed by Dean Jackson.
     7
     8        * fast/multicol/scrolling-column-rules.html: Added.
     9        * platform/mac/fast/multicol/scrolling-column-rules-expected.png: Added.
     10        * platform/mac/fast/multicol/scrolling-column-rules-expected.txt: Added.
     11
    1122014-04-23  Jon Honeycutt  <jhoneycutt@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r167818 r167820  
     12014-04-25  David Hyatt  <hyatt@apple.com>
     2
     3        Column rules not respecting scroll offsets.
     4        https://bugs.webkit.org/show_bug.cgi?id=109683
     5
     6        Reviewed by Dean Jackson.
     7
     8        Added fast/multicol/scrolling-column-rules.html
     9
     10        * rendering/RenderBlock.cpp:
     11        (WebCore::RenderBlock::paintColumnRules):
     12        Make paintColumnRules virtual so that it works with both column implementations.
     13
     14        (WebCore::RenderBlock::paintObject):
     15        Changed to call paintColumnRules with the adjusted scroll offset and to do it after
     16        bailing on the root background only check.
     17
     18        * rendering/RenderBlock.h:
     19        paintColumnRules is now virtual.
     20
     21        * rendering/RenderBlockFlow.cpp:
     22        (WebCore::RenderBlockFlow::paintColumnRules):
     23        (WebCore::RenderBlockFlow::paintBoxDecorations): Deleted.
     24        * rendering/RenderBlockFlow.h:
     25        Got rid of paintBoxDecorations override since it failed when hasBoxDecorations was false
     26        anyway. Override paintColumnRules instead to paint at the right time.
     27
    1282014-04-23  Jon Honeycutt  <jhoneycutt@apple.com>
    229
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r167810 r167820  
    18271827void RenderBlock::paintColumnRules(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    18281828{
    1829     if (paintInfo.context->paintingDisabled())
     1829    if (!hasColumns() || paintInfo.context->paintingDisabled())
    18301830        return;
    18311831
     
    21142114                paintInfo.context->restore();
    21152115        }
    2116         if (hasColumns() && !paintInfo.paintRootBackgroundOnly())
    2117             paintColumnRules(paintInfo, paintOffset);
    21182116    }
    21192117
     
    21232121    }
    21242122
    2125     // We're done.  We don't bother painting any children.
    2126     if (paintPhase == PaintPhaseBlockBackground || paintInfo.paintRootBackgroundOnly())
     2123    // If just painting the root background, then return.
     2124    if (paintInfo.paintRootBackgroundOnly())
    21272125        return;
    21282126
     
    21312129    scrolledOffset.move(-scrolledContentOffset());
    21322130
     2131    // Column rules need to account for scrolling and clipping.
     2132    // FIXME: Clipping of column rules does not work. We will need a separate paint phase for column rules I suspect in order to get
     2133    // clipping correct (since it has to paint as background but is still considered "contents").
     2134    if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && style().visibility() == VISIBLE)
     2135        paintColumnRules(paintInfo, scrolledOffset);
     2136
     2137    // Done with backgrounds, borders and column rules.
     2138    if (paintPhase == PaintPhaseBlockBackground)
     2139        return;
     2140   
    21332141    // 2. paint contents
    21342142    if (paintPhase != PaintPhaseSelfOutline) {
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r167817 r167820  
    484484    void paintContents(PaintInfo&, const LayoutPoint&);
    485485    void paintColumnContents(PaintInfo&, const LayoutPoint&, bool paintFloats = false);
    486     void paintColumnRules(PaintInfo&, const LayoutPoint&);
     486    virtual void paintColumnRules(PaintInfo&, const LayoutPoint&);
    487487    void paintSelection(PaintInfo&, const LayoutPoint&);
    488488    void paintCaret(PaintInfo&, const LayoutPoint&, CaretType);
  • trunk/Source/WebCore/rendering/RenderBlockFlow.cpp

    r167803 r167820  
    19981998}
    19991999
    2000 void RenderBlockFlow::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& point)
    2001 {
    2002     RenderBlock::paintBoxDecorations(paintInfo, point);
    2003    
    2004     if (!multiColumnFlowThread() || !paintInfo.shouldPaintWithinRoot(*this))
    2005         return;
    2006    
     2000void RenderBlockFlow::paintColumnRules(PaintInfo& paintInfo, const LayoutPoint& point)
     2001{
     2002    RenderBlock::paintColumnRules(paintInfo, point);
     2003   
     2004    if (!multiColumnFlowThread() || paintInfo.context->paintingDisabled())
     2005        return;
     2006
    20072007    // Iterate over our children and paint the column rules as needed.
    20082008    for (auto& columnSet : childrenOfType<RenderMultiColumnSet>(*this)) {
  • trunk/Source/WebCore/rendering/RenderBlockFlow.h

    r167803 r167820  
    8383    virtual void updateLogicalHeight() override;
    8484
    85     virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&) override;
     85    virtual void paintColumnRules(PaintInfo&, const LayoutPoint&) override;
    8686
    8787public:
Note: See TracChangeset for help on using the changeset viewer.