[webkit-changes] cvs commit:
WebCore/layout-tests/fast/block/margin-collapse
104-expected.txt 104.html
David
harrison at opensource.apple.com
Fri Aug 19 15:07:42 PDT 2005
harrison 05/08/19 15:07:42
Modified: . ChangeLog
khtml/rendering render_box.cpp
Added: layout-tests/fast/block/margin-collapse 104-expected.txt
104.html
Log:
Reviewed by Darin
Landed by David Harrison
- Fixes <http://bugzilla.opendarwin.org/show_bug.cgi?id=4379>
negative margins allowed where they should not
Test cases added:
layout-tests/fast/block/margin-collapse/104.html: Added.
layout-tests/fast/block/margin-collapse/104-expected.txt: Added.
* khtml/rendering/render_box.cpp:
(RenderBox::calcHorizontalMargins):
Revision Changes Path
1.4604 +15 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.4603
retrieving revision 1.4604
diff -u -r1.4603 -r1.4604
--- ChangeLog 19 Aug 2005 22:05:58 -0000 1.4603
+++ ChangeLog 19 Aug 2005 22:07:38 -0000 1.4604
@@ -1,3 +1,18 @@
+2005-08-19 Antti Koivisto <koivisto at iki.fi>
+
+ Reviewed by Darin
+ Landed by David Harrison
+
+ - Fixes <http://bugzilla.opendarwin.org/show_bug.cgi?id=4379>
+ negative margins allowed where they should not
+
+ Test cases added:
+ layout-tests/fast/block/margin-collapse/104.html: Added.
+ layout-tests/fast/block/margin-collapse/104-expected.txt: Added.
+
+ * khtml/rendering/render_box.cpp:
+ (RenderBox::calcHorizontalMargins):
+
2005-08-19 Eric Seidel <eseidel at apple.com>
Change from Tobias Lidskog <tobiaslidskog at mac.com>
1.161 +4 -3 WebCore/khtml/rendering/render_box.cpp
Index: render_box.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_box.cpp,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -r1.160 -r1.161
--- render_box.cpp 30 Jul 2005 02:33:22 -0000 1.160
+++ render_box.cpp 19 Aug 2005 22:07:41 -0000 1.161
@@ -920,7 +920,7 @@
}
else
{
- if ( (ml.type == Variable && mr.type == Variable) ||
+ if ( (ml.type == Variable && mr.type == Variable && m_width<cw) ||
(ml.type != Variable && mr.type != Variable &&
containingBlock()->style()->textAlign() == KHTML_CENTER) )
{
@@ -928,14 +928,14 @@
if (m_marginLeft<0) m_marginLeft=0;
m_marginRight = cw - m_width - m_marginLeft;
}
- else if (mr.type == Variable ||
+ else if ( (mr.type == Variable && m_width<cw) ||
(ml.type != Variable && containingBlock()->style()->direction() == RTL &&
containingBlock()->style()->textAlign() == KHTML_LEFT))
{
m_marginLeft = ml.width(cw);
m_marginRight = cw - m_width - m_marginLeft;
}
- else if (ml.type == Variable ||
+ else if ( (ml.type == Variable && m_width<cw) ||
(mr.type != Variable && containingBlock()->style()->direction() == LTR &&
containingBlock()->style()->textAlign() == KHTML_RIGHT))
{
@@ -944,6 +944,7 @@
}
else
{
+ // this makes auto margins 0 if we failed a m_width<cw test above (css2.1, 10.3.3)
m_marginLeft = ml.minWidth(cw);
m_marginRight = mr.minWidth(cw);
}
1.1 WebCore/layout-tests/fast/block/margin-collapse/104-expected.txt
Index: 104-expected.txt
===================================================================
layer at (0,0) size 976x600
RenderCanvas at (0,0) size 785x585
layer at (0,0) size 976x600
RenderBlock {HTML} at (0,0) size 785x600
RenderBody {BODY} at (8,8) size 769x584
RenderBlock {DIV} at (0,0) size 769x108 [border: (2px solid #0000FF)]
RenderBlock (anonymous) at (2,2) size 765x54
RenderText {TEXT} at (0,0) size 747x36
text run at (0,0) width 584: "Resize the window. Red boxes below must not overflow the blue box (or window) from the "
text run at (584,0) width 163: "left side, though they may"
text run at (0,18) width 128: "overflow from right."
RenderBR {BR} at (0,0) size 0x0
RenderBR {BR} at (0,36) size 0x18
RenderTable {TABLE} at (2,56) size 966x28 [border: (2px solid #FF0000)]
RenderTableSection {TBODY} at (2,2) size 0x24
RenderTableRow {TR} at (0,0) size 0x0
RenderTableCell {TD} at (2,2) size 958x20 [r=0 c=0 rs=1 cs=1]
RenderText {TEXT} at (1,1) size 956x18
text run at (1,1) width 480: "Blabla blah. Blabla blah. Blabla blah. Blabla blah. Blabla blah. Blabla blah. "
text run at (481,1) width 476: "Blabla blah. Blabla blah. Blabla blah. Blabla blah. Blabla blah. Blabla blah."
RenderBlock {DIV} at (2,84) size 904x22 [border: (2px solid #FF0000)]
RenderText {TEXT} at (2,2) size 476x18
text run at (2,2) width 476: "Blabla blah. Blabla blah. Blabla blah. Blabla blah. Blabla blah. Blabla blah."
1.1 WebCore/layout-tests/fast/block/margin-collapse/104.html
Index: 104.html
===================================================================
<html><head>
<style>
#container {border: 2px solid blue}
table{margin: 0 0 0 auto ; border: 2px solid red}
td{white-space: nowrap;}
#b {margin: 0 0 0 auto; width: 900px; border: 2px solid red;}
</style>
<body>
<div id=container>
Resize the window. Red boxes below must not overflow the blue box (or window) from the
left side, though they may overflow from right.<br><br>
<table>
<tbody>
<tr>
<td>
Blabla blah. Blabla blah. Blabla blah. Blabla blah. Blabla blah. Blabla blah.
Blabla blah. Blabla blah. Blabla blah. Blabla blah. Blabla blah. Blabla blah.
</td>
</tr>
</tbody>
</table>
<div id=b>
Blabla blah. Blabla blah. Blabla blah. Blabla blah. Blabla blah. Blabla blah.
</div>
</div>
</body>
</html>
More information about the webkit-changes
mailing list