Changeset 74063 in webkit


Ignore:
Timestamp:
Dec 14, 2010 3:01:51 PM (13 years ago)
Author:
hyatt@apple.com
Message:

https://bugs.webkit.org/show_bug.cgi?id=50970

Reviewed by Dan Bernstein.

It's arguably a bug, but we don't let inline flow layers paint floating
descendants. The containing block of the inline flow paints them instead.
However our shouldPaint logic has always been flawed and has turned off propagation
of painting when an inline flow layer is enclosing the float.

Change enclosingSelfPaintingLayer to enclosingFloatPaintingLayer to be more precise
and for now limit it to RenderBoxes.

Added fast/block/float/floatstack.html

WebCore:

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::addOverhangingFloats):

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::enclosingFloatPaintingLayer):

  • rendering/RenderBox.h:
  • rendering/RenderObject.cpp:
  • rendering/RenderObject.h:

LayoutTests:

  • fast/block/float/floatstack.html: Added.
  • platform/mac/fast/block/float/floatstack-expected.checksum: Added.
  • platform/mac/fast/block/float/floatstack-expected.png: Added.
  • platform/mac/fast/block/float/floatstack-expected.txt: Added.
  • platform/mac/fast/repaint/positioned-document-element-expected.checksum:
  • platform/mac/fast/repaint/positioned-document-element-expected.png:
Location:
trunk
Files:
3 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r74054 r74063  
     12010-12-14  David Hyatt  <hyatt@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=50970
     6       
     7        It's arguably a bug, but we don't let inline flow layers paint floating
     8        descendants.  The containing block of the inline flow paints them instead.
     9        However our shouldPaint logic has always been flawed and has turned off propagation
     10        of painting when an inline flow layer is enclosing the float.
     11       
     12        Change enclosingSelfPaintingLayer to enclosingFloatPaintingLayer to be more precise
     13        and for now limit it to RenderBoxes.
     14       
     15        Added fast/block/float/floatstack.html
     16
     17        * fast/block/float/floatstack.html: Added.
     18        * platform/mac/fast/block/float/floatstack-expected.checksum: Added.
     19        * platform/mac/fast/block/float/floatstack-expected.png: Added.
     20        * platform/mac/fast/block/float/floatstack-expected.txt: Added.
     21        * platform/mac/fast/repaint/positioned-document-element-expected.checksum:
     22        * platform/mac/fast/repaint/positioned-document-element-expected.png:
     23
    1242010-12-14  Sheriff Bot  <webkit.review.bot@gmail.com>
    225
  • trunk/LayoutTests/platform/mac/fast/repaint/positioned-document-element-expected.checksum

    r61215 r74063  
    1 6c8fc5a6a844d01709534b22be37be5d
     1844d7ff73a472423c0f8dae9ba99068d
  • trunk/WebCore/ChangeLog

    r74062 r74063  
     12010-12-14  David Hyatt  <hyatt@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=50970
     6       
     7        It's arguably a bug, but we don't let inline flow layers paint floating
     8        descendants.  The containing block of the inline flow paints them instead.
     9        However our shouldPaint logic has always been flawed and has turned off propagation
     10        of painting when an inline flow layer is enclosing the float.
     11       
     12        Change enclosingSelfPaintingLayer to enclosingFloatPaintingLayer to be more precise
     13        and for now limit it to RenderBoxes.
     14       
     15        Added fast/block/float/floatstack.html
     16
     17        * rendering/RenderBlock.cpp:
     18        (WebCore::RenderBlock::addOverhangingFloats):
     19        * rendering/RenderBox.cpp:
     20        (WebCore::RenderBox::enclosingFloatPaintingLayer):
     21        * rendering/RenderBox.h:
     22        * rendering/RenderObject.cpp:
     23        * rendering/RenderObject.h:
     24
    1252010-12-14  Mihai Parparita  <mihaip@chromium.org>
    226
  • trunk/WebCore/rendering/RenderBlock.cpp

    r74048 r74063  
    35673567                // far out as we can, to the outermost block that overlaps the float, stopping only
    35683568                // if we hit a self-painting layer boundary.
    3569                 if (r->m_renderer->enclosingSelfPaintingLayer() == enclosingSelfPaintingLayer())
     3569                if (r->m_renderer->enclosingFloatPaintingLayer() == enclosingFloatPaintingLayer())
    35703570                    r->m_shouldPaint = false;
    35713571                else
     
    35833583        } else {
    35843584            if (makeChildPaintOtherFloats && !r->m_shouldPaint && !r->m_renderer->hasSelfPaintingLayer() &&
    3585                 r->m_renderer->isDescendantOf(child) && r->m_renderer->enclosingLayer() == child->enclosingLayer()) {
     3585                r->m_renderer->isDescendantOf(child) && r->m_renderer->enclosingFloatPaintingLayer() == child->enclosingFloatPaintingLayer()) {
    35863586                // The float is not overhanging from this block, so if it is a descendant of the child, the child should
    35873587                // paint it (the other case is that it is intruding into the child), unless it has its own layer or enclosing
  • trunk/WebCore/rendering/RenderBox.cpp

    r74048 r74063  
    31793179}
    31803180
     3181
     3182RenderLayer* RenderBox::enclosingFloatPaintingLayer() const
     3183{
     3184    const RenderObject* curr = this;
     3185    while (curr) {
     3186        RenderLayer* layer = curr->hasLayer() && curr->isBox() ? toRenderBoxModelObject(curr)->layer() : 0;
     3187        if (layer && layer->isSelfPaintingLayer())
     3188            return layer;
     3189        curr = curr->parent();
     3190    }
     3191    return 0;
     3192}
     3193
    31813194IntRect RenderBox::logicalVisualOverflowRectForPropagation(RenderStyle* parentStyle) const
    31823195{
  • trunk/WebCore/rendering/RenderBox.h

    r73941 r74063  
    358358    void removeFloatingOrPositionedChildFromBlockLists();
    359359   
     360    RenderLayer* enclosingFloatPaintingLayer() const;
     361   
    360362    virtual int firstLineBoxBaseline() const { return -1; }
    361363    virtual int lastLineBoxBaseline() const { return -1; }
  • trunk/WebCore/rendering/RenderObject.cpp

    r72926 r74063  
    533533        RenderLayer* layer = curr->hasLayer() ? toRenderBoxModelObject(curr)->layer() : 0;
    534534        if (layer)
    535             return layer;
    536         curr = curr->parent();
    537     }
    538     return 0;
    539 }
    540 
    541 RenderLayer* RenderObject::enclosingSelfPaintingLayer() const
    542 {
    543     const RenderObject* curr = this;
    544     while (curr) {
    545         RenderLayer* layer = curr->hasLayer() ? toRenderBoxModelObject(curr)->layer() : 0;
    546         if (layer && layer->isSelfPaintingLayer())
    547535            return layer;
    548536        curr = curr->parent();
  • trunk/WebCore/rendering/RenderObject.h

    r73346 r74063  
    160160    // can contain a mixture of boxes and other object types, these functions need to be in the base class.
    161161    RenderLayer* enclosingLayer() const;
    162     RenderLayer* enclosingSelfPaintingLayer() const;
    163162    void addLayers(RenderLayer* parentLayer, RenderObject* newObject);
    164163    void removeLayers(RenderLayer* parentLayer);
Note: See TracChangeset for help on using the changeset viewer.