Changeset 29885 in webkit


Ignore:
Timestamp:
Jan 31, 2008 10:34:17 AM (16 years ago)
Author:
mitz@apple.com
Message:

WebCore:

Reviewed by Dave Hyatt.

Test: fast/block/float/intruding-painted-twice.html

  • rendering/RenderBlock.cpp: (WebCore::RenderBlock::layoutBlock): Pass 'false' for the new makeChildPaintOtherFloats parameter to addOverhangingFloats() because at this point we are only taking away floats from the child. (WebCore::RenderBlock::layoutBlockChildren): Pass 'true' for the new makeChildPaintOtherFloats parameter to addOverhangingFloats() iff the child was not laid out again. Only in that case, it may have overhanging floats that it does not paint because they used to be overhanging from the parent, but now they are not. (WebCore::RenderBlock::addOverhangingFloats): Refined the conditions for making the child paint the float: require that the float be a descendant of the child (the other case is when it intrudes into the child from another sibling) and that it does not have a layer (in which case it paints itself). In addition, do the check only if the caller passed 'true' for the makeChildPaintOtherFloats parameter.
  • rendering/RenderBlock.h:

LayoutTests:

Reviewed by Dave Hyatt.

  • fast/block/float/intruding-painted-twice.html: Added.
  • platform/mac-leopard/fast/block/float/intruding-painted-twice-expected.checksum: Added.
  • platform/mac-leopard/fast/block/float/intruding-painted-twice-expected.png: Added.
  • platform/mac/fast/block/float/intruding-painted-twice-expected.txt: Added.
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r29884 r29885  
     12008-01-31  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        - pixel test for http://bugs.webkit.org/show_bug.cgi?id=17107
     6          <rdar://problem/5716722> REGRESSION (r29834): Article text on redhat.com magazine site appears to be painting twice
     7
     8        * fast/block/float/intruding-painted-twice.html: Added.
     9        * platform/mac-leopard/fast/block/float/intruding-painted-twice-expected.checksum: Added.
     10        * platform/mac-leopard/fast/block/float/intruding-painted-twice-expected.png: Added.
     11        * platform/mac/fast/block/float/intruding-painted-twice-expected.txt: Added.
     12
    1132008-01-30  Dan Bernstein  <mitz@apple.com>
    214
  • trunk/WebCore/ChangeLog

    r29884 r29885  
     12008-01-31  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=17107
     6          <rdar://problem/5716722> REGRESSION (r29834): Article text on redhat.com magazine site appears to be painting twice
     7
     8        Test: fast/block/float/intruding-painted-twice.html
     9
     10        * rendering/RenderBlock.cpp:
     11        (WebCore::RenderBlock::layoutBlock): Pass 'false' for the new
     12        makeChildPaintOtherFloats parameter to addOverhangingFloats() because at
     13        this point we are only taking away floats from the child.
     14        (WebCore::RenderBlock::layoutBlockChildren): Pass 'true' for the new
     15        makeChildPaintOtherFloats parameter to addOverhangingFloats() iff the
     16        child was not laid out again. Only in that case, it may have overhanging
     17        floats that it does not paint because they used to be overhanging from
     18        the parent, but now they are not.
     19        (WebCore::RenderBlock::addOverhangingFloats): Refined the conditions for
     20        making the child paint the float: require that the float be a descendant
     21        of the child (the other case is when it intrudes into the child from
     22        another sibling) and that it does not have a layer (in which case it
     23        paints itself). In addition, do the check only if the caller passed
     24        'true' for the makeChildPaintOtherFloats parameter.
     25        * rendering/RenderBlock.h:
     26
    1272008-01-30  Dan Bernstein  <mitz@apple.com>
    228
  • trunk/WebCore/rendering/RenderBlock.cpp

    r29834 r29885  
    604604                    RenderBlock* block = static_cast<RenderBlock*>(child);
    605605                    if (block->floatBottom() + block->yPos() > m_height)
    606                         addOverhangingFloats(block, -block->xPos(), -block->yPos());
     606                        addOverhangingFloats(block, -block->xPos(), -block->yPos(), false);
    607607                }
    608608            }
     
    12261226            previousFloatBottom = max(previousFloatBottom, oldRect.y() + static_cast<RenderBlock*>(child)->floatBottom());
    12271227
    1228         child->layoutIfNeeded();
     1228        bool childNeededLayout = child->needsLayout();
     1229        if (childNeededLayout)
     1230            child->layout();
    12291231
    12301232        // Now determine the correct ypos based off examination of collapsing margin
     
    12521254        // If the child has overhanging floats that intrude into following siblings (or possibly out
    12531255        // of this block), then the parent gets notified of the floats now.
    1254         maxFloatBottom = max(maxFloatBottom, addOverhangingFloats(static_cast<RenderBlock *>(child), -child->xPos(), -child->yPos()));
     1256        maxFloatBottom = max(maxFloatBottom, addOverhangingFloats(static_cast<RenderBlock *>(child), -child->xPos(), -child->yPos(), !childNeededLayout));
    12551257
    12561258        // Update our overflow in case the child spills out the block.
     
    26482650}
    26492651
    2650 int RenderBlock::addOverhangingFloats(RenderBlock* child, int xoff, int yoff)
     2652int RenderBlock::addOverhangingFloats(RenderBlock* child, int xoff, int yoff, bool makeChildPaintOtherFloats)
    26512653{
    26522654    // Prevent floats from being added to the canvas by the root element, e.g., <html>.
     
    26902692                m_floatingObjects->append(floatingObj);
    26912693            }
    2692         } else
     2694        } else if (makeChildPaintOtherFloats && r->noPaint && !r->node->hasLayer() && r->node->isDescendantOf(child))
     2695            // The float is not overhanging from this block, so if it is a descendant of the child, the child should
     2696            // paint it (the other case is that it is intruding into the child), unless it has its own layer.
     2697            // If makeChildPaintOtherFloats is false, it means that the child must already know about all the floats
     2698            // it should paint.
    26932699            r->noPaint = false;
    26942700
  • trunk/WebCore/rendering/RenderBlock.h

    r27486 r29885  
    177177    virtual bool hasOverhangingFloats() { return !hasColumns() && floatBottom() > m_height; }
    178178    void addIntrudingFloats(RenderBlock* prev, int xoffset, int yoffset);
    179     int addOverhangingFloats(RenderBlock* child, int xoffset, int yoffset);
     179    int addOverhangingFloats(RenderBlock* child, int xoffset, int yoffset, bool makeChildPaintOtherFloats);
    180180
    181181    int nearestFloatBottom(int height) const;
Note: See TracChangeset for help on using the changeset viewer.