WebCore/ChangeLog

 12010-12-14 David Hyatt <hyatt@apple.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 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 Kyounga Ra <kyounga.ra@gmail.com>
226
327 Reviewed by Adam Barth.
74060

WebCore/rendering/RenderBlock.cpp

@@int RenderBlock::addOverhangingFloats(Re
35663566 // behaves properly). We always want to propagate the desire to paint the float as
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
35723572 floatingObj->m_shouldPaint = false;

@@int RenderBlock::addOverhangingFloats(Re
35823582 }
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
35883588 // layer.
74048

WebCore/rendering/RenderBox.cpp

@@int RenderBox::baselinePosition(FontBase
31783178 return 0;
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{
31833196 IntRect rect = visualOverflowRectForPropagation(parentStyle);
74048

WebCore/rendering/RenderBox.h

@@public:
357357
358358 void removeFloatingOrPositionedChildFromBlockLists();
359359
 360 RenderLayer* enclosingFloatPaintingLayer() const;
 361
360362 virtual int firstLineBoxBaseline() const { return -1; }
361363 virtual int lastLineBoxBaseline() const { return -1; }
362364
73941

WebCore/rendering/RenderObject.cpp

@@RenderLayer* RenderObject::enclosingLaye
538538 return 0;
539539}
540540
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())
547  return layer;
548  curr = curr->parent();
549  }
550  return 0;
551 }
552 
553541RenderBox* RenderObject::enclosingBox() const
554542{
555543 RenderObject* curr = const_cast<RenderObject*>(this);
73940

WebCore/rendering/RenderObject.h

@@public:
159159 // properly added and removed. Since containership can be implemented by any subclass, and since a hierarchy
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);
165164 void moveLayers(RenderLayer* oldParent, RenderLayer* newParent);
73940

LayoutTests/ChangeLog

 12010-12-14 David Hyatt <hyatt@apple.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 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
326 Unreviewed, rolling out r74040.
74060

LayoutTests/platform/mac/fast/block/float/floatstack-expected.checksum

 14be38c2144444ed9e2169a79a8faa64b
02\ No newline at end of file
0

LayoutTests/platform/mac/fast/block/float/floatstack-expected.txt

 1layer at (0,0) size 800x600
 2 RenderView at (0,0) size 800x600
 3layer at (0,0) size 800x600
 4 RenderBlock {HTML} at (0,0) size 800x600
 5 RenderBody {BODY} at (8,8) size 784x584
 6 RenderBlock {DIV} at (0,0) size 300x300 [bgcolor=#EEEEEE]
 7 RenderText {#text} at (0,0) size 0x0
 8 RenderBlock (floating) {DIV} at (50,0) size 100x100 [bgcolor=#00FF00]
 9 RenderText {#text} at (0,0) size 0x0
 10layer at (18,18) size 29x18
 11 RenderInline (relative positioned) {SPAN} at (0,0) size 29x18 [bgcolor=#FFFF00]
 12 RenderBlock (floating) {DIV} at (0,0) size 100x100 [bgcolor=#0000FF]
 13 RenderText {#text} at (150,0) size 29x18
 14 text run at (150,0) width 29: "Text"
0

LayoutTests/platform/mac/fast/repaint/positioned-document-element-expected.checksum

1 6c8fc5a6a844d01709534b22be37be5d
21\ No newline at end of file
 2844d7ff73a472423c0f8dae9ba99068d
33\ No newline at end of file
73940

LayoutTests/platform/mac/fast/block/float/floatstack-expected.png

INVALID: Image lacks a checksum. This will fail with a MISSING error in run-webkit-tests. Always generate new png files using run-webkit-tests.

LayoutTests/platform/mac/fast/repaint/positioned-document-element-expected.png

INVALID: Image lacks a checksum. This will fail with a MISSING error in run-webkit-tests. Always generate new png files using run-webkit-tests.