Reviewed by Hyatt.
- fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7204
float inserted in fixed height block via DOM not repainted
Test: fast/repaint/float-move-during-layout.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::layoutBlockChildren):
(WebCore::RenderBlock::repaintOverhangingFloats): Renamed repaintFloatingDescendants()
to this and limited it to repainting overhanging floats. Added a boolean parameter that forces
all descendant overhanging floats (that don't have their own layer) to paint.
* rendering/RenderBlock.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::repaintDuringLayoutIfMoved): Changed to paint all descendant
floats.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintOverhangingFloats):
* rendering/RenderObject.h:
LayoutTests:
Reviewed by Hyatt.
- test for http://bugzilla.opendarwin.org/show_bug.cgi?id=7204
float inserted in fixed height block via DOM not repainted
* fast/repaint/float-move-during-layout-expected.checksum: Added.
* fast/repaint/float-move-during-layout-expected.png: Added.
* fast/repaint/float-move-during-layout-expected.txt: Added.
* fast/repaint/float-move-during-layout.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15121
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-06-30 Mitz Pettel <opendarwin.org@mitzpettel.com>
+
+ Reviewed by Hyatt.
+
+ - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=7204
+ float inserted in fixed height block via DOM not repainted
+
+ * fast/repaint/float-move-during-layout-expected.checksum: Added.
+ * fast/repaint/float-move-during-layout-expected.png: Added.
+ * fast/repaint/float-move-during-layout-expected.txt: Added.
+ * fast/repaint/float-move-during-layout.html: Added.
+
2006-06-30 Levi Weintraub <lweintraub@apple.com>
Reviewed by justin
--- /dev/null
+0fb4a2a4a3128fb2fd4922d7ae8b3872
+\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {P} at (0,0) size 784x36
+ RenderText {#text} at (0,0) size 151x18
+ text run at (0,0) width 151: "This is a repaint test for "
+ RenderInline {I} at (0,0) size 780x36
+ RenderInline {A} at (0,0) size 348x18 [color=#0000EE]
+ RenderText {#text} at (151,0) size 348x18
+ text run at (151,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7204"
+ RenderText {#text} at (499,0) size 780x36
+ text run at (499,0) width 4: " "
+ text run at (503,0) width 277: "float inserted in fixed height block via DOM"
+ text run at (0,18) width 84: "not repainted"
+ RenderText {#text} at (84,18) size 4x18
+ text run at (84,18) width 4: "."
+ RenderBlock {P} at (0,52) size 784x18
+ RenderText {#text} at (0,0) size 244x18
+ text run at (0,0) width 244: "There should be a green square below."
+ RenderBlock {HR} at (0,86) size 784x2 [border: (1px inset #000000)]
+ RenderBlock {DIV} at (0,96) size 784x100
+ RenderBlock {DIV} at (0,196) size 784x0
+ RenderBlock (floating) {DIV} at (0,0) size 100x100 [bgcolor=#008000]
--- /dev/null
+<HTML>
+ <HEAD>
+ <TITLE></TITLE>
+ <script src="repaint.js" type="text/javascript"></script>
+ <script type="text/javascript">
+ function repaintTest()
+ {
+ document.getElementById('t').style.height = '100px';
+ }
+ </script>
+ </HEAD>
+ <BODY onload="runRepaintTest();">
+ <p>
+ This is a repaint test for <i><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=7204">http://bugzilla.opendarwin.org/show_bug.cgi?id=7204</a>
+ float inserted in fixed height block via DOM not repainted</i>.
+ </p>
+ <p>
+ There should be a green square below.
+ </p>
+ <hr>
+ <div id="t"></div>
+ <div id="s">
+ <div style="float:left; background: green; width: 100px; height: 100px;"></div>
+ </div>
+ </BODY>
+</HTML>
+2006-06-30 Mitz Pettel <opendarwin.org@mitzpettel.com>
+
+ Reviewed by Hyatt.
+
+ - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7204
+ float inserted in fixed height block via DOM not repainted
+
+ Test: fast/repaint/float-move-during-layout.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::layoutBlockChildren):
+ (WebCore::RenderBlock::repaintOverhangingFloats): Renamed repaintFloatingDescendants()
+ to this and limited it to repainting overhanging floats. Added a boolean parameter that forces
+ all descendant overhanging floats (that don't have their own layer) to paint.
+ * rendering/RenderBlock.h:
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::repaintDuringLayoutIfMoved): Changed to paint all descendant
+ floats.
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::repaintOverhangingFloats):
+ * rendering/RenderObject.h:
+
2006-06-30 Levi Weintraub <lweintraub@apple.com>
Reviewed by justin
// The child's repaints during layout were done before it reached its final position,
// so they were wrong.
child->repaint();
- child->repaintFloatingDescendants();
+ child->repaintOverhangingFloats();
}
}
}
}
-void RenderBlock::repaintFloatingDescendants()
+void RenderBlock::repaintOverhangingFloats(bool paintAllDescendants)
{
// Repaint any overhanging floats (if we know we're the one to paint them).
if (hasOverhangingFloats()) {
FloatingObject* r;
DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
for ( ; (r = it.current()); ++it) {
- // Only repaint the object if our noPaint flag isn't set and if it isn't in
- // its own layer.
- if (!r->noPaint && !r->node->layer()) {
+ // Only repaint the object if it is overhanging, is not in its own layer, and
+ // is our responsibility to paint (noPaint isn't set). When paintAllDescendants is true, the latter
+ // condition is replaced with being a descendant of us.
+ if (r->endY > m_height && (paintAllDescendants && r->node->hasAncestor(this) || !r->noPaint) && !r->node->layer()) {
r->node->repaint();
- r->node->repaintFloatingDescendants();
+ r->node->repaintOverhangingFloats();
}
}
}
virtual void removeChild(RenderObject*);
virtual void repaintObjectsBeforeLayout();
- virtual void repaintFloatingDescendants();
+ virtual void repaintOverhangingFloats(bool paintAllDescendants);
virtual void getAbsoluteRepaintRectIncludingFloats(IntRect& bounds, IntRect& fullBounds);
virtual void setStyle(RenderStyle*);
// since the object may not have gotten a layout.
m_x = oldX; m_y = oldY;
repaint();
- repaintFloatingDescendants();
+ repaintOverhangingFloats(true);
m_x = newX; m_y = newY;
repaint();
- repaintFloatingDescendants();
+ repaintOverhangingFloats(true);
}
}
{
}
-void RenderObject::repaintFloatingDescendants()
+void RenderObject::repaintOverhangingFloats(bool paintAllDescendants)
{
}
virtual void repaintDuringLayoutIfMoved(int oldX, int oldY);
// Called to repaint a block's floats.
- virtual void repaintFloatingDescendants();
+ virtual void repaintOverhangingFloats(bool paintAllDescendants = false);
// Called before layout to repaint all dirty children (with selfNeedsLayout() set).
virtual void repaintObjectsBeforeLayout();