https://bugs.webkit.org/show_bug.cgi?id=32382
Reviewed by Darin Adler.
WebCore:
Test: fast/block/float/in-margin.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::getClearDelta): Floats that do not intrude into the line (because
they are in the margin) do not need to be cleared.
LayoutTests:
* fast/block/float/in-margin.html: Added.
* platform/mac/fast/block/float/in-margin-expected.checksum: Added.
* platform/mac/fast/block/float/in-margin-expected.png: Added.
* platform/mac/fast/block/float/in-margin-expected.txt: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52127
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2009-12-14 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/7460655> REGRESSION (r47255): Content shifted down at software.opensuse.org
+ https://bugs.webkit.org/show_bug.cgi?id=32382
+
+ * fast/block/float/in-margin.html: Added.
+ * platform/mac/fast/block/float/in-margin-expected.checksum: Added.
+ * platform/mac/fast/block/float/in-margin-expected.png: Added.
+ * platform/mac/fast/block/float/in-margin-expected.txt: Added.
+
2009-12-14 Enrica Casucci <enrica@apple.com>
Reviewed by John Sullivan.
--- /dev/null
+<div style="width: 400px;">
+ <div style="width: 100px; float: left; height: 100px;"></div>
+ <div style="margin-left: 300px; background-color: red;">
+ <div style="background-color: green; overflow: hidden; width: 110%; height: 110px;"></div>
+ </div>
+</div>
--- /dev/null
+86351b92bffcd9b203c46fb9dc7d430c
\ 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 {DIV} at (0,0) size 400x110
+ RenderBlock (floating) {DIV} at (0,0) size 100x100
+ RenderBlock {DIV} at (300,0) size 100x110 [bgcolor=#FF0000]
+layer at (308,8) size 110x110
+ RenderBlock {DIV} at (0,0) size 110x110 [bgcolor=#008000]
+2009-12-14 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/7460655> REGRESSION (r47255): Content shifted down at software.opensuse.org
+ https://bugs.webkit.org/show_bug.cgi?id=32382
+
+ Test: fast/block/float/in-margin.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::getClearDelta): Floats that do not intrude into the line (because
+ they are in the margin) do not need to be cleared.
+
2009-12-14 Enrica Casucci <enrica@apple.com>
Reviewed by John Sullivan.
// to fit) and not all (we should be using nextFloatBottomBelow and looping).
int result = clearSet ? max(0, bottom - yPos) : 0;
if (!result && child->avoidsFloats()) {
- int oldYPos = child->y();
- int oldWidth = child->width();
- child->setY(yPos);
- child->calcWidth();
- if (child->width() > lineWidth(yPos, false) && child->minPrefWidth() <= availableWidth())
- result = max(0, floatBottom() - yPos);
- child->setY(oldYPos);
- child->setWidth(oldWidth);
+ int widthAtCurrentHeight = lineWidth(yPos, false);
+ int availableWidth = this->availableWidth();
+ if (widthAtCurrentHeight < availableWidth) {
+ int oldYPos = child->y();
+ int oldWidth = child->width();
+ child->setY(yPos);
+ child->calcWidth();
+ if (child->width() > widthAtCurrentHeight && child->minPrefWidth() <= availableWidth)
+ result = max(0, floatBottom() - yPos);
+ child->setY(oldYPos);
+ child->setWidth(oldWidth);
+ }
}
return result;
}