2006-05-25 Mitz Pettel <opendarwin.org@mitzpettel.com>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 May 2006 22:17:38 +0000 (22:17 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 May 2006 22:17:38 +0000 (22:17 +0000)
        Reviewed by hyatt.  Landed by eseidel.

        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8848
          TFOOT borders are copied to THEAD and TBODY

        Test: fast/table/border-collapsing/border-collapsing-head-foot.html

        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::sectionAbove): Added.
        (WebCore::RenderTable::sectionBelow): Added.
        (WebCore::RenderTable::cellAbove): Changed to call sectionAbove.
        (WebCore::RenderTable::cellBelow): Changed to call sectionBelow.
        * rendering/RenderTable.h:
        * rendering/RenderTableCell.cpp:
        (WebCore::RenderTableCell::collapsedTopBorder): Changed to call sectionAbove.
        (WebCore::RenderTableCell::collapsedBottomBorder): Changed to call sectionBelow.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14598 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/table/border-collapsing/border-collapsing-head-foot-expected.checksum [new file with mode: 0644]
LayoutTests/fast/table/border-collapsing/border-collapsing-head-foot-expected.txt [new file with mode: 0644]
LayoutTests/fast/table/border-collapsing/border-collapsing-head-foot.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderTable.cpp
WebCore/rendering/RenderTable.h
WebCore/rendering/RenderTableCell.cpp

index 37fef5c6494874377b616ef1ceee616c948055d4..5c925c8865ace1a400bd42af4e2b869660cd11d3 100644 (file)
@@ -1,3 +1,15 @@
+2006-05-25  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by hyatt.  Landed by eseidel.
+
+        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8848
+          TFOOT borders are copied to THEAD and TBODY
+
+        * fast/table/border-collapsing/border-collapsing-head-foot-expected.checksum: Added.
+        * fast/table/border-collapsing/border-collapsing-head-foot-expected.png: Added.
+        * fast/table/border-collapsing/border-collapsing-head-foot-expected.txt: Added.
+        * fast/table/border-collapsing/border-collapsing-head-foot.html: Added.
+
 2006-05-25  Mitz Pettel  <opendarwin.org@mitzpettel.com>
 
         Reviewed by hyatt.  Landed by eseidel.
diff --git a/LayoutTests/fast/table/border-collapsing/border-collapsing-head-foot-expected.checksum b/LayoutTests/fast/table/border-collapsing/border-collapsing-head-foot-expected.checksum
new file mode 100644 (file)
index 0000000..dc77085
--- /dev/null
@@ -0,0 +1,2 @@
+09f993d34c1560dcbff212b7d1b1e767
+\ No newline at end of file
diff --git a/LayoutTests/fast/table/border-collapsing/border-collapsing-head-foot-expected.txt b/LayoutTests/fast/table/border-collapsing/border-collapsing-head-foot-expected.txt
new file mode 100644 (file)
index 0000000..36f5d20
--- /dev/null
@@ -0,0 +1,277 @@
+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 {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 53x18
+          text run at (0,0) width 53: "Test for "
+        RenderInline {I} at (0,0) size 685x18
+          RenderInline {A} at (0,0) size 348x18 [color=#0000EE]
+            RenderText {#text} at (53,0) size 348x18
+              text run at (53,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8848"
+          RenderText {#text} at (401,0) size 337x18
+            text run at (401,0) width 4: " "
+            text run at (405,0) width 333: "TFOOT borders are copied to THEAD and TBODY"
+        RenderText {#text} at (738,0) size 4x18
+          text run at (738,0) width 4: "."
+      RenderBlock {HR} at (0,34) size 784x2 [border: (1px inset #000000)]
+      RenderTable {TABLE} at (0,44) size 314x307
+        RenderTableSection {TBODY} at (0,0) size 314x307
+          RenderTableRow {TR} at (0,2) size 314x303
+            RenderTableCell {TD} at (2,2) size 76x303 [r=0 c=0 rs=1 cs=1]
+              RenderTable {TABLE} at (11,11) size 54x87 [border: none]
+                RenderTableSection {THEAD} at (0,0) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TH} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 50x18
+                        text run at (2,2) width 50: "Header"
+                RenderTableSection {TBODY} at (0,21) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 1"
+                RenderTableSection {TBODY} at (0,42) size 53x22
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TD} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 2"
+                RenderTableSection {TFOOT} at (0,64) size 53x22 [border: (2px solid #0000FF) none (2px solid #008000) none]
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TD} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 41x18
+                        text run at (2,2) width 41: "Footer"
+              RenderTable {TABLE} at (11,108) size 54x87 [border: none]
+                RenderTableSection {TBODY} at (0,21) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 1"
+                RenderTableSection {THEAD} at (0,0) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TH} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 50x18
+                        text run at (2,2) width 50: "Header"
+                RenderTableSection {TBODY} at (0,42) size 53x22
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TD} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 2"
+                RenderTableSection {TFOOT} at (0,64) size 53x22 [border: (2px solid #0000FF) none (2px solid #008000) none]
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TD} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 41x18
+                        text run at (2,2) width 41: "Footer"
+              RenderTable {TABLE} at (11,205) size 54x87 [border: none]
+                RenderTableSection {TBODY} at (0,21) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 1"
+                RenderTableSection {THEAD} at (0,0) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TH} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 50x18
+                        text run at (2,2) width 50: "Header"
+                RenderTableSection {TFOOT} at (0,64) size 53x22 [border: (2px solid #0000FF) none (2px solid #008000) none]
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TD} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 41x18
+                        text run at (2,2) width 41: "Footer"
+                RenderTableSection {TBODY} at (0,42) size 53x22
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TD} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 2"
+            RenderTableCell {TD} at (80,2) size 76x303 [r=0 c=1 rs=1 cs=1]
+              RenderTable {TABLE} at (11,11) size 54x87 [border: none]
+                RenderTableSection {TBODY} at (0,21) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 1"
+                RenderTableSection {TFOOT} at (0,64) size 53x22 [border: (2px solid #0000FF) none (2px solid #008000) none]
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TD} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 41x18
+                        text run at (2,2) width 41: "Footer"
+                RenderTableSection {THEAD} at (0,0) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TH} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 50x18
+                        text run at (2,2) width 50: "Header"
+                RenderTableSection {TBODY} at (0,42) size 53x22
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TD} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 2"
+              RenderTable {TABLE} at (11,108) size 54x87 [border: none]
+                RenderTableSection {TFOOT} at (0,64) size 53x22 [border: (2px solid #0000FF) none (2px solid #008000) none]
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TD} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 41x18
+                        text run at (2,2) width 41: "Footer"
+                RenderTableSection {TBODY} at (0,21) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 1"
+                RenderTableSection {THEAD} at (0,0) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TH} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 50x18
+                        text run at (2,2) width 50: "Header"
+                RenderTableSection {TBODY} at (0,42) size 53x22
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TD} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 2"
+              RenderTable {TABLE} at (11,205) size 54x87 [border: none]
+                RenderTableSection {TBODY} at (0,21) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 1"
+                RenderTableSection {TBODY} at (0,42) size 53x22
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TD} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 2"
+                RenderTableSection {TFOOT} at (0,64) size 53x22 [border: (2px solid #0000FF) none (2px solid #008000) none]
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TD} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 41x18
+                        text run at (2,2) width 41: "Footer"
+                RenderTableSection {THEAD} at (0,0) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TH} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 50x18
+                        text run at (2,2) width 50: "Header"
+            RenderTableCell {TD} at (158,2) size 76x303 [r=0 c=2 rs=1 cs=1]
+              RenderTable {TABLE} at (11,11) size 54x87 [border: (1px none #808080)]
+                RenderTableSection {THEAD} at (0,1) size 53x22 [border: (2px solid #0000FF) none (2px solid #008000) none]
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TH} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 50x18
+                        text run at (2,2) width 50: "Header"
+                RenderTableSection {TBODY} at (0,23) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 1"
+                RenderTableSection {TBODY} at (0,44) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 2"
+                RenderTableSection {TFOOT} at (0,65) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 41x18
+                        text run at (2,2) width 41: "Footer"
+              RenderTable {TABLE} at (11,108) size 54x87 [border: (1px none #808080)]
+                RenderTableSection {TBODY} at (0,23) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 1"
+                RenderTableSection {THEAD} at (0,1) size 53x22 [border: (2px solid #0000FF) none (2px solid #008000) none]
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TH} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 50x18
+                        text run at (2,2) width 50: "Header"
+                RenderTableSection {TBODY} at (0,44) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 2"
+                RenderTableSection {TFOOT} at (0,65) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 41x18
+                        text run at (2,2) width 41: "Footer"
+              RenderTable {TABLE} at (11,205) size 54x87 [border: (1px none #808080)]
+                RenderTableSection {TBODY} at (0,23) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 1"
+                RenderTableSection {THEAD} at (0,1) size 53x22 [border: (2px solid #0000FF) none (2px solid #008000) none]
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TH} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 50x18
+                        text run at (2,2) width 50: "Header"
+                RenderTableSection {TFOOT} at (0,65) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 41x18
+                        text run at (2,2) width 41: "Footer"
+                RenderTableSection {TBODY} at (0,44) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 2"
+            RenderTableCell {TD} at (236,2) size 76x303 [r=0 c=3 rs=1 cs=1]
+              RenderTable {TABLE} at (11,11) size 54x87 [border: (1px none #808080)]
+                RenderTableSection {TBODY} at (0,23) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 1"
+                RenderTableSection {TFOOT} at (0,65) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 41x18
+                        text run at (2,2) width 41: "Footer"
+                RenderTableSection {THEAD} at (0,1) size 53x22 [border: (2px solid #0000FF) none (2px solid #008000) none]
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TH} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 50x18
+                        text run at (2,2) width 50: "Header"
+                RenderTableSection {TBODY} at (0,44) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 2"
+              RenderTable {TABLE} at (11,108) size 54x87 [border: (1px none #808080)]
+                RenderTableSection {TFOOT} at (0,65) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 41x18
+                        text run at (2,2) width 41: "Footer"
+                RenderTableSection {TBODY} at (0,23) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 1"
+                RenderTableSection {THEAD} at (0,1) size 53x22 [border: (2px solid #0000FF) none (2px solid #008000) none]
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TH} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 50x18
+                        text run at (2,2) width 50: "Header"
+                RenderTableSection {TBODY} at (0,44) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 2"
+              RenderTable {TABLE} at (11,205) size 54x87 [border: (1px none #808080)]
+                RenderTableSection {TBODY} at (0,23) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 1"
+                RenderTableSection {TBODY} at (0,44) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 47x18
+                        text run at (2,2) width 47: "Body 2"
+                RenderTableSection {TFOOT} at (0,65) size 53x21
+                  RenderTableRow {TR} at (0,0) size 53x21
+                    RenderTableCell {TD} at (0,0) size 53x21 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 41x18
+                        text run at (2,2) width 41: "Footer"
+                RenderTableSection {THEAD} at (0,1) size 53x22 [border: (2px solid #0000FF) none (2px solid #008000) none]
+                  RenderTableRow {TR} at (0,0) size 53x22
+                    RenderTableCell {TH} at (0,0) size 53x22 [border: (1px solid #D3D3D3)] [r=0 c=0 rs=1 cs=1]
+                      RenderText {#text} at (2,2) size 50x18
+                        text run at (2,2) width 50: "Header"
diff --git a/LayoutTests/fast/table/border-collapsing/border-collapsing-head-foot.html b/LayoutTests/fast/table/border-collapsing/border-collapsing-head-foot.html
new file mode 100644 (file)
index 0000000..b45616b
--- /dev/null
@@ -0,0 +1,302 @@
+<html>
+<head>
+    <title></title>
+    <style type="text/css">
+    
+        .test table { border-collapse: collapse; margin: 10px; }
+        .test td, th { border: 1px lightgray solid; }
+        
+        .example1 tfoot { border-top: 2px solid blue;
+            border-bottom: 2px solid green;
+        }
+
+        .example2 thead { border-top: 2px solid blue;
+            border-bottom: 2px solid green;
+        }
+    </style>
+</head>
+<body>
+    <p>
+        Test for <i><a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=8848">http://bugzilla.opendarwin.org/show_bug.cgi?id=8848</a>
+        TFOOT borders are copied to THEAD and TBODY</i>.
+    </p>
+    <hr>
+    <table><tr><td class="test">
+        <table class="example1">
+            <thead>
+                <tr>
+                    <th>Header</th>
+                </tr>
+            </thead>
+            <tbody>
+                <tr>
+                    <td>Body 1</td>
+                </tr>
+            </tbody>
+            <tbody>
+                <tr>
+                    <td>Body 2</td>
+                </tr>
+            </tbody>
+            <tfoot>
+                <tr>
+                    <td>Footer</td>
+                </tr>
+            </tfoot>
+        </table>
+    
+        <table class="example1">
+            <tbody>
+                <tr>
+                    <td>Body 1</td>
+                </tr>
+            </tbody>
+            <thead>
+                <tr>
+                    <th>Header</th>
+                </tr>
+            </thead>
+            <tbody>
+                <tr>
+                    <td>Body 2</td>
+                </tr>
+            </tbody>
+            <tfoot>
+                <tr>
+                    <td>Footer</td>
+                </tr>
+            </tfoot>
+        </table>
+    
+        <table class="example1">
+            <tbody>
+                <tr>
+                    <td>Body 1</td>
+                </tr>
+            </tbody>
+            <thead>
+                <tr>
+                    <th>Header</th>
+                </tr>
+            </thead>
+            <tfoot>
+                <tr>
+                    <td>Footer</td>
+                </tr>
+            </tfoot>
+            <tbody>
+                <tr>
+                    <td>Body 2</td>
+                </tr>
+            </tbody>
+        </table>
+    </td><td class="test">
+        <table class="example1">
+            <tbody>
+                <tr>
+                    <td>Body 1</td>
+                </tr>
+            </tbody>
+            <tfoot>
+                <tr>
+                    <td>Footer</td>
+                </tr>
+            </tfoot>
+            <thead>
+                <tr>
+                    <th>Header</th>
+                </tr>
+            </thead>
+            <tbody>
+                <tr>
+                    <td>Body 2</td>
+                </tr>
+            </tbody>
+        </table>
+    
+        <table class="example1">
+            <tfoot>
+                <tr>
+                    <td>Footer</td>
+                </tr>
+            </tfoot>
+            <tbody>
+                <tr>
+                    <td>Body 1</td>
+                </tr>
+            </tbody>
+            <thead>
+                <tr>
+                    <th>Header</th>
+                </tr>
+            </thead>
+            <tbody>
+                <tr>
+                    <td>Body 2</td>
+                </tr>
+            </tbody>
+        </table>
+    
+        <table class="example1">
+            <tbody>
+                <tr>
+                    <td>Body 1</td>
+                </tr>
+            </tbody>
+            <tbody>
+                <tr>
+                    <td>Body 2</td>
+                </tr>
+            </tbody>
+            <tfoot>
+                <tr>
+                    <td>Footer</td>
+                </tr>
+            </tfoot>
+            <thead>
+                <tr>
+                    <th>Header</th>
+                </tr>
+            </thead>
+        </table>
+    </td>
+    <td class="test">
+        <table class="example2">
+            <thead>
+                <tr>
+                    <th>Header</th>
+                </tr>
+            </thead>
+            <tbody>
+                <tr>
+                    <td>Body 1</td>
+                </tr>
+            </tbody>
+            <tbody>
+                <tr>
+                    <td>Body 2</td>
+                </tr>
+            </tbody>
+            <tfoot>
+                <tr>
+                    <td>Footer</td>
+                </tr>
+            </tfoot>
+        </table>
+    
+        <table class="example2">
+            <tbody>
+                <tr>
+                    <td>Body 1</td>
+                </tr>
+            </tbody>
+            <thead>
+                <tr>
+                    <th>Header</th>
+                </tr>
+            </thead>
+            <tbody>
+                <tr>
+                    <td>Body 2</td>
+                </tr>
+            </tbody>
+            <tfoot>
+                <tr>
+                    <td>Footer</td>
+                </tr>
+            </tfoot>
+        </table>
+    
+        <table class="example2">
+            <tbody>
+                <tr>
+                    <td>Body 1</td>
+                </tr>
+            </tbody>
+            <thead>
+                <tr>
+                    <th>Header</th>
+                </tr>
+            </thead>
+            <tfoot>
+                <tr>
+                    <td>Footer</td>
+                </tr>
+            </tfoot>
+            <tbody>
+                <tr>
+                    <td>Body 2</td>
+                </tr>
+            </tbody>
+        </table>
+    </td><td class="test">
+        <table class="example2">
+            <tbody>
+                <tr>
+                    <td>Body 1</td>
+                </tr>
+            </tbody>
+            <tfoot>
+                <tr>
+                    <td>Footer</td>
+                </tr>
+            </tfoot>
+            <thead>
+                <tr>
+                    <th>Header</th>
+                </tr>
+            </thead>
+            <tbody>
+                <tr>
+                    <td>Body 2</td>
+                </tr>
+            </tbody>
+        </table>
+    
+        <table class="example2">
+            <tfoot>
+                <tr>
+                    <td>Footer</td>
+                </tr>
+            </tfoot>
+            <tbody>
+                <tr>
+                    <td>Body 1</td>
+                </tr>
+            </tbody>
+            <thead>
+                <tr>
+                    <th>Header</th>
+                </tr>
+            </thead>
+            <tbody>
+                <tr>
+                    <td>Body 2</td>
+                </tr>
+            </tbody>
+        </table>
+    
+        <table class="example2">
+            <tbody>
+                <tr>
+                    <td>Body 1</td>
+                </tr>
+            </tbody>
+            <tbody>
+                <tr>
+                    <td>Body 2</td>
+                </tr>
+            </tbody>
+            <tfoot>
+                <tr>
+                    <td>Footer</td>
+                </tr>
+            </tfoot>
+            <thead>
+                <tr>
+                    <th>Header</th>
+                </tr>
+            </thead>
+        </table>
+    </td></tr></table>
+</body>
index cd359a425a299620b4a499047ba71c48ec4bbc7e..564d739622705d5bdbb183f39d9d2301f0a4a365 100644 (file)
@@ -1,3 +1,22 @@
+2006-05-25  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by hyatt.  Landed by eseidel.
+
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8848
+          TFOOT borders are copied to THEAD and TBODY
+
+        Test: fast/table/border-collapsing/border-collapsing-head-foot.html
+
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::sectionAbove): Added.
+        (WebCore::RenderTable::sectionBelow): Added.
+        (WebCore::RenderTable::cellAbove): Changed to call sectionAbove.
+        (WebCore::RenderTable::cellBelow): Changed to call sectionBelow.
+        * rendering/RenderTable.h:
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::collapsedTopBorder): Changed to call sectionAbove.
+        (WebCore::RenderTableCell::collapsedBottomBorder): Changed to call sectionBelow.
+
 2006-05-25  Mitz Pettel  <opendarwin.org@mitzpettel.com>
 
         Reviewed by hyatt.  Landed by eseidel.
index 0baedbf8ad0c55ff666cc0fe2f0b53756c59f75e..3bce4942ed70fd59d5ff6c71af3afbfa251f5f5d 100644 (file)
@@ -891,33 +891,54 @@ int RenderTable::outerBorderRight() const
     return borderWidth;
 }
 
+RenderTableSection* RenderTable::sectionAbove(const RenderTableSection* section, bool skipEmptySections) const
+{
+    if (section == head)
+        return 0;
+    RenderObject *prevSection = (section == foot ? lastChild() : section)->previousSibling();
+    while (prevSection) {
+        if (prevSection->isTableSection() && prevSection != head && prevSection != foot && (!skipEmptySections || static_cast<RenderTableSection*>(prevSection)->numRows()))
+            break;
+        prevSection = prevSection->previousSibling();
+    }
+    if (!prevSection && head && (!skipEmptySections || head->numRows()))
+        prevSection = head;
+    return static_cast<RenderTableSection*>(prevSection);
+}
+
+RenderTableSection* RenderTable::sectionBelow(const RenderTableSection* section, bool skipEmptySections) const
+{
+    if (section == foot)
+        return 0;
+    RenderObject *nextSection = (section == head ? firstChild() : section)->nextSibling();
+    while (nextSection) {
+        if (nextSection->isTableSection() && nextSection != head && nextSection != foot && (!skipEmptySections || static_cast<RenderTableSection*>(nextSection)->numRows()))
+            break;
+        nextSection = nextSection->nextSibling();
+    }
+    if (!nextSection && foot && (!skipEmptySections || foot->numRows()))
+        nextSection = foot;
+    return static_cast<RenderTableSection*>(nextSection);
+}
+
 RenderTableCell* RenderTable::cellAbove(const RenderTableCell* cell) const
 {
     // Find the section and row to look in
     int r = cell->row();
     RenderTableSection* section = 0;
-    int rAbove = -1;
+    int rAbove = 0;
     if (r > 0) {
         // cell is not in the first row, so use the above row in its own section
         section = cell->section();
         rAbove = r-1;
     } else {
-        if (cell->section() == head)
-            return 0;
-        // cell is at top of a section, use last row in previous section
-        for (RenderObject *prevSection = cell->section()->previousSibling();
-             prevSection && rAbove < 0;
-             prevSection = prevSection->previousSibling()) {
-            if (prevSection->isTableSection()) {
-                section = static_cast<RenderTableSection *>(prevSection);
-                if (section->numRows() > 0)
-                    rAbove = section->numRows()-1;
-            }
-        }
+        section = sectionAbove(cell->section(), true);
+        if (section)
+            rAbove = section->numRows() - 1;
     }
 
     // Look up the cell in the section's grid, which requires effective col index
-    if (section && rAbove >= 0) {
+    if (section) {
         int effCol = colToEffCol(cell->col());
         RenderTableSection::CellStruct aboveCell;
         // If we hit a span back up to a real cell.
@@ -935,28 +956,19 @@ RenderTableCell* RenderTable::cellBelow(const RenderTableCell* cell) const
     // Find the section and row to look in
     int r = cell->row() + cell->rowSpan() - 1;
     RenderTableSection* section = 0;
-    int rBelow = -1;
+    int rBelow = 0;
     if (r < cell->section()->numRows() - 1) {
         // The cell is not in the last row, so use the next row in the section.
         section = cell->section();
         rBelow= r+1;
     } else {
-        if (cell->section() == foot)
-            return 0;
-        // The cell is at the bottom of a section. Use the first row in the next section.
-        for (RenderObject* nextSection = cell->section()->nextSibling();
-             nextSection && rBelow < 0;
-             nextSection = nextSection->nextSibling()) {
-            if (nextSection->isTableSection()) {
-                section = static_cast<RenderTableSection *>(nextSection);
-                if (section->numRows() > 0)
-                    rBelow = 0;
-            }
-        }
+        section = sectionBelow(cell->section(), true);
+        if (section)
+            rBelow = 0;
     }
-    
+
     // Look up the cell in the section's grid, which requires effective col index
-    if (section && rBelow >= 0) {
+    if (section) {
         int effCol = colToEffCol(cell->col());
         RenderTableSection::CellStruct belowCell;
         // If we hit a colspan back up to a real cell.
index bb49d5efe2f6b4d8fde17f5d0cc201bc11b73af7..73ad5b495afeab843b69ae59e408ec8e011cf12e 100644 (file)
@@ -159,6 +159,9 @@ public:
 
     virtual RenderObject* removeChildNode(RenderObject*);
 
+    RenderTableSection* sectionAbove(const RenderTableSection*, bool skipEmptySections = false) const;
+    RenderTableSection* sectionBelow(const RenderTableSection*, bool skipEmptySections = false) const;
+
     RenderTableCell* cellAbove(const RenderTableCell*) const;
     RenderTableCell* cellBelow(const RenderTableCell*) const;
     RenderTableCell* cellBefore(const RenderTableCell*) const;
index 32b0cb65c67df87adb1f2f527f21823492cc7f8a..e3273a045144afce9af5745a48064b3f5cebfa9b 100644 (file)
@@ -380,7 +380,7 @@ CollapsedBorderValue RenderTableCell::collapsedTopBorder() const
     }
     
     // Now check row groups.
-    RenderObject* currSection = parent()->parent();
+    RenderTableSection* currSection = section();
     if (row() == 0) {
         // (5) Our row group's top border.
         result = compareBorders(result, CollapsedBorderValue(&currSection->style()->borderTop(), BROWGROUP));
@@ -388,14 +388,11 @@ CollapsedBorderValue RenderTableCell::collapsedTopBorder() const
             return result;
         
         // (6) Previous row group's bottom border.
-        for (currSection = currSection->previousSibling(); currSection;
-             currSection = currSection->previousSibling()) {
-            if (currSection->isTableSection()) {
-                RenderTableSection* section = static_cast<RenderTableSection*>(currSection);
-                result = compareBorders(result, CollapsedBorderValue(&section->style()->borderBottom(), BROWGROUP));
-                if (!result.exists())
-                    return result;
-            }
+        currSection = table()->sectionAbove(currSection);
+        if (currSection) {
+            result = compareBorders(result, CollapsedBorderValue(&currSection->style()->borderBottom(), BROWGROUP));
+            if (!result.exists())
+                return result;
         }
     }
     
@@ -444,7 +441,7 @@ CollapsedBorderValue RenderTableCell::collapsedBottomBorder() const
     }
     
     // Now check row groups.
-    RenderObject* currSection = parent()->parent();
+    RenderTableSection* currSection = section();
     if (row() + rowSpan() >= static_cast<RenderTableSection*>(currSection)->numRows()) {
         // (5) Our row group's bottom border.
         result = compareBorders(result, CollapsedBorderValue(&currSection->style()->borderBottom(), BROWGROUP));
@@ -452,14 +449,11 @@ CollapsedBorderValue RenderTableCell::collapsedBottomBorder() const
             return result;
         
         // (6) Following row group's top border.
-        for (currSection = currSection->nextSibling(); currSection;
-             currSection = currSection->nextSibling()) {
-            if (currSection->isTableSection()) {
-                RenderTableSection* section = static_cast<RenderTableSection*>(currSection);
-                result = compareBorders(result, CollapsedBorderValue(&section->style()->borderTop(), BROWGROUP));
-                if (!result.exists())
-                    return result;
-            }
+        currSection = table()->sectionBelow(currSection);
+        if (currSection) {
+            result = compareBorders(result, CollapsedBorderValue(&currSection->style()->borderTop(), BROWGROUP));
+            if (!result.exists())
+                return result;
         }
     }