broken when negative margins were used and did not properly decrease the max width.
Reviewed by Maciej
* khtml/rendering/render_block.cpp:
(khtml::RenderBlock::calcBlockMinMaxWidth):
* layout-tests/fast/block/float/034-expected.txt: Added.
* layout-tests/fast/block/float/034.html: Added.
* layout-tests/fast/block/float/035-expected.txt: Added.
* layout-tests/fast/block/float/035.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9044
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas 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 (floating) {DIV} at (0,0) size 224x524 [border: (10px solid #0000FF)]
+ RenderImage {IMG} at (-290,10) size 504x504 [border: (2px solid #000000)]
--- /dev/null
+
+<html>
+<head><title>ongoing</title>
+<base href="http://tbray.org/ongoing/">
+<style type='text/css'>
+
+.shadowed {
+ float:left;
+ border:10px solid blue;
+
+}
+
+.shadowed img {
+ display: block;
+ margin: 0 0 0 -300px;
+}
+
+
+
+</style>
+
+</head>
+<body>
+
+<div class='shadowed'>
+<img width=500 height=500 border=2 />
+</div>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas 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 (floating) {DIV} at (0,0) size 673x520 [border: (10px solid #0000FF)]
+ RenderImage {IMG} at (10,10) size 300x300 [bgcolor=#008000]
+ RenderImage {IMG} at (163,10) size 500x500 [bgcolor=#800080]
--- /dev/null
+
+<html>
+<head><title>ongoing</title>
+<base href="http://tbray.org/ongoing/">
+<style type='text/css'>
+
+.shadowed {
+ float:left;
+ border:10px solid blue;
+
+}
+
+</style>
+
+</head>
+<body>
+
+<div class='shadowed'>
+<img align=left width=300 height=300 style="background-color:green">
+<img width=500 height=500 style="background-color:purple; display:block; margin-left:-150px"/>
+
+</div>
+</body>
+</html>
\ No newline at end of file
+2005-04-22 David Hyatt <hyatt@apple.com>
+
+ Fix for 4096878, drop shadow effect not displayed correctly on tbray.org/ongoing/. Block minmaxwidth was
+ broken when negative margins were used and did not properly decrease the max width.
+
+ Reviewed by Maciej
+
+ * khtml/rendering/render_block.cpp:
+ (khtml::RenderBlock::calcBlockMinMaxWidth):
+ * layout-tests/fast/block/float/034-expected.txt: Added.
+ * layout-tests/fast/block/float/034.html: Added.
+ * layout-tests/fast/block/float/035-expected.txt: Added.
+ * layout-tests/fast/block/float/035.html: Added.
+
2005-04-22 David Hyatt <hyatt@apple.com>
Remove some dead code from css_valueimpl. It wasn't used at all.
marginLeft += ml.value;
else if (ml.type == Percent)
marginLeft += child->marginLeft();
- marginLeft = kMax(0, marginLeft);
if (mr.type == Fixed)
marginRight += mr.value;
else if (mr.type == Percent)
marginRight += child->marginRight();
- marginRight = kMax(0, marginRight);
margin = marginLeft + marginRight;
int w = child->minWidth() + margin;
if (!child->isFloating()) {
if (child->avoidsFloats()) {
// Determine a left and right max value based off whether or not the floats can fit in the
- // margins of the object.
- int maxLeft = kMax(floatLeftWidth, marginLeft);
- int maxRight = kMax(floatRightWidth, marginRight);
+ // margins of the object. For negative margins, we will attempt to overlap the float if the negative margin
+ // is smaller than the float width.
+ int maxLeft = marginLeft > 0 ? kMax(floatLeftWidth, marginLeft) : floatLeftWidth + marginLeft;
+ int maxRight = marginRight > 0 ? kMax(floatRightWidth, marginRight) : floatRightWidth + marginRight;
w = child->maxWidth() + maxLeft + maxRight;
+ w = kMax(w, floatLeftWidth + floatRightWidth);
}
else
m_maxWidth = kMax(floatLeftWidth + floatRightWidth, m_maxWidth);
child = child->nextSibling();
}
-
+
+ // Always make sure these values are non-negative.
+ m_minWidth = kMax(0, m_minWidth);
+ m_maxWidth = kMax(0, m_maxWidth);
+
m_maxWidth = kMax(floatLeftWidth + floatRightWidth, m_maxWidth);
}