Reviewed by Dave Hyatt.
- fix <rdar://problem/
5609337> Making a float shorter does not remove it from the floating object list of a nested block it intruded into
Test: fast/dynamic/float-withdrawal-2.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::layoutBlockChildren): When a float may have
been withdrawn from a child, mark all descendants if necessary and not
just the child.
LayoutTests:
Reviewed by Dave Hyatt.
- test for <rdar://problem/
5609337> Making a float shorter does not remove it from the floating object list of a nested block it intruded into
* fast/dynamic/float-withdrawal-2.html: Added.
* platform/mac/fast/dynamic/float-withdrawal-2-expected.checksum: Added.
* platform/mac/fast/dynamic/float-withdrawal-2-expected.png: Added.
* platform/mac/fast/dynamic/float-withdrawal-2-expected.txt: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28048
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-11-26 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ - test for <rdar://problem/5609337> Making a float shorter does not remove it from the floating object list of a nested block it intruded into
+
+ * fast/dynamic/float-withdrawal-2.html: Added.
+ * platform/mac/fast/dynamic/float-withdrawal-2-expected.checksum: Added.
+ * platform/mac/fast/dynamic/float-withdrawal-2-expected.png: Added.
+ * platform/mac/fast/dynamic/float-withdrawal-2-expected.txt: Added.
+
2007-11-25 Adam Roben <aroben@apple.com>
* platform/win/Skipped: Add a known failure.
--- /dev/null
+<html>
+<head>
+ <title>Test for rdar://problem/5609337</title>
+</head>
+<body>
+ <div style="z-index: -1; position: absolute; top: 58px; left: 8px; background-color: red; width: 100px; height: 50px;"></div>
+ <div style="height: 50px;">
+ <div style="float: left; display: block; width: 100px; height: 150px; background-color: green;" id="target">
+ </div>
+ </div>
+ <div>
+ <div><div style="display: inline-block; width: 100px; height: 50px; background-color: green;"></div></div>
+ </div>
+ <script>
+ document.body.offsetTop;
+ document.getElementById("target").style.height = "50px";
+ </script>
+</body>
+</html>
--- /dev/null
+18f1f64eab31dfb69467a497de9442d7
\ 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 layerType: background only
+layer at (8,58) size 100x50
+ RenderBlock (positioned) zI: -1 {DIV} at (8,58) size 100x50 [bgcolor=#FF0000]
+layer at (0,0) size 800x600 layerType: foreground only
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {DIV} at (0,0) size 784x50
+ RenderBlock (floating) {DIV} at (0,0) size 100x50 [bgcolor=#008000]
+ RenderBlock {DIV} at (0,50) size 784x50
+ RenderBlock {DIV} at (0,0) size 784x50
+ RenderBlock {DIV} at (0,0) size 100x50 [bgcolor=#008000]
+2007-11-26 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ - fix <rdar://problem/5609337> Making a float shorter does not remove it from the floating object list of a nested block it intruded into
+
+ Test: fast/dynamic/float-withdrawal-2.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::layoutBlockChildren): When a float may have
+ been withdrawn from a child, mark all descendants if necessary and not
+ just the child.
+
2007-11-26 Steve Falkenburg <sfalken@apple.com>
Build fix.
// be correct. Only if we're wrong (when we compute the real y position)
// will we have to potentially relayout.
int yPosEstimate = estimateVerticalPosition(child, marginInfo);
-
- // If an element might be affected by the presence of floats, then always mark it for
- // layout.
- if (!child->avoidsFloats() || child->shrinkToAvoidFloats()) {
- int fb = max(previousFloatBottom, floatBottom());
- if (fb > m_height || fb > yPosEstimate)
- child->setChildNeedsLayout(true, false);
- }
// Cache our old rect so that we can dirty the proper repaint rects if the child moves.
IntRect oldRect(child->xPos(), child->yPos() , child->width(), child->height());
// Go ahead and position the child as though it didn't collapse with the top.
view()->addLayoutDelta(IntSize(0, child->yPos() - yPosEstimate));
child->setPos(child->xPos(), yPosEstimate);
+
+ bool markDescendantsWithFloats = false;
if (yPosEstimate != oldRect.y() && !child->avoidsFloats() && child->containsFloats())
+ markDescendantsWithFloats = true;
+ else if (!child->avoidsFloats() || child->shrinkToAvoidFloats()) {
+ // If an element might be affected by the presence of floats, then always mark it for
+ // layout.
+ int fb = max(previousFloatBottom, floatBottom());
+ if (fb > m_height || fb > yPosEstimate)
+ markDescendantsWithFloats = true;
+ }
+
+ if (markDescendantsWithFloats)
child->markAllDescendantsWithFloatsForLayout();
if (child->isRenderBlock())