Reviewed by Hyatt.
- fix http://bugs.webkit.org/show_bug.cgi?id=12124
RenderTable::section{Above,Below}() can return the wrong answer for the {footer,header}
* rendering/RenderTable.cpp:
(WebCore::resetSectionPointerIfNotBefore): Added this function to help with
checking if a section being inserted is the going to be the first of its kind.
(WebCore::RenderTable::addChild): Changed to maintain the pointers to the
header, the footer, the caption and the first table body properly when objects
are inserted in the middle. Also changed to make the first caption win over
any other captions. This matches Firefox and what already used to happen when a
section recalc took place.
(WebCore::RenderTable::layout): Changed to use sectionBelow() for iterating
over the sections from top to bottom.
(WebCore::RenderTable::calcBorderLeft): Changed to really find the section
containing the first row.
(WebCore::RenderTable::calcBorderRight): Ditto.
(WebCore::RenderTable::sectionAbove): Fixed a bug when the last section was
skipped if the input was the footer.
(WebCore::RenderTable::sectionBelow): Ditto for "first" and "header"
respectively.
2007-01-11 Mitz Pettel <mitz@webkit.org>
Reviewed by Hyatt.
- updated results for http://bugs.webkit.org/show_bug.cgi?id=12124
RenderTable::section{Above,Below}() can return the wrong answer for the {footer,header}
Collapsed borders changed in the "marvin" tests, as the footer cells now
collapse correctly with the last row of the body. Visual differences not
captured by the pixel results since they occurred below 600px.
The "other" test has changed since in a table with multiple captions,
now the first one wins. No visual difference in this case since both captions
are the same.
* tables/mozilla/marvin/backgr_layers-opacity-expected.txt:
* tables/mozilla/marvin/backgr_position-table-expected.txt:
* tables/mozilla/marvin/backgr_simple-table-cell-expected.txt:
* tables/mozilla/marvin/backgr_simple-table-column-expected.txt:
* tables/mozilla/marvin/backgr_simple-table-column-group-expected.txt:
* tables/mozilla/marvin/backgr_simple-table-expected.txt:
* tables/mozilla/marvin/backgr_simple-table-row-expected.txt:
* tables/mozilla/marvin/backgr_simple-table-row-group-expected.txt:
* tables/mozilla_expected_failures/marvin/backgr_border-table-cell-expected.txt:
* tables/mozilla_expected_failures/marvin/backgr_border-table-column-expected.txt:
* tables/mozilla_expected_failures/marvin/backgr_border-table-column-group-expected.txt:
* tables/mozilla_expected_failures/marvin/backgr_border-table-expected.txt:
* tables/mozilla_expected_failures/marvin/backgr_border-table-quirks-expected.txt:
* tables/mozilla_expected_failures/marvin/backgr_border-table-row-expected.txt:
* tables/mozilla_expected_failures/marvin/backgr_border-table-row-group-expected.txt:
* tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.txt:
* tables/mozilla_expected_failures/marvin/backgr_layers-hide-expected.txt:
* tables/mozilla_expected_failures/marvin/backgr_layers-show-expected.txt:
* tables/mozilla_expected_failures/marvin/backgr_position-table-cell-expected.txt:
* tables/mozilla_expected_failures/marvin/backgr_position-table-column-expected.txt:
* tables/mozilla_expected_failures/marvin/backgr_position-table-column-group-expected.txt:
* tables/mozilla_expected_failures/marvin/backgr_position-table-row-expected.txt:
* tables/mozilla_expected_failures/marvin/backgr_position-table-row-group-expected.txt:
* tables/mozilla_expected_failures/other/test4-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@18791
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-01-11 Mitz Pettel <mitz@webkit.org>
+
+ Reviewed by Hyatt.
+
+ - updated results for http://bugs.webkit.org/show_bug.cgi?id=12124
+ RenderTable::section{Above,Below}() can return the wrong answer for the {footer,header}
+
+ Collapsed borders changed in the "marvin" tests, as the footer cells now
+ collapse correctly with the last row of the body. Visual differences not
+ captured by the pixel results since they occurred below 600px.
+
+ The "other" test has changed since in a table with multiple captions,
+ now the first one wins. No visual difference in this case since both captions
+ are the same.
+
+ * tables/mozilla/marvin/backgr_layers-opacity-expected.txt:
+ * tables/mozilla/marvin/backgr_position-table-expected.txt:
+ * tables/mozilla/marvin/backgr_simple-table-cell-expected.txt:
+ * tables/mozilla/marvin/backgr_simple-table-column-expected.txt:
+ * tables/mozilla/marvin/backgr_simple-table-column-group-expected.txt:
+ * tables/mozilla/marvin/backgr_simple-table-expected.txt:
+ * tables/mozilla/marvin/backgr_simple-table-row-expected.txt:
+ * tables/mozilla/marvin/backgr_simple-table-row-group-expected.txt:
+ * tables/mozilla_expected_failures/marvin/backgr_border-table-cell-expected.txt:
+ * tables/mozilla_expected_failures/marvin/backgr_border-table-column-expected.txt:
+ * tables/mozilla_expected_failures/marvin/backgr_border-table-column-group-expected.txt:
+ * tables/mozilla_expected_failures/marvin/backgr_border-table-expected.txt:
+ * tables/mozilla_expected_failures/marvin/backgr_border-table-quirks-expected.txt:
+ * tables/mozilla_expected_failures/marvin/backgr_border-table-row-expected.txt:
+ * tables/mozilla_expected_failures/marvin/backgr_border-table-row-group-expected.txt:
+ * tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.txt:
+ * tables/mozilla_expected_failures/marvin/backgr_layers-hide-expected.txt:
+ * tables/mozilla_expected_failures/marvin/backgr_layers-show-expected.txt:
+ * tables/mozilla_expected_failures/marvin/backgr_position-table-cell-expected.txt:
+ * tables/mozilla_expected_failures/marvin/backgr_position-table-column-expected.txt:
+ * tables/mozilla_expected_failures/marvin/backgr_position-table-column-group-expected.txt:
+ * tables/mozilla_expected_failures/marvin/backgr_position-table-row-expected.txt:
+ * tables/mozilla_expected_failures/marvin/backgr_position-table-row-group-expected.txt:
+ * tables/mozilla_expected_failures/other/test4-expected.txt:
+
2007-01-11 Mitz Pettel <mitz@webkit.org>
Reviewed by Hyatt.
RenderTableSection {TFOOT} at (0,317) size 577x114 [bgcolor=#FFFF00]
layer at (8,1108) size 577x114
RenderTableRow {TR} at (0,0) size 577x114 [bgcolor=#FF0000]
- RenderTableCell {TD} at (0,44) size 342x25 [border: (1px dotted #000000)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (2,2) size 47x22
- text run at (2,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 342x31 [border: (7px dotted #000000)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (2,8) size 47x22
+ text run at (2,8) width 47: "TD M"
RenderTableCell {TD} at (342,44) size 123x25 [border: (1px dotted #000000)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
text run at (34,2) width 45: "TH D"
RenderTableSection {TFOOT} at (0,317) size 577x114
RenderTableRow {TR} at (0,0) size 577x114
- RenderTableCell {TD} at (0,44) size 342x25 [border: (1px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (2,2) size 47x22
- text run at (2,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 342x31 [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (2,8) size 47x22
+ text run at (2,8) width 47: "TD M"
RenderTableCell {TD} at (342,44) size 123x25 [border: (1px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
text run at (34,2) width 45: "TH D"
RenderTableSection {TFOOT} at (0,317) size 577x114
RenderTableRow {TR} at (0,0) size 577x114
- RenderTableCell {TD} at (0,44) size 342x25 [bgcolor=#000000] [border: (1px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (2,2) size 47x22
- text run at (2,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 342x31 [bgcolor=#000000] [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (2,8) size 47x22
+ text run at (2,8) width 47: "TD M"
RenderTableCell {TD} at (342,44) size 123x25 [bgcolor=#000000] [border: (1px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
text run at (34,2) width 45: "TH D"
RenderTableSection {TFOOT} at (0,317) size 577x114
RenderTableRow {TR} at (0,0) size 577x114
- RenderTableCell {TD} at (0,44) size 342x25 [border: (1px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (2,2) size 47x22
- text run at (2,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 342x31 [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (2,8) size 47x22
+ text run at (2,8) width 47: "TD M"
RenderTableCell {TD} at (342,44) size 123x25 [border: (1px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
text run at (34,2) width 45: "TH D"
RenderTableSection {TFOOT} at (0,317) size 577x114
RenderTableRow {TR} at (0,0) size 577x114
- RenderTableCell {TD} at (0,44) size 342x25 [border: (1px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (2,2) size 47x22
- text run at (2,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 342x31 [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (2,8) size 47x22
+ text run at (2,8) width 47: "TD M"
RenderTableCell {TD} at (342,44) size 123x25 [border: (1px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
text run at (34,2) width 45: "TH D"
RenderTableSection {TFOOT} at (0,317) size 577x114
RenderTableRow {TR} at (0,0) size 577x114
- RenderTableCell {TD} at (0,44) size 342x25 [border: (1px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (2,2) size 47x22
- text run at (2,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 342x31 [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (2,8) size 47x22
+ text run at (2,8) width 47: "TD M"
RenderTableCell {TD} at (342,44) size 123x25 [border: (1px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
text run at (34,2) width 45: "TH D"
RenderTableSection {TFOOT} at (0,317) size 577x114
RenderTableRow {TR} at (0,0) size 577x114 [bgcolor=#000000]
- RenderTableCell {TD} at (0,44) size 342x25 [border: (1px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (2,2) size 47x22
- text run at (2,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 342x31 [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (2,8) size 47x22
+ text run at (2,8) width 47: "TD M"
RenderTableCell {TD} at (342,44) size 123x25 [border: (1px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
text run at (34,2) width 45: "TH D"
RenderTableSection {TFOOT} at (0,317) size 577x114
RenderTableRow {TR} at (0,0) size 577x114
- RenderTableCell {TD} at (0,44) size 342x25 [border: (1px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (2,2) size 47x22
- text run at (2,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 342x31 [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (2,8) size 47x22
+ text run at (2,8) width 47: "TD M"
RenderTableCell {TD} at (342,44) size 123x25 [border: (1px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
text run at (34,4) width 45: "TH D"
RenderTableSection {TFOOT} at (2,319) size 581x116
RenderTableRow {TR} at (0,0) size 581x116
- RenderTableCell {TD} at (0,44) size 344x27 [bgcolor=#000000] [border: (1px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (4,2) size 47x22
- text run at (4,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 344x33 [bgcolor=#000000] [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (4,8) size 47x22
+ text run at (4,8) width 47: "TD M"
RenderTableCell {TD} at (344,44) size 123x27 [border: (1px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
text run at (36,3) width 45: "TH D"
RenderTableSection {TFOOT} at (2,318) size 584x115
RenderTableRow {TR} at (0,0) size 584x115
- RenderTableCell {TD} at (0,43) size 344x29 [border: (3px dashed #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (4,4) size 47x22
- text run at (4,4) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 344x33 [border: (7px dashed #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (4,8) size 47x22
+ text run at (4,8) width 47: "TD M"
RenderTableCell {TD} at (344,44) size 125x27 [border: (1px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (6,2) size 46x22
text run at (6,2) width 46: "TD O"
text run at (38,3) width 45: "TH D"
RenderTableSection {TFOOT} at (1,318) size 587x115
RenderTableRow {TR} at (0,0) size 587x115
- RenderTableCell {TD} at (0,43) size 470x29 [border: (3px dashed #FFFFFF)] [r=0 c=0 rs=1 cs=3]
- RenderText {#text} at (4,4) size 47x22
- text run at (4,4) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 470x33 [border: (7px dashed #FFFFFF)] [r=0 c=0 rs=1 cs=3]
+ RenderText {#text} at (4,8) size 47x22
+ text run at (4,8) width 47: "TD M"
RenderTableCell {TD} at (470,44) size 117x26 [border: (1px dotted #FFFFFF)] [r=0 c=3 rs=1 cs=1]
RenderText {#text} at (6,2) size 44x22
text run at (6,2) width 44: "TD P"
text run at (34,4) width 45: "TH D"
RenderTableSection {TFOOT} at (2,319) size 581x116
RenderTableRow {TR} at (0,0) size 581x116
- RenderTableCell {TD} at (0,44) size 344x27 [border: (1px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (4,2) size 47x22
- text run at (4,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 344x33 [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (4,8) size 47x22
+ text run at (4,8) width 47: "TD M"
RenderTableCell {TD} at (344,44) size 123x27 [border: (1px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
text run at (34,4) width 45: "TH D"
RenderTableSection {TFOOT} at (2,308) size 581x111
RenderTableRow {TR} at (0,0) size 581x111
- RenderTableCell {TD} at (0,42) size 344x27 [border: (1px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (4,2) size 47x22
- text run at (4,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,39) size 344x33 [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (4,8) size 47x22
+ text run at (4,8) width 47: "TD M"
RenderTableCell {TD} at (344,42) size 123x27 [border: (1px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
text run at (36,4) width 45: "TH D"
RenderTableSection {TFOOT} at (2,337) size 585x117
RenderTableRow {TR} at (0,0) size 585x117
- RenderTableCell {TD} at (0,44) size 344x28 [border: (3px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (3,4) size 47x22
- text run at (3,4) width 47: "TD M"
+ RenderTableCell {TD} at (0,42) size 344x32 [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (3,8) size 47x22
+ text run at (3,8) width 47: "TD M"
RenderTableCell {TD} at (344,44) size 125x28 [border: (3px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,4) size 46x22
text run at (2,4) width 46: "TD O"
text run at (36,4) width 45: "TH D"
RenderTableSection {TFOOT} at (2,325) size 585x117
RenderTableRow {TR} at (0,0) size 585x117
- RenderTableCell {TD} at (0,44) size 344x28 [border: (3px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (3,4) size 47x22
- text run at (3,4) width 47: "TD M"
+ RenderTableCell {TD} at (0,42) size 344x32 [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (3,8) size 47x22
+ text run at (3,8) width 47: "TD M"
RenderTableCell {TD} at (344,44) size 125x28 [border: (3px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,4) size 46x22
text run at (2,4) width 46: "TD O"
text run at (34,2) width 45: "TH D"
RenderTableSection {TFOOT} at (0,317) size 577x114
RenderTableRow {TR} at (0,0) size 577x114
- RenderTableCell {TD} at (0,44) size 342x25 [border: (1px dotted #000000)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (2,2) size 47x22
- text run at (2,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 342x31 [border: (7px dotted #000000)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (2,8) size 47x22
+ text run at (2,8) width 47: "TD M"
RenderTableCell {TD} at (342,44) size 123x25 [border: (1px dotted #000000)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
text run at (34,2) width 45: "TH D"
RenderTableSection {TFOOT} at (0,317) size 577x114
RenderTableRow {TR} at (0,0) size 577x114
- RenderTableCell {TD} at (0,44) size 342x25 [border: (1px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (2,2) size 47x22
- text run at (2,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 342x31 [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (2,8) size 47x22
+ text run at (2,8) width 47: "TD M"
RenderTableCell {TD} at (342,44) size 123x25 [border: (1px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
text run at (34,2) width 45: "TH D"
RenderTableSection {TFOOT} at (0,317) size 577x114
RenderTableRow {TR} at (0,0) size 577x114
- RenderTableCell {TD} at (0,44) size 342x25 [border: (1px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (2,2) size 47x22
- text run at (2,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 342x31 [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (2,8) size 47x22
+ text run at (2,8) width 47: "TD M"
RenderTableCell {TD} at (342,44) size 123x25 [border: (1px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
text run at (34,2) width 45: "TH D"
RenderTableSection {TFOOT} at (0,317) size 577x114
RenderTableRow {TR} at (0,0) size 577x114
- RenderTableCell {TD} at (0,44) size 342x25 [bgcolor=#000000] [border: (1px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (2,2) size 47x22
- text run at (2,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 342x31 [bgcolor=#000000] [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (2,8) size 47x22
+ text run at (2,8) width 47: "TD M"
RenderTableCell {TD} at (342,44) size 123x25 [border: (1px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
text run at (34,2) width 45: "TH D"
RenderTableSection {TFOOT} at (0,317) size 577x114
RenderTableRow {TR} at (0,0) size 577x114
- RenderTableCell {TD} at (0,44) size 342x25 [border: (1px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (2,2) size 47x22
- text run at (2,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 342x31 [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (2,8) size 47x22
+ text run at (2,8) width 47: "TD M"
RenderTableCell {TD} at (342,44) size 123x25 [border: (1px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
text run at (34,2) width 45: "TH D"
RenderTableSection {TFOOT} at (0,317) size 577x114
RenderTableRow {TR} at (0,0) size 577x114
- RenderTableCell {TD} at (0,44) size 465x25 [border: (1px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=3]
- RenderText {#text} at (2,2) size 47x22
- text run at (2,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 465x31 [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=3]
+ RenderText {#text} at (2,8) size 47x22
+ text run at (2,8) width 47: "TD M"
RenderTableCell {TD} at (465,44) size 112x25 [border: (1px dotted #FFFFFF)] [r=0 c=3 rs=1 cs=1]
RenderText {#text} at (2,2) size 44x22
text run at (2,2) width 44: "TD P"
text run at (34,2) width 45: "TH D"
RenderTableSection {TFOOT} at (0,317) size 577x114
RenderTableRow {TR} at (0,0) size 577x114
- RenderTableCell {TD} at (0,44) size 342x25 [border: (1px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (2,2) size 47x22
- text run at (2,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 342x31 [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (2,8) size 47x22
+ text run at (2,8) width 47: "TD M"
RenderTableCell {TD} at (342,44) size 123x25 [border: (1px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
text run at (34,2) width 45: "TH D"
RenderTableSection {TFOOT} at (0,317) size 577x114
RenderTableRow {TR} at (0,0) size 577x114
- RenderTableCell {TD} at (0,44) size 342x25 [border: (1px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
- RenderText {#text} at (2,2) size 47x22
- text run at (2,2) width 47: "TD M"
+ RenderTableCell {TD} at (0,41) size 342x31 [border: (7px dotted #FFFFFF)] [r=0 c=0 rs=1 cs=2]
+ RenderText {#text} at (2,8) size 47x22
+ text run at (2,8) width 47: "TD M"
RenderTableCell {TD} at (342,44) size 123x25 [border: (1px dotted #FFFFFF)] [r=0 c=2 rs=1 cs=1]
RenderText {#text} at (2,2) size 46x22
text run at (2,2) width 46: "TD O"
RenderBlock (anonymous) at (0,776) size 769x18
RenderBR {BR} at (0,0) size 0x18
RenderTable {TABLE} at (0,794) size 190x410
- RenderBlock {CAPTION} at (0,0) size 190x18
+ RenderBlock {CAPTION} at (0,392) size 190x18
RenderText {#text} at (2,0) size 186x18
text run at (2,0) width 186: "Table 5 has a scrolling tbody."
RenderTableSection {THEAD} at (0,0) size 190x19
RenderTableCell {TD} at (2,2) size 92x15 [r=0 c=0 rs=1 cs=2]
RenderText {#text} at (1,1) size 47x13
text run at (1,1) width 47: "FOOTER"
- RenderBlock {CAPTION} at (0,392) size 190x18
+ RenderBlock {CAPTION} at (0,0) size 190x18
RenderText {#text} at (2,0) size 186x18
text run at (2,0) width 186: "Table 5 has a scrolling tbody."
RenderTable at (0,1204) size 204x18
+2007-01-11 Mitz Pettel <mitz@webkit.org>
+
+ Reviewed by Hyatt.
+
+ - fix http://bugs.webkit.org/show_bug.cgi?id=12124
+ RenderTable::section{Above,Below}() can return the wrong answer for the {footer,header}
+
+ * rendering/RenderTable.cpp:
+ (WebCore::resetSectionPointerIfNotBefore): Added this function to help with
+ checking if a section being inserted is the going to be the first of its kind.
+ (WebCore::RenderTable::addChild): Changed to maintain the pointers to the
+ header, the footer, the caption and the first table body properly when objects
+ are inserted in the middle. Also changed to make the first caption win over
+ any other captions. This matches Firefox and what already used to happen when a
+ section recalc took place.
+ (WebCore::RenderTable::layout): Changed to use sectionBelow() for iterating
+ over the sections from top to bottom.
+ (WebCore::RenderTable::calcBorderLeft): Changed to really find the section
+ containing the first row.
+ (WebCore::RenderTable::calcBorderRight): Ditto.
+ (WebCore::RenderTable::sectionAbove): Fixed a bug when the last section was
+ skipped if the input was the footer.
+ (WebCore::RenderTable::sectionBelow): Ditto for "first" and "header"
+ respectively.
+
2007-01-11 Mitz Pettel <mitz@webkit.org>
Reviewed by Hyatt.
}
}
+static inline void resetSectionPointerIfNotBefore(RenderTableSection*& ptr, RenderObject* before)
+{
+ if (!before || !ptr)
+ return;
+ RenderObject* o = before->previousSibling();
+ while (o && o != ptr)
+ o = o->previousSibling();
+ if (!o)
+ ptr = 0;
+}
+
void RenderTable::addChild(RenderObject* child, RenderObject* beforeChild)
{
bool wrapInAnonymousSection = true;
switch (child->style()->display()) {
case TABLE_CAPTION:
- if (child->isRenderBlock())
- m_caption = static_cast<RenderBlock*>(child);
+ if (child->isRenderBlock()) {
+ // First caption wins.
+ if (beforeChild && m_caption) {
+ RenderObject* o = beforeChild->previousSibling();
+ while (o && o != m_caption)
+ o = o->previousSibling();
+ if (!o)
+ m_caption = 0;
+ }
+ if (!m_caption)
+ m_caption = static_cast<RenderBlock*>(child);
+ }
wrapInAnonymousSection = false;
break;
case TABLE_COLUMN:
wrapInAnonymousSection = false;
break;
case TABLE_HEADER_GROUP:
- if (!m_head) {
- if (child->isTableSection())
+ if (child->isTableSection()) {
+ resetSectionPointerIfNotBefore(m_head, beforeChild);
+ if (!m_head) {
m_head = static_cast<RenderTableSection*>(child);
- } else if (!m_firstBody) {
- if (child->isTableSection())
- m_firstBody = static_cast<RenderTableSection*>(child);
+ } else {
+ resetSectionPointerIfNotBefore(m_firstBody, beforeChild);
+ if (!m_firstBody)
+ m_firstBody = static_cast<RenderTableSection*>(child);
+ }
}
wrapInAnonymousSection = false;
break;
case TABLE_FOOTER_GROUP:
- if (!m_foot) {
- if (child->isTableSection())
+ if (child->isTableSection()) {
+ resetSectionPointerIfNotBefore(m_foot, beforeChild);
+ if (!m_foot) {
m_foot = static_cast<RenderTableSection*>(child);
- wrapInAnonymousSection = false;
- break;
+ wrapInAnonymousSection = false;
+ break;
+ }
}
- // fall through
+ // Fall through.
case TABLE_ROW_GROUP:
- if (!m_firstBody)
- if (child->isTableSection())
+ if (child->isTableSection()) {
+ resetSectionPointerIfNotBefore(m_firstBody, beforeChild);
+ if (!m_firstBody)
m_firstBody = static_cast<RenderTableSection*>(child);
+ }
wrapInAnonymousSection = false;
break;
case TABLE_CELL:
bl += paddingLeft();
// position the table sections
- RenderObject* section = m_head ? m_head : (m_firstBody ? m_firstBody : m_foot);
+ RenderTableSection* section = m_head ? m_head : (m_firstBody ? m_firstBody : m_foot);
while (section) {
if (!sectionMoved && section->yPos() != m_height) {
sectionMoved = true;
m_height += section->height();
m_overflowLeft = min(m_overflowLeft, section->xPos() + section->overflowLeft(false));
m_overflowWidth = max(m_overflowWidth, section->xPos() + section->overflowWidth(false));
- // FIXME: Use sectionBelow() instead of the following once sectionBelow() is fixed.
- // See http://bugs.webkit.org/show_bug.cgi?id=12124
- if (section == m_foot)
- break;
- if (section == m_head)
- section = m_firstBody ? m_firstBody : m_foot;
- else {
- do {
- section = section->nextSibling();
- } while (section && (section == m_head || section == m_foot || !section->isTableSection()));
- if (!section)
- section = m_foot;
- }
+ section = sectionBelow(section);
}
m_height += bpBottom;
borderWidth = max(borderWidth, gb.width);
}
- RenderObject* child = firstChild();
- while (child && !child->isTableSection())
- child = child->nextSibling();
- if (child && child->isTableSection()) {
- RenderTableSection* section = static_cast<RenderTableSection*>(child);
-
- if (!section->numRows())
- return borderWidth / 2;
-
- const BorderValue& sb = section->style()->borderLeft();
+ RenderTableSection* firstNonEmptySection = m_head ? m_head : (m_firstBody ? m_firstBody : m_foot);
+ if (firstNonEmptySection && !firstNonEmptySection->numRows())
+ firstNonEmptySection = sectionBelow(firstNonEmptySection, true);
+
+ if (firstNonEmptySection) {
+ const BorderValue& sb = firstNonEmptySection->style()->borderLeft();
if (sb.style() == BHIDDEN)
return 0;
+
if (sb.style() > BHIDDEN)
borderWidth = max(borderWidth, sb.width);
- const RenderTableSection::CellStruct& cs = section->cellAt(0, leftmostColumn);
+ const RenderTableSection::CellStruct& cs = firstNonEmptySection->cellAt(0, leftmostColumn);
if (cs.cell) {
const BorderValue& cb = cs.cell->style()->borderLeft();
if (cb.style() == BHIDDEN)
return 0;
+
const BorderValue& rb = cs.cell->parent()->style()->borderLeft();
if (rb.style() == BHIDDEN)
return 0;
borderWidth = max(borderWidth, gb.width);
}
- RenderObject* child = firstChild();
- while (child && !child->isTableSection())
- child = child->nextSibling();
- if (child && child->isTableSection()) {
- RenderTableSection* section = static_cast<RenderTableSection*>(child);
-
- if (!section->numRows())
- return (borderWidth + 1) / 2;
-
- const BorderValue& sb = section->style()->borderRight();
+ RenderTableSection* firstNonEmptySection = m_head ? m_head : (m_firstBody ? m_firstBody : m_foot);
+ if (firstNonEmptySection && !firstNonEmptySection->numRows())
+ firstNonEmptySection = sectionBelow(firstNonEmptySection, true);
+
+ if (firstNonEmptySection) {
+ const BorderValue& sb = firstNonEmptySection->style()->borderRight();
if (sb.style() == BHIDDEN)
return 0;
+
if (sb.style() > BHIDDEN)
borderWidth = max(borderWidth, sb.width);
- const RenderTableSection::CellStruct& cs = section->cellAt(0, rightmostColumn);
+ const RenderTableSection::CellStruct& cs = firstNonEmptySection->cellAt(0, rightmostColumn);
if (cs.cell) {
const BorderValue& cb = cs.cell->style()->borderRight();
if (cb.style() == BHIDDEN)
return 0;
+
const BorderValue& rb = cs.cell->parent()->style()->borderRight();
if (rb.style() == BHIDDEN)
return 0;
{
if (section == m_head)
return 0;
- RenderObject* prevSection = (section == m_foot ? lastChild() : section)->previousSibling();
+ RenderObject* prevSection = section == m_foot ? lastChild() : section->previousSibling();
while (prevSection) {
if (prevSection->isTableSection() && prevSection != m_head && prevSection != m_foot && (!skipEmptySections || static_cast<RenderTableSection*>(prevSection)->numRows()))
break;
{
if (section == m_foot)
return 0;
- RenderObject* nextSection = (section == m_head ? firstChild() : section)->nextSibling();
+ RenderObject* nextSection = section == m_head ? firstChild() : section->nextSibling();
while (nextSection) {
if (nextSection->isTableSection() && nextSection != m_head && nextSection != m_foot && (!skipEmptySections || static_cast<RenderTableSection*>(nextSection)->numRows()))
break;