Commit 763a68d0 authored by ddkilzer's avatar ddkilzer

WebCore:

        Reviewed by Hyatt.

        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=4874
        Table with absolute bottom positioning is positioned incorrectly

        Note: patch originally from Mitz, spruced up by Weinig.

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::calcAbsoluteVerticalValues):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::layout):

LayoutTests:

        Reviewed by Hyatt.

        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=4874
        Table with absolute bottom positioning is positioned incorrectly

        Note: test case originally from Mitz.

        * fast/table/absolute-table-at-bottom-expected.checksum: Added.
        * fast/table/absolute-table-at-bottom-expected.png: Added.
        * fast/table/absolute-table-at-bottom-expected.txt: Added.
        * fast/table/absolute-table-at-bottom.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0717d842
2006-06-29 Sam Weinig <sam.weinig@gmail.com>
Reviewed by Hyatt.
- test for http://bugzilla.opendarwin.org/show_bug.cgi?id=4874
Table with absolute bottom positioning is positioned incorrectly
Note: test case originally from Mitz.
* fast/table/absolute-table-at-bottom-expected.checksum: Added.
* fast/table/absolute-table-at-bottom-expected.png: Added.
* fast/table/absolute-table-at-bottom-expected.txt: Added.
* fast/table/absolute-table-at-bottom.html: Added.
2006-06-29 Graham Dennis <Graham.Dennis@gmail.com>
Reviewed by Justin.
e76a248aef063aef41f5ffe1c4d05e9d
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x185
RenderBlock {HTML} at (0,0) size 800x185
RenderBody {BODY} at (8,8) size 784x169
RenderBlock {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 108x18
text run at (0,0) width 108: "Testcase for bug "
RenderInline {A} at (0,0) size 32x18 [color=#0000EE]
RenderText {#text} at (108,0) size 32x18
text run at (108,0) width 32: "4874"
RenderText {#text} at (140,0) size 417x18
text run at (140,0) width 417: " - Table with absolute bottom positioning is positioned incorrectly."
RenderBlock {H1} at (0,39) size 784x37
RenderText {#text} at (0,0) size 188x37
text run at (0,0) width 188: "Look Down \x{2193}"
RenderBlock {P} at (0,97) size 784x72
RenderText {#text} at (0,0) size 783x72
text run at (0,0) width 507: "At the bottom of the window you should see the word \"Paragraph\" followed by "
text run at (507,0) width 265: "three boxes containing text. The entire red"
text run at (0,18) width 200: "border around each box should "
text run at (200,18) width 454: "be visible without scrolling (the window should not be scrollable at all). "
text run at (654,18) width 101: "The three boxes"
text run at (0,36) width 344: "should be aligned at the bottom with the bottom of the "
text run at (344,36) width 439: "window. The text \"Tall table\" should be vertically centered in its box,"
text run at (0,54) width 480: "which should be 50px tall. The other two boxes should both be shorter than "
text run at (480,54) width 203: "50px, and have the same height."
layer at (120,550) size 120x50
RenderTable {TABLE} at (120,550) size 120x50 [border: (1px solid #FF0000)]
RenderTableSection {TBODY} at (1,1) size 118x48
RenderTableRow {TR} at (0,2) size 118x44
RenderTableCell {TD} at (2,14) size 114x20 [r=0 c=0 rs=1 cs=1]
RenderText {#text} at (1,1) size 59x18
text run at (1,1) width 59: "Tall table"
layer at (240,574) size 120x26
RenderTable {TABLE} at (240,574) size 120x26 [border: (1px solid #FF0000)]
RenderTableSection {TBODY} at (1,1) size 118x24
RenderTableRow {TR} at (0,2) size 118x20
RenderTableCell {TD} at (2,2) size 114x20 [r=0 c=0 rs=1 cs=1]
RenderText {#text} at (1,1) size 82x18
text run at (1,1) width 82: "Normal table"
layer at (360,574) size 120x26
RenderTable {TABLE} at (360,574) size 120x26 [border: (1px solid #FF0000)]
RenderTableSection {TBODY} at (1,1) size 118x24
RenderTableRow {TR} at (0,2) size 118x20
RenderTableCell {TD} at (2,2) size 114x20 [r=0 c=0 rs=1 cs=1]
RenderText {#text} at (1,1) size 68x18
text run at (1,1) width 68: "Short table"
layer at (0,582) size 64x18
RenderBlock (positioned) {P} at (0,582) size 64x18
RenderText {#text} at (0,0) size 64x18
text run at (0,0) width 64: "Paragraph"
<!DOCTYPE html>
<html>
<head>
<title>Absolute Bottom Table</title>
<style type="text/css">
p { margin: 0; padding: 0; }
.atBottom { position: absolute; bottom: 0; left: 0; }
table { width: 120px; border:red solid 1px; }
#test1 { margin-left: 120px; height:50px; }
#test2 { margin-left: 240px; }
#test3 { margin-left: 360px; height:8px; }
</style>
</head>
<body>
<p>Testcase for bug <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=4874">4874</a> - Table with absolute bottom positioning is positioned incorrectly.</p>
<h1>Look Down &#8595;</h1>
<p>
At the bottom of the window you should see the word "Paragraph" followed by
three boxes containing text. The entire red border around each box should
be visible without scrolling (the window should not be scrollable at all).
The three boxes should be aligned at the bottom with the bottom of the
window. The text "Tall table" should be vertically centered in its box,
which should be 50px tall. The other two boxes should both be shorter than
50px, and have the same height.
</p>
<table id="test1" class="atBottom">
<tr>
<td>Tall table</td>
</tr>
</table>
<table id="test2" class="atBottom">
<tr>
<td>Normal table</td>
</tr>
</table>
<table id="test3" class="atBottom">
<tr>
<td>Short table</td>
</tr>
</table>
<p class="atBottom">
Paragraph
</p>
</body>
</html>
2006-06-29 Sam Weinig <sam.weinig@gmail.com>
Reviewed by Hyatt.
- test for http://bugzilla.opendarwin.org/show_bug.cgi?id=4874
Table with absolute bottom positioning is positioned incorrectly
Note: patch originally from Mitz, spruced up by Weinig.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::calcAbsoluteVerticalValues):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):
2006-06-29 Graham Dennis <Graham.Dennis@gmail.com>
Reviewed by Justin.
......
......@@ -1921,7 +1921,7 @@ void RenderBox::calcAbsoluteVerticalValues(Length height, const RenderObject* co
bool bottomIsAuto = bottom.isAuto();
// Height is never unsolved for tables.
if (isTable() && heightIsAuto) {
if (isTable()) {
height.setValue(Fixed, contentHeight);
heightIsAuto = false;
}
......
......@@ -294,16 +294,15 @@ void RenderTable::layout()
m_height += bpTop;
int oldHeight = m_height;
calcHeight();
int newHeight = m_height;
if (!isPositioned())
calcHeight();
m_height = oldHeight;
Length h = style()->height();
int th = 0;
if (isPositioned())
th = newHeight; // FIXME: Leave this alone for now but investigate later.
else if (h.isFixed())
th = h.value() - (bpTop + bpBottom); // Tables size as though CSS height includes border/padding.
if (h.isFixed())
// Tables size as though CSS height includes border/padding.
th = h.value() - (bpTop + bpBottom);
else if (h.isPercent())
th = calcPercentageHeight(h);
th = max(0, th);
......@@ -317,12 +316,10 @@ void RenderTable::layout()
if (firstBody) {
firstBody->calcRowHeight();
firstBody->layoutRows(th - calculatedHeight);
}
else if (!style()->htmlHacks()) {
} else if (!style()->htmlHacks())
// Completely empty tables (with no sections or anything) should at least honor specified height
// in strict mode.
m_height += th;
}
}
int bl = borderLeft();
......@@ -352,9 +349,12 @@ void RenderTable::layout()
m_height += tCaption->height() + tCaption->marginTop() + tCaption->marginBottom();
}
if (isPositioned())
calcHeight();
// table can be containing block of positioned elements.
// ### only pass true if width or height changed.
layoutPositionedObjects( true );
layoutPositionedObjects(true);
// Repaint with our new bounds if they are different from our old bounds.
if (checkForRepaint)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment