Changeset 71382 in webkit
- Timestamp:
- Nov 4, 2010, 7:43:17 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 60 added
- 9 edited
- 20 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r71377 r71382 1 2010-11-04 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 Make tables work with vertical text 6 https://bugs.webkit.org/show_bug.cgi?id=46417 7 8 * fast/table/027-vertical.html: Copied from LayoutTests/fast/table/027.html. 9 * fast/table/028-vertical.html: Copied from LayoutTests/fast/table/028.html. 10 * fast/table/035-vertical.html: Copied from LayoutTests/fast/table/035.html. 11 * fast/table/038-vertical.html: Copied from LayoutTests/fast/table/038.html. 12 * fast/table/040-vertical.html: Copied from LayoutTests/fast/table/040.html. 13 * fast/table/auto-with-percent-height-vertical.html: Copied from LayoutTests/fast/table/auto-with-percent-height.html. 14 * fast/table/border-collapsing/001-vertical.html: Copied from LayoutTests/fast/table/border-collapsing/001.html. 15 * fast/table/border-collapsing/002-vertical.html: Copied from LayoutTests/fast/table/border-collapsing/002.html. 16 * fast/table/border-collapsing/003-vertical.html: Copied from LayoutTests/fast/table/border-collapsing/003.html. 17 * fast/table/border-collapsing/004-vertical.html: Copied from LayoutTests/fast/table/border-collapsing/004.html. 18 * fast/table/border-collapsing/border-collapsing-head-foot-vertical.html: Copied from LayoutTests/fast/table/border-collapsing/border-collapsing-head-foot.html. 19 * fast/table/border-collapsing/equal-precedence-resolution-vertical.html: Copied from LayoutTests/fast/table/border-collapsing/equal-precedence-resolution.html. 20 * fast/table/border-collapsing/rtl-border-collapsing-vertical.html: Copied from LayoutTests/fast/table/border-collapsing/rtl-border-collapsing.html. 21 * fast/table/colspanMinWidth-vertical.html: Copied from LayoutTests/fast/table/colspanMinWidth.html. 22 * fast/table/fixed-with-auto-with-colspan-vertical.html: Copied from LayoutTests/fast/table/fixed-with-auto-with-colspan.html. 23 * fast/table/growCellForImageQuirk-vertical.html: Copied from LayoutTests/fast/table/growCellForImageQuirk.html. 24 * fast/table/height-percent-test-vertical.html: Copied from LayoutTests/fast/table/height-percent-test.html. 25 * fast/table/percent-widths-stretch-vertical.html: Copied from LayoutTests/fast/table/percent-widths-stretch.html. 26 * fast/table/rowspan-paint-order-vertical.html: Copied from LayoutTests/fast/table/rowspan-paint-order.html. 27 * fast/table/table-display-types-vertical.html: Copied from LayoutTests/fast/table/table-display-types.html. 28 * platform/mac/fast/table/027-vertical-expected.checksum: Added. 29 * platform/mac/fast/table/027-vertical-expected.png: Added. 30 * platform/mac/fast/table/027-vertical-expected.txt: Added. 31 * platform/mac/fast/table/028-vertical-expected.checksum: Added. 32 * platform/mac/fast/table/028-vertical-expected.png: Added. 33 * platform/mac/fast/table/028-vertical-expected.txt: Added. 34 * platform/mac/fast/table/035-vertical-expected.checksum: Added. 35 * platform/mac/fast/table/035-vertical-expected.png: Added. 36 * platform/mac/fast/table/035-vertical-expected.txt: Added. 37 * platform/mac/fast/table/038-vertical-expected.checksum: Added. 38 * platform/mac/fast/table/038-vertical-expected.png: Added. 39 * platform/mac/fast/table/038-vertical-expected.txt: Added. 40 * platform/mac/fast/table/040-vertical-expected.checksum: Added. 41 * platform/mac/fast/table/040-vertical-expected.png: Added. 42 * platform/mac/fast/table/040-vertical-expected.txt: Added. 43 * platform/mac/fast/table/auto-with-percent-height-vertical-expected.checksum: Added. 44 * platform/mac/fast/table/auto-with-percent-height-vertical-expected.png: Added. 45 * platform/mac/fast/table/auto-with-percent-height-vertical-expected.txt: Added. 46 * platform/mac/fast/table/border-collapsing/001-vertical-expected.checksum: Added. 47 * platform/mac/fast/table/border-collapsing/001-vertical-expected.png: Added. 48 * platform/mac/fast/table/border-collapsing/001-vertical-expected.txt: Added. 49 * platform/mac/fast/table/border-collapsing/002-vertical-expected.checksum: Added. 50 * platform/mac/fast/table/border-collapsing/002-vertical-expected.png: Added. 51 * platform/mac/fast/table/border-collapsing/002-vertical-expected.txt: Added. 52 * platform/mac/fast/table/border-collapsing/003-vertical-expected.checksum: Added. 53 * platform/mac/fast/table/border-collapsing/003-vertical-expected.png: Added. 54 * platform/mac/fast/table/border-collapsing/003-vertical-expected.txt: Added. 55 * platform/mac/fast/table/border-collapsing/004-vertical-expected.checksum: Added. 56 * platform/mac/fast/table/border-collapsing/004-vertical-expected.png: Added. 57 * platform/mac/fast/table/border-collapsing/004-vertical-expected.txt: Added. 58 * platform/mac/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.checksum: Added. 59 * platform/mac/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.png: Added. 60 * platform/mac/fast/table/border-collapsing/border-collapsing-head-foot-vertical-expected.txt: Added. 61 * platform/mac/fast/table/border-collapsing/equal-precedence-resolution-vertical-expected.checksum: Added. 62 * platform/mac/fast/table/border-collapsing/equal-precedence-resolution-vertical-expected.png: Added. 63 * platform/mac/fast/table/border-collapsing/equal-precedence-resolution-vertical-expected.txt: Added. 64 * platform/mac/fast/table/border-collapsing/rtl-border-collapsing-vertical-expected.checksum: Added. 65 * platform/mac/fast/table/border-collapsing/rtl-border-collapsing-vertical-expected.png: Added. 66 * platform/mac/fast/table/border-collapsing/rtl-border-collapsing-vertical-expected.txt: Added. 67 * platform/mac/fast/table/colspanMinWidth-vertical-expected.checksum: Added. 68 * platform/mac/fast/table/colspanMinWidth-vertical-expected.png: Added. 69 * platform/mac/fast/table/colspanMinWidth-vertical-expected.txt: Added. 70 * platform/mac/fast/table/fixed-with-auto-with-colspan-vertical-expected.checksum: Added. 71 * platform/mac/fast/table/fixed-with-auto-with-colspan-vertical-expected.png: Added. 72 * platform/mac/fast/table/fixed-with-auto-with-colspan-vertical-expected.txt: Added. 73 * platform/mac/fast/table/growCellForImageQuirk-vertical-expected.checksum: Added. 74 * platform/mac/fast/table/growCellForImageQuirk-vertical-expected.png: Added. 75 * platform/mac/fast/table/growCellForImageQuirk-vertical-expected.txt: Added. 76 * platform/mac/fast/table/height-percent-test-vertical-expected.checksum: Added. 77 * platform/mac/fast/table/height-percent-test-vertical-expected.png: Added. 78 * platform/mac/fast/table/height-percent-test-vertical-expected.txt: Added. 79 * platform/mac/fast/table/percent-widths-stretch-vertical-expected.checksum: Added. 80 * platform/mac/fast/table/percent-widths-stretch-vertical-expected.png: Added. 81 * platform/mac/fast/table/percent-widths-stretch-vertical-expected.txt: Added. 82 * platform/mac/fast/table/rowspan-paint-order-vertical-expected.checksum: Added. 83 * platform/mac/fast/table/rowspan-paint-order-vertical-expected.png: Added. 84 * platform/mac/fast/table/rowspan-paint-order-vertical-expected.txt: Added. 85 * platform/mac/fast/table/table-display-types-vertical-expected.checksum: Added. 86 * platform/mac/fast/table/table-display-types-vertical-expected.png: Added. 87 * platform/mac/fast/table/table-display-types-vertical-expected.txt: Added. 88 1 89 2010-11-04 MORITA Hajime <morrita@google.com> 2 90 -
trunk/LayoutTests/fast/table/027-vertical.html
r71380 r71382 6 6 </head> 7 7 <body> 8 <table width=100% cellspacing=0 cellpadding=3 border=0>8 <table height=100% cellspacing=0 cellpadding=3 border=0 style="-webkit-writing-mode: vertical-rl;"> 9 9 <tr> 10 11 12 13 14 15 16 17 10 <td colspan=3 nowrap> 11 Join Now Sign In 12 13 Personalize: <a>Settings</a> • <a>Content</a> • <a>Layout</a> • <a>Colors & Themes</a> • <a>Sign In</a> 14 15 My Links: 16 Lite • Email 17 </td> 18 18 </tr> 19 19 <tr> 20 <td width=28%></td>21 <td width=44%>22 <table width=100%>23 24 25 26 27 <td width=50%>28 29 20 <td height=28%></td> 21 <td height=44%> 22 <table height=100%> 23 <tr> 24 <td> 25 <table> 26 <tr> 27 <td height=50%> 28 </td> 29 <td> 30 30 This guy should have the really big maxwidth. It 31 31 should be big enough to really really screw things up. 32 32 That is what I think will work. 33 34 <td width=50%>35 36 37 38 39 40 41 42 43 <td width=28%>44 <img width=212 height=18>45 46 33 </td> 34 <td height=50%> 35 </td> 36 </tr> 37 </table> 38 </td> 39 </tr> 40 </table> 41 42 </td> 43 <td height=28%> 44 <img height=212 width=18> 45 46 </td> 47 47 </tr> 48 48 </table> -
trunk/LayoutTests/fast/table/028-vertical.html
r71380 r71382 7 7 </head> 8 8 <body> 9 These two tables should be the same width.10 11 <table border=0 cellspacing=0 cellpadding=0 width=320>12 13 <td width=70 valign=top >14 15 16 <td width=246 valign=top >9 These two tables should be the same height. 10 <div style="-webkit-writing-mode: vertical-rl;"> 11 <table border=0 cellspacing=0 cellpadding=0 height=320> 12 <tr> 13 <td height=70 valign=top > 14 1 15 </td> 16 <td height=246 valign=top > 17 17 2 18 18 19 19 20 21 <td width=4><img width=4 height=20></td>22 23 24 25 26 <table border=0 cellspacing=0 cellpadding=0 width=320 height=10>27 28 <td width=66 height=10>1</td>29 <td width=254 height=10><img width=254 height=10 ></td>30 31 32 33 34 35 20 </td> 21 <td height=4><img height=4 width=20></td> 22 </tr> 23 </table> 24 <p></p> 25 26 <table border=0 cellspacing=0 cellpadding=0 height=320 width=10> 27 <tr> 28 <td height=66 width=10>1</td> 29 <td height=254 width=10><img height=254 width=10 ></td> 30 </tr> 31 <tr> 32 <td colspan=3>1</td> 33 </tr> 34 </table> 35 36 36 37 37 … … 40 40 41 41 42 42 </div> -
trunk/LayoutTests/fast/table/035-vertical.html
r71380 r71382 1 1 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" 2 2 "http://www.w3.org/TR/html4/loose.dtd"> 3 <html><body >3 <html><body style="-webkit-writing-mode: vertical-rl;"> 4 4 5 5 This test should have two centered tables and two centered divs. -
trunk/LayoutTests/fast/table/038-vertical.html
r71380 r71382 2 2 much width as possible, while column 1 should be tiny. 3 3 4 <table border=2 width=100%>4 <table border=2 height=100% style="-webkit-writing-mode: vertical-rl;"> 5 5 <tr> 6 6 <td>1<td colspan=2>2-3 … … 8 8 <tr> 9 9 <td>1</td> 10 <td colspan=2 width=100%>2-3</td>10 <td colspan=2 height=100%>2-3</td> 11 11 </tr> 12 12 </table> -
trunk/LayoutTests/fast/table/040-vertical.html
r71380 r71382 19 19 20 20 td { 21 height: 20px;21 width: 20px; 22 22 } 23 23 24 table { 25 -webkit-writing-mode: vertical-rl; 26 } 24 27 </style> 25 28 26 29 <script> 27 function dump Widths(table)30 function dumpHeights(table) 28 31 { 29 32 var cell1 = document.getElementById(table + "-one"); 30 33 var cell2 = document.getElementById(table + "-two"); 31 34 document.write("<p>"); 32 document.write("The table width is: " + document.getElementById(table).offsetWidth+ "<br>");33 document.write("Column One is: " + Math.round(100*cell1.offset Width/(cell1.offsetWidth+cell2.offsetWidth)) + "%");35 document.write("The table height is: " + document.getElementById(table).offsetHeight + "<br>"); 36 document.write("Column One is: " + Math.round(100*cell1.offsetHeight/(cell1.offsetHeight+cell2.offsetHeight)) + "%"); 34 37 document.write("<br>"); 35 document.write("Column Two is: " + Math.round(100*cell2.offset Width/(cell1.offsetWidth+cell2.offsetWidth)) + "%");38 document.write("Column Two is: " + Math.round(100*cell2.offsetHeight/(cell1.offsetHeight+cell2.offsetHeight)) + "%"); 36 39 document.write("</p><hr>"); 37 40 } … … 39 42 </head> 40 43 41 <h1>Fixed Columns, Auto Span, Min widthTable</h1>44 <h1>Fixed Columns, Auto Span, Minheight Table</h1> 42 45 43 <table width="1" id="one" cellpadding=0 cellspacing=0>46 <table height="1" id="one" cellpadding=0 cellspacing=0> 44 47 <tr> 45 <td width=100 id="one-one" class="one">46 <td width=200 id="one-two" class="two">48 <td height=100 id="one-one" class="one"> 49 <td height=200 id="one-two" class="two"> 47 50 </tr> 48 51 <tr> 49 52 <td colspan=2 class="span"> 50 <div style=" width:100px"></div>53 <div style="height:100px"></div> 51 54 </td> 52 55 </tr> … … 54 57 55 58 <script> 56 dump Widths("one");59 dumpHeights("one"); 57 60 </script> 58 61 59 <table width="1" id="two" cellpadding=0 cellspacing=0>62 <table height="1" id="two" cellpadding=0 cellspacing=0> 60 63 <tr> 61 <td width=100 id="two-one" class="one">62 <td width=200 id="two-two" class="two">64 <td height=100 id="two-one" class="one"> 65 <td height=200 id="two-two" class="two"> 63 66 </tr> 64 67 <tr> 65 68 <td colspan=2 class="span"> 66 <div style=" width:600px"></div>69 <div style="height:600px"></div> 67 70 </td> 68 71 </tr> … … 70 73 71 74 <script> 72 dump Widths("two");75 dumpHeights("two"); 73 76 </script> 74 77 75 <table width="1" id="three" cellpadding=0 cellspacing=0>78 <table height="1" id="three" cellpadding=0 cellspacing=0> 76 79 <tr> 77 <td width=100 id="three-one" class="one">Fixed cell in column one with some text.78 <td width=200 id="three-two" class="two">Fixed cell in column two with a lot more text. Will the ratios be preserved?80 <td height=100 id="three-one" class="one">Fixed cell in column one with some text. 81 <td height=200 id="three-two" class="two">Fixed cell in column two with a lot more text. Will the ratios be preserved? 79 82 </tr> 80 83 <tr> 81 84 <td colspan=2 class="span"> 82 <div style=" width:600px"></div>85 <div style="height:600px"></div> 83 86 </td> 84 87 </tr> … … 86 89 87 90 <script> 88 dump Widths("three");91 dumpHeights("three"); 89 92 </script> 90 93 91 <table width="1" id="four" cellpadding=0 cellspacing=0>94 <table height="1" id="four" cellpadding=0 cellspacing=0> 92 95 <tr> 93 <td width=50 id="four-one" class="one"><div style="width:100px"></div>94 <td width=100 id="four-two" class="two"><div style="width:250px"></div>96 <td height=50 id="four-one" class="one"><div style="height:100px"></div> 97 <td height=100 id="four-two" class="two"><div style="height:250px"></div> 95 98 </tr> 96 99 <tr> 97 100 <td colspan=2 class="span"> 98 <div style=" width:600px"></div>101 <div style="height:600px"></div> 99 102 </td> 100 103 </tr> … … 102 105 103 106 <script> 104 dump Widths("four");107 dumpHeights("four"); 105 108 </script> -
trunk/LayoutTests/fast/table/auto-with-percent-height-vertical.html
r71380 r71382 6 6 background-color: purple; 7 7 color: white; 8 height: 100%;8 width: 100%; 9 9 } 10 10 … … 12 12 border: 3px solid red; 13 13 margin: 1em; 14 -webkit-writing-mode: vertical-rl; 14 15 } 15 16 </style> -
trunk/LayoutTests/fast/table/border-collapsing/001-vertical.html
r71380 r71382 1 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> 2 2 3 <html >4 <div style="border:10px dotted blue ">3 <html style="-webkit-writing-mode: vertical-rl;"> 4 <div style="border:10px dotted blue;"> 5 5 <table style="border-collapse:collapse; border:2px solid red"> 6 <tr><td width=300 style="border:10px solid green">Hello6 <tr><td height=300 style="border:10px solid green">Hello 7 7 <tr><td style="border:30px solid blue">Goodbye 8 8 <tr><td style="border:50px solid red">Goodbye … … 11 11 12 12 13 <div style="border:1px solid green; margin-top:10em">13 <div style="border:1px solid green; -webkit-margin-before:10em;"> 14 14 <table style="border-collapse:collapse;"><tr><td style="border:2px solid black">Test</td></tr></table> 15 15 </div> -
trunk/LayoutTests/fast/table/border-collapsing/002-vertical.html
r71380 r71382 4 4 table { border-collapse: collapse; 5 5 border: 5px solid yellow; } 6 *#col1 { border: 3px solid black; }6 .col1 { border: 3px solid black; } 7 7 td { border: 1px solid red; padding: 1em; } 8 8 td.solid-blue { border: 5px dashed blue; } … … 12 12 <body> 13 13 <P> 14 <TABLE >15 <COL id="col1"><COL id="col2"><COL id="col3">16 <TR id="row1">14 <TABLE style="-webkit-writing-mode: vertical-rl;"> 15 <COL class="col1"><COL><COL> 16 <TR> 17 17 <TD> 1 18 18 <TD> 2 19 19 <TD> 3 20 20 </TR> 21 <TR id="row2">21 <TR> 22 22 <TD> 4 23 23 <TD class="solid-blue"> 5 24 24 <TD class="solid-green"> 6 25 25 </TR> 26 <TR id="row3">26 <TR> 27 27 <TD> 7 28 28 <TD> 8 29 29 <TD> 9 30 30 </TR> 31 <TR id="row4">31 <TR> 32 32 <TD> 10 33 33 <TD> 11 34 34 <TD> 12 35 35 </TR> 36 <TR id="row5"> 36 <TR> 37 <TD> 13 38 <TD> 14 39 <TD> 15 40 </TR> 41 </table> 42 <TABLE style="-webkit-writing-mode: vertical-lr;"> 43 <COL class="col1"><COL><COL> 44 <TR> 45 <TD> 1 46 <TD> 2 47 <TD> 3 48 </TR> 49 <TR> 50 <TD> 4 51 <TD class="solid-blue"> 5 52 <TD class="solid-green"> 6 53 </TR> 54 <TR> 55 <TD> 7 56 <TD> 8 57 <TD> 9 58 </TR> 59 <TR> 60 <TD> 10 61 <TD> 11 62 <TD> 12 63 </TR> 64 <TR> 65 <TD> 13 66 <TD> 14 67 <TD> 15 68 </TR> 69 </table> 70 <TABLE style="-webkit-writing-mode: horizontal-bt;"> 71 <COL class="col1"><COL><COL> 72 <TR> 73 <TD> 1 74 <TD> 2 75 <TD> 3 76 </TR> 77 <TR> 78 <TD> 4 79 <TD class="solid-blue"> 5 80 <TD class="solid-green"> 6 81 </TR> 82 <TR> 83 <TD> 7 84 <TD> 8 85 <TD> 9 86 </TR> 87 <TR> 88 <TD> 10 89 <TD> 11 90 <TD> 12 91 </TR> 92 <TR> 37 93 <TD> 13 38 94 <TD> 14 -
trunk/LayoutTests/fast/table/border-collapsing/003-vertical.html
r71380 r71382 4 4 <title>Border Collapsing Test</title> 5 5 <style type="text/css"> 6 .b { border: solid thin blue; padding : 0 0 3em 0; margin: 2em; }6 .b { border: solid thin blue; padding-left: 3em; margin: 2em; } 7 7 .t { display: table; border-collapse: collapse; } 8 8 .r { display: table-row; } … … 11 11 </style> 12 12 </head> 13 <body >13 <body style="-webkit-writing-mode: vertical-rl;"> 14 14 <p>The black border below should <i>not</i> cut through the top left corner of 15 15 the blue border. It would cut through with our old behavior, but -
trunk/LayoutTests/fast/table/border-collapsing/004-vertical.html
r71380 r71382 3 3 <title>Table Border Models</title> 4 4 <style type="text/css"> 5 TABLE 6 TD 5 TABLE { margin: 1em; width: auto; border: medium solid blue; } 6 TD { border: thin solid green; padding: 5px; } 7 7 TH { border: medium solid purple; padding: 5px; } 8 8 TABLE.one, TABLE.two { border-spacing: 1em; } … … 14 14 TABLE.five, TABLE.five TD, TABLE.five TH, TABLE.five CAPTION { border: none; } 15 15 TABLE.five TR, TABLE.five COL, TABLE.five COLGROUP, TABLE.five TBODY, TABLE.five THEAD 16 16 { border: medium solid red; } 17 17 </style> 18 18 </head> … … 25 25 26 26 <pre> 27 TABLE 28 TD 27 TABLE { margin: 1em; border: medium solid blue; } 28 TD { border: thin solid green; padding: 5px; } 29 29 TH { border: medium solid purple; padding: 5px; } 30 30 TABLE.one, TABLE.two { border-spacing: 1em; } … … 36 36 TABLE.five, TABLE.five TD, TABLE.five TH { border: none; } 37 37 TABLE.five TR, TABLE.five COL, TABLE.five COLGROUP, TABLE.five TBODY, TABLE.five THEAD 38 38 { border: medium solid red; } 39 39 </pre> 40 40 <div style="-webkit-writing-mode: vertical-rl;"> 41 41 <table class="one"> 42 42 <tr> … … 229 229 </tbody> 230 230 </table> 231 231 </div> 232 232 </body></html> -
trunk/LayoutTests/fast/table/border-collapsing/border-collapsing-head-foot-vertical.html
r71380 r71382 4 4 <style type="text/css"> 5 5 6 .test { width: 100px; } 6 7 .test table { border-collapse: collapse; margin: 10px; } 7 8 .test td, th { border: 1px lightgray solid; } 8 9 9 .example1 tfoot { border-top: 2px solid blue;10 border-bottom: 2px solid green;10 .example1 tfoot { -webkit-border-before: 2px solid blue; 11 -webkit-border-after: 2px solid green; 11 12 } 12 13 13 .example2 thead { border-top: 2px solid blue;14 border-bottom: 2px solid green;14 .example2 thead { -webkit-border-before: 2px solid blue; 15 -webkit-border-after: 2px solid green; 15 16 } 17 18 table table { -webkit-writing-mode: vertical-rl; } 16 19 </style> 17 20 </head> -
trunk/LayoutTests/fast/table/border-collapsing/equal-precedence-resolution-vertical.html
r71380 r71382 3 3 td { width: 25px; height: 25px; } 4 4 </style> 5 <div style="-webkit-writing-mode: vertical-rl; height: 200px; border: solid;"> 5 6 <table> 6 <colgroup span="2"><colgroup span="1" style=" border-right: 5px solid rgba(0, 127, 0, 0.5);"><colgroup span="1" style="border-left: 5px solid red">7 <colgroup span="2"><colgroup span="1" style="-webkit-border-end: 5px solid rgba(0, 127, 0, 0.5);"><colgroup span="1" style="-webkit-border-start: 5px solid red"> 7 8 <tr> 8 <td style=" border-right: 5px solid rgba(0, 127, 0, 0.5); border-bottom: 5px solid rgba(0, 127, 0, 0.5);"></td>9 <td style=" border-left: 5px solid red;"></td>9 <td style="-webkit-border-end: 5px solid rgba(0, 127, 0, 0.5); -webkit-border-after: 5px solid rgba(0, 127, 0, 0.5);"></td> 10 <td style="-webkit-border-start: 5px solid red;"></td> 10 11 <td></td> 11 12 <td></td> 12 13 </tr> 13 14 <tr> 14 <td style=" border-top: 5px solid red;"></td>15 <td style="-webkit-border-before: 5px solid red;"></td> 15 16 <td></td> 16 17 <td></td> … … 19 20 </table> 20 21 <table style="direction: rtl;"> 21 <colgroup span="2"><colgroup span="1" style=" border-left: 5px solid rgba(0, 127, 0, 0.5);"><colgroup span="1" style="border-right: 5px solid red">22 <colgroup span="2"><colgroup span="1" style="-webkit-border-end: 5px solid rgba(0, 127, 0, 0.5);"><colgroup span="1" style="-webkit-border-start: 5px solid red"> 22 23 <tr> 23 <td style=" border-left: 5px solid rgba(0, 127, 0, 0.5); border-bottom: 5px solid rgba(0, 127, 0, 0.5);"></td>24 <td style=" border-right: 5px solid red;"></td>24 <td style="-webkit-border-end: 5px solid rgba(0, 127, 0, 0.5); -webkit-border-after: 5px solid rgba(0, 127, 0, 0.5);"></td> 25 <td style="-webkit-border-start: 5px solid red;"></td> 25 26 <td></td> 26 27 <td></td> 27 28 </tr> 28 29 <tr> 29 <td style=" border-top: 5px solid red;"></td>30 <td style="-webkit-border-before: 5px solid red;"></td> 30 31 <td></td> 31 32 <td></td> … … 34 35 </table> 35 36 <table> 36 <tr style=" border-bottom: 5px solid rgba(0, 127, 0, 0.5);">37 <tr style="-webkit-border-after: 5px solid rgba(0, 127, 0, 0.5);"> 37 38 <td></td> 38 39 </tr> 39 <tr style=" border-top: 5px solid red;">40 <tr style="-webkit-border-before: 5px solid red;"> 40 41 <td></td> 41 42 </tr> 42 43 </table> 43 44 <table> 44 <tbody style=" border-bottom: 5px solid rgba(0, 127, 0, 0.5);">45 <tbody style="-webkit-border-after: 5px solid rgba(0, 127, 0, 0.5);"> 45 46 <tr> 46 47 <td></td> 47 48 </tr> 48 49 </tbody> 49 <tbody style=" border-top: 5px solid red;">50 <tbody style="-webkit-border-before: 5px solid red;"> 50 51 <tr> 51 52 <td></td> … … 53 54 </tbody> 54 55 </table> 56 </div> 57 <div style="-webkit-writing-mode: horizontal-bt; width: 200px; border: solid;"> 58 <table> 59 <colgroup span="2"><colgroup span="1" style="-webkit-border-end: 5px solid rgba(0, 127, 0, 0.5);"><colgroup span="1" style="-webkit-border-start: 5px solid red"> 60 <tr> 61 <td style="-webkit-border-end: 5px solid rgba(0, 127, 0, 0.5); -webkit-border-after: 5px solid rgba(0, 127, 0, 0.5);"></td> 62 <td style="-webkit-border-start: 5px solid red;"></td> 63 <td></td> 64 <td></td> 65 </tr> 66 <tr> 67 <td style="-webkit-border-before: 5px solid red;"></td> 68 <td></td> 69 <td></td> 70 <td></td> 71 </tr> 72 </table> 73 <table style="direction: rtl;"> 74 <colgroup span="2"><colgroup span="1" style="-webkit-border-end: 5px solid rgba(0, 127, 0, 0.5);"><colgroup span="1" style="-webkit-border-start: 5px solid red"> 75 <tr> 76 <td style="-webkit-border-end: 5px solid rgba(0, 127, 0, 0.5); -webkit-border-after: 5px solid rgba(0, 127, 0, 0.5);"></td> 77 <td style="-webkit-border-start: 5px solid red;"></td> 78 <td></td> 79 <td></td> 80 </tr> 81 <tr> 82 <td style="-webkit-border-before: 5px solid red;"></td> 83 <td></td> 84 <td></td> 85 <td></td> 86 </tr> 87 </table> 88 <table> 89 <tr style="-webkit-border-after: 5px solid rgba(0, 127, 0, 0.5);"> 90 <td></td> 91 </tr> 92 <tr style="-webkit-border-before: 5px solid red;"> 93 <td></td> 94 </tr> 95 </table> 96 <table> 97 <tbody style="-webkit-border-after: 5px solid rgba(0, 127, 0, 0.5);"> 98 <tr> 99 <td></td> 100 </tr> 101 </tbody> 102 <tbody style="-webkit-border-before: 5px solid red;"> 103 <tr> 104 <td></td> 105 </tr> 106 </tbody> 107 </table> 108 </div> 109 <div style="-webkit-writing-mode: vertical-lr; height: 200px; border: solid;"> 110 <table> 111 <colgroup span="2"><colgroup span="1" style="-webkit-border-end: 5px solid rgba(0, 127, 0, 0.5);"><colgroup span="1" style="-webkit-border-start: 5px solid red"> 112 <tr> 113 <td style="-webkit-border-end: 5px solid rgba(0, 127, 0, 0.5); -webkit-border-after: 5px solid rgba(0, 127, 0, 0.5);"></td> 114 <td style="-webkit-border-start: 5px solid red;"></td> 115 <td></td> 116 <td></td> 117 </tr> 118 <tr> 119 <td style="-webkit-border-before: 5px solid red;"></td> 120 <td></td> 121 <td></td> 122 <td></td> 123 </tr> 124 </table> 125 <table style="direction: rtl;"> 126 <colgroup span="2"><colgroup span="1" style="-webkit-border-end: 5px solid rgba(0, 127, 0, 0.5);"><colgroup span="1" style="-webkit-border-start: 5px solid red"> 127 <tr> 128 <td style="-webkit-border-end: 5px solid rgba(0, 127, 0, 0.5); -webkit-border-after: 5px solid rgba(0, 127, 0, 0.5);"></td> 129 <td style="-webkit-border-start: 5px solid red;"></td> 130 <td></td> 131 <td></td> 132 </tr> 133 <tr> 134 <td style="-webkit-border-before: 5px solid red;"></td> 135 <td></td> 136 <td></td> 137 <td></td> 138 </tr> 139 </table> 140 <table> 141 <tr style="-webkit-border-after: 5px solid rgba(0, 127, 0, 0.5);"> 142 <td></td> 143 </tr> 144 <tr style="-webkit-border-before: 5px solid red;"> 145 <td></td> 146 </tr> 147 </table> 148 <table> 149 <tbody style="-webkit-border-after: 5px solid rgba(0, 127, 0, 0.5);"> 150 <tr> 151 <td></td> 152 </tr> 153 </tbody> 154 <tbody style="-webkit-border-before: 5px solid red;"> 155 <tr> 156 <td></td> 157 </tr> 158 </tbody> 159 </table> 160 </div> -
trunk/LayoutTests/fast/table/border-collapsing/rtl-border-collapsing-vertical.html
r71380 r71382 8 8 </p> 9 9 <hr> 10 <table cellpadding="4" cellspacing="0" style="text-align: center; ">10 <table cellpadding="4" cellspacing="0" style="text-align: center; -webkit-writing-mode: vertical-rl;"> 11 11 <tr> 12 <td style=" border-right: 1px solid black;">RTL</td>12 <td style="-webkit-border-end: 1px solid black;">RTL</td> 13 13 <td>LTR</td> 14 14 </tr> 15 15 <tr> 16 <td style=" border-right: 1px solid black;">17 <table style="direction:rtl; border-collapse: collapse; border-left: 2px solid red; border-right: 2px solid blue;">16 <td style="-webkit-border-end: 1px solid black;"> 17 <table style="direction:rtl; border-collapse: collapse; -webkit-border-start: 2px solid red; -webkit-border-end: 2px solid blue;"> 18 18 <col> 19 19 <col> 20 <col style="background: yellow; border-right: 2px green dotted; border-left: solid 1px;">20 <col style="background: yellow; -webkit-border-end: 2px green dotted; -webkit-border-start: solid 1px;"> 21 21 <col style="background: silver;"> 22 22 <tr> … … 27 27 </tr> 28 28 <tr> 29 <td style=" border-right: 4px solid maroon;"> </td>29 <td style="-webkit-border-end: 4px solid maroon;"> </td> 30 30 <td> </td> 31 31 <td> </td> … … 36 36 </td> 37 37 <td> 38 <table style="direction:ltr; border-collapse: collapse; border-right: 2px solid red; border-left: 2px solid blue;">38 <table style="direction:ltr; border-collapse: collapse; -webkit-border-start: 2px solid red; -webkit-border-end: 2px solid blue;"> 39 39 <col> 40 40 <col> 41 <col style="background: yellow; border-left: 2px green dotted; border-right: solid 1px;">41 <col style="background: yellow; -webkit-border-end: 2px green dotted; -webkit-border-start: solid 1px;"> 42 42 <col style="background: silver;"> 43 43 <tr> … … 48 48 </tr> 49 49 <tr> 50 <td style=" border-left: 4px solid maroon;"> </td>50 <td style="-webkit-border-end: 4px solid maroon;"> </td> 51 51 <td> </td> 52 52 <td> </td> -
trunk/LayoutTests/fast/table/colspanMinWidth-vertical.html
r71380 r71382 1 1 <html> 2 3 <table>4 5 <td id="A" width='1' style="background:blue"></td>6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 <body> 3 <table style="-webkit-writing-mode: vertical-rl;"> 4 <tr> 5 <td id="A" height='1' style="background:blue"></td> 6 </tr> 7 <tr> 8 <td id="B" colspan='2' rowspan='2' style="background:green"></td> 9 </tr> 10 <tr> 11 <td id="C" rowspan='2' style="background:red"></td> 12 </tr> 13 <tr> 14 <td id="D" colspan='2' style="background:cyan"> 15 <table> 16 <tr> 17 <td id="E" style="background:magenta"></td> 18 <td id="F" style="background:yellow"> 19 <input type='text' /> 20 </td> 21 </tr> 22 </table> 23 </td> 24 </tr> 25 </table> 26 </body> 27 27 </html> -
trunk/LayoutTests/fast/table/fixed-with-auto-with-colspan-vertical.html
r71380 r71382 1 1 <style> 2 table { border-spacing: 5px 0; table-layout: fixed; width: 445px; margin-top: 5px; }3 td { height: 50px; }2 table { border-spacing: 5px 0; table-layout: fixed; height: 445px; -webkit-margin-before: 5px; } 3 td { width: 50px; } 4 4 #ref td { background-color: red; } 5 5 #test td { background-color: green; } 6 6 </style> 7 <div id="ref" style="position: absolute; top: 0; left: 0; ">7 <div id="ref" style="position: absolute; top: 0; left: 0; -webkit-writing-mode: vertical-rl;"> 8 8 <table><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table> 9 9 <table><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table> … … 14 14 <table><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table> 15 15 </div> 16 <div id="test" style="position: absolute; top: 0; left: 0; ">16 <div id="test" style="position: absolute; top: 0; left: 0; -webkit-writing-mode: vertical-rl;"> 17 17 <table> 18 18 <tr> -
trunk/LayoutTests/fast/table/growCellForImageQuirk-vertical.html
r71380 r71382 1 1 <style> 2 img { background-color: lightblue; width: 75px; height: 50px; }2 img { background-color: lightblue; height: 75px; width: 50px; } 3 3 </style> 4 <TABLE style=" width: 155px; background: silver;">4 <TABLE style="height: 155px; background: silver; -webkit-writing-mode: vertical-rl;"> 5 5 <TR> 6 6 <TD> -
trunk/LayoutTests/fast/table/height-percent-test-vertical.html
r71380 r71382 1 <div style="margin: 1em; height: 24px; border: 1px solid black"><div style="float:left"> 2 <div style="width: 100px; background-color:green; height:100%"></div> 1 <div style="-webkit-writing-mode: vertical-rl;"> 2 <div style="margin: 1em; width: 24px; border: 1px solid black;"><div style="float:left"> 3 <div style="height: 100px; background-color:green; width:100%"></div> 3 4 4 5 </div></div> 5 6 6 <div style="margin: 1em; height: 24px; border: 1px solid black"><div style="float:left">7 <table bgcolor=red height=100% cellpadding=0 cellspacing=0><tr><td><img border=0 height=22 width=96 style="background-color:green"></td></tr></table>7 <div style="margin: 1em; width: 24px; border: 1px solid black;"><div style="float:left"> 8 <table bgcolor=red width=100% cellpadding=0 cellspacing=0><tr><td><img border=0 width=22 height=96 style="background-color:green"></td></tr></table> 8 9 </div></div> 9 10 10 <div style="margin: 1em; border: 1px solid black "><div>11 <div style=" width: 100px; background-color:green; height:100%"></div>11 <div style="margin: 1em; border: 1px solid black;"><div> 12 <div style="height: 100px; background-color:green; width:100%"></div> 12 13 </div></div> 13 14 14 <div style="margin: 1em; border: 1px solid black "><div>15 <table bgcolor=red height=100% cellpadding=0 cellspacing=0><tr><td><img border=0 height=22 width=96 style="background-color:green"></td></tr></table>15 <div style="margin: 1em; border: 1px solid black;"><div> 16 <table bgcolor=red width=100% cellpadding=0 cellspacing=0><tr><td><img border=0 width=22 height=96 style="background-color:green"></td></tr></table> 16 17 </div></div> 18 </div> -
trunk/LayoutTests/fast/table/percent-widths-stretch-vertical.html
r71380 r71382 5 5 table { border-collapse: collapse; } 6 6 td { background-color: green; padding: 0; } 7 div { background-color: orange; height: 4px; width: 1px; }7 div { background-color: orange; width: 4px; height: 1px; } 8 8 </style> 9 9 <head> 10 <body >10 <body style="-webkit-writing-mode: vertical-rl;"> 11 11 <table> 12 12 <tr> 13 <td width="1%"><div></div></td>13 <td height="1%"><div></div></td> 14 14 </tr> 15 15 </table> 16 16 <table> 17 17 <tr> 18 <td width="2%"><div></div></td>18 <td height="2%"><div></div></td> 19 19 </tr> 20 20 </table> 21 21 <table> 22 22 <tr> 23 <td width="3%"><div></div></td>23 <td height="3%"><div></div></td> 24 24 </tr> 25 25 </table> 26 26 <table> 27 27 <tr> 28 <td width="4%"><div></div></td>28 <td height="4%"><div></div></td> 29 29 </tr> 30 30 </table> 31 31 <table> 32 32 <tr> 33 <td width="5%"><div></div></td>33 <td height="5%"><div></div></td> 34 34 </tr> 35 35 </table> 36 36 <table> 37 37 <tr> 38 <td width="10%"><div></div></td>38 <td height="10%"><div></div></td> 39 39 </tr> 40 40 </table> 41 41 <table> 42 42 <tr> 43 <td width="20%"><div></div></td>43 <td height="20%"><div></div></td> 44 44 </tr> 45 45 </table> 46 46 <table> 47 47 <tr> 48 <td width="30%"><div></div></td>48 <td height="30%"><div></div></td> 49 49 </tr> 50 50 </table> 51 51 <table> 52 52 <tr> 53 <td width="40%"><div></div></td>53 <td height="40%"><div></div></td> 54 54 </tr> 55 55 </table> 56 56 <table> 57 57 <tr> 58 <td width="50%"><div></div></td>58 <td height="50%"><div></div></td> 59 59 </tr> 60 60 </table> 61 61 <table> 62 62 <tr> 63 <td width="60%"><div></div></td>63 <td height="60%"><div></div></td> 64 64 </tr> 65 65 </table> 66 66 <table> 67 67 <tr> 68 <td width="70%"><div></div></td>68 <td height="70%"><div></div></td> 69 69 </tr> 70 70 </table> 71 71 <table> 72 72 <tr> 73 <td width="80%"><div></div></td>73 <td height="80%"><div></div></td> 74 74 </tr> 75 75 </table> 76 76 <table> 77 77 <tr> 78 <td width="90%"><div></div></td>78 <td height="90%"><div></div></td> 79 79 </tr> 80 80 </table> 81 81 <table> 82 82 <tr> 83 <td width="95%"><div></div></td>83 <td height="95%"><div></div></td> 84 84 </tr> 85 85 </table> 86 86 <table> 87 87 <tr> 88 <td width="96%"><div></div></td>88 <td height="96%"><div></div></td> 89 89 </tr> 90 90 </table> 91 91 <table> 92 92 <tr> 93 <td width="97%"><div></div></td>93 <td height="97%"><div></div></td> 94 94 </tr> 95 95 </table> 96 96 <table> 97 97 <tr> 98 <td width="98%"><div></div></td>98 <td height="98%"><div></div></td> 99 99 </tr> 100 100 </table> 101 101 <table> 102 102 <tr> 103 <td width="99%"><div></div></td>103 <td height="99%"><div></div></td> 104 104 </tr> 105 105 </table> 106 106 <table> 107 107 <tr> 108 <td width="100%"><div></div></td>108 <td height="100%"><div></div></td> 109 109 </tr> 110 110 </table> -
trunk/LayoutTests/fast/table/rowspan-paint-order-vertical.html
r71380 r71382 2 2 <body> 3 3 4 <table width="100%" height="100" border="2" cellspacing="0" cellpadding="0">4 <table height="580" width="100" border="2" cellspacing="0" cellpadding="0" style="-webkit-writing-mode: vertical-rl;"> 5 5 6 6 <tr > 7 7 <td bgcolor=#aaaaaa rowspan="3" >Left (3 rows)</td> 8 <td rowspan="2" width="50%" bgcolor="#000000"> </td>9 <td colspan="10" align="center" nowrap valign="top" height="22" >Middle (1 row)</td>10 <td rowspan="2" width="50%" bgcolor="#000000"> </td>8 <td rowspan="2" height="50%" bgcolor="#000000"> </td> 9 <td colspan="10" align="center" nowrap valign="top" width="22" >Middle (1 row)</td> 10 <td rowspan="2" height="50%" bgcolor="#000000"> </td> 11 11 <td rowspan="3" bgcolor=#aaaaaa align="right" >Right (3 rows) 12 12 </td> -
trunk/LayoutTests/fast/table/table-display-types-vertical.html
r71380 r71382 6 6 display: block; 7 7 margin: 10px; 8 -webkit-writing-mode: vertical-rl; 8 9 } 9 10 … … 21 22 22 23 .para { 23 width: 300px;24 height: 100px;24 height: 300px; 25 width: 100px; 25 26 border: 1px solid black; 26 27 display: table-cell; 28 -webkit-writing-mode: vertical-rl; 27 29 } 28 30 </style> -
trunk/WebCore/ChangeLog
r71379 r71382 1 2010-11-04 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 Made table layout and painting work with all writing modes. Hit-testing, repainting, tables 6 where some elements have their own layers, and cells whose writing mode differs from the 7 table’s are not supported yet. 8 9 Make tables work with vertical text 10 https://bugs.webkit.org/show_bug.cgi?id=46417 11 12 Tests: fast/table/027-vertical.html 13 fast/table/028-vertical.html 14 fast/table/035-vertical.html 15 fast/table/038-vertical.html 16 fast/table/040-vertical.html 17 fast/table/auto-with-percent-height-vertical.html 18 fast/table/border-collapsing/001-vertical.html 19 fast/table/border-collapsing/002-vertical.html 20 fast/table/border-collapsing/003-vertical.html 21 fast/table/border-collapsing/004-vertical.html 22 fast/table/border-collapsing/border-collapsing-head-foot-vertical.html 23 fast/table/border-collapsing/equal-precedence-resolution-vertical.html 24 fast/table/border-collapsing/rtl-border-collapsing-vertical.html 25 fast/table/colspanMinWidth-vertical.html 26 fast/table/fixed-with-auto-with-colspan-vertical.html 27 fast/table/growCellForImageQuirk-vertical.html 28 fast/table/height-percent-test-vertical.html 29 fast/table/percent-widths-stretch-vertical.html 30 fast/table/rowspan-paint-order-vertical.html 31 fast/table/table-display-types-vertical.html 32 33 * css/CSSStyleSelector.cpp: 34 (WebCore::CSSStyleSelector::adjustRenderStyle): Changed to allow all writing modes for tables, 35 make row groups, rows, column groups and columns inherit the table’s writing mode. For now, 36 make cells do this too. 37 * html/HTMLTableElement.cpp: 38 (WebCore::HTMLTableElement::parseMappedAttribute): Map align=center using logical properties. 39 * rendering/RenderTable.cpp: 40 (WebCore::RenderTable::RenderTable): Initialize m_borderStart and m_borderEnd. 41 (WebCore::RenderTable::styleDidChange): Changed the rule for when to use auto layout to look 42 at the logical width instead of the width. 43 (WebCore::RenderTable::computeLogicalWidth): Uses logical widths and works with perpendicular 44 containing blocks. 45 (WebCore::RenderTable::layout): Use logical lengths. 46 (WebCore::RenderTable::setCellLogicalWidths): Renamed setCellWidths() to this and updated for 47 the renaming of RenderTableSection::setCellWidths(). 48 (WebCore::RenderTable::paintObject): Account for flipped modes. 49 (WebCore::RenderTable::subtractCaptionRect): Added this helper method the considers writing modes. 50 (WebCore::RenderTable::paintBoxDecorations): Adopted subtractCaptionRect(). 51 (WebCore::RenderTable::paintMask): Ditto. 52 (WebCore::RenderTable::computePreferredLogicalWidths): Updated for the renaming of 53 recalcHorizontalBorders(). 54 (WebCore::RenderTable::calcBorderStart): Renamed calcBorderLeft() to this and changed it to use 55 borderStart(). Splits odd number of pixels based on the physical side. 56 (WebCore::RenderTable::calcBorderEnd): Similar. 57 (WebCore::RenderTable::recalcBordersInRowDirection): Renamed recalcHorizontalBorders() to this 58 and updated for other renames. 59 (WebCore::RenderTable::borderBefore): Replaced borderTop() with this. 60 (WebCore::RenderTable::borderAfter): Similar. 61 (WebCore::RenderTable::outerBorderBefore): Similar. 62 (WebCore::RenderTable::outerBorderAfter): Similar. 63 (WebCore::RenderTable::outerBorderStart): Similar. 64 (WebCore::RenderTable::outerBorderEnd): Similar. 65 (WebCore::RenderTable::firstLineBoxBaseline): Changed to use logical heights. 66 (WebCore::RenderTable::overflowClipRect): Account for writing modes. 67 * rendering/RenderTable.h: 68 (WebCore::RenderTable::borderStart): 69 (WebCore::RenderTable::borderEnd): 70 (WebCore::RenderTable::borderLeft): 71 (WebCore::RenderTable::borderRight): 72 (WebCore::RenderTable::borderTop): 73 (WebCore::RenderTable::borderBottom): 74 (WebCore::RenderTable::outerBorderLeft): 75 (WebCore::RenderTable::outerBorderRight): 76 (WebCore::RenderTable::outerBorderTop): 77 (WebCore::RenderTable::outerBorderBottom): 78 (WebCore::RenderTable::bordersPaddingAndSpacingInRowDirection): Changed to match its name. 79 * rendering/RenderTableRow.cpp: 80 (WebCore::RenderTableRow::styleWillChange): Changed to detect changes to logical height. 81 * rendering/RenderTableSection.cpp: 82 (WebCore::setRowLogicalHeightToRowStyleLogicalHeightIfNotRelative): Renamed and changed to use 83 logical heights. 84 (WebCore::RenderTableSection::RenderTableSection): Updated initializers for new member variables. 85 (WebCore::RenderTableSection::addChild): Updated for rename. 86 (WebCore::RenderTableSection::ensureRows): Ditto. 87 (WebCore::RenderTableSection::addCell): Ditto. Also use logical heights. 88 (WebCore::RenderTableSection::setCellLogicalWidths): Renamed setCellWidths() to this, changed 89 to use logical widths. 90 (WebCore::RenderTableSection::calcRowLogicalHeight): Added “logical” to the name. Updated with 91 logical heights. 92 (WebCore::RenderTableSection::layoutRows): 93 (WebCore::RenderTableSection::calcOuterBorderBefore): 94 (WebCore::RenderTableSection::calcOuterBorderAfter): 95 (WebCore::RenderTableSection::calcOuterBorderStart): 96 (WebCore::RenderTableSection::calcOuterBorderEnd): 97 (WebCore::RenderTableSection::recalcOuterBorder): 98 (WebCore::RenderTableSection::firstLineBoxBaseline): 99 (WebCore::RenderTableSection::paintCell): 100 (WebCore::RenderTableSection::recalcCells): 101 * rendering/RenderTableSection.h: 102 (WebCore::RenderTableSection::outerBorderBefore): 103 (WebCore::RenderTableSection::outerBorderAfter): 104 (WebCore::RenderTableSection::outerBorderStart): 105 (WebCore::RenderTableSection::outerBorderEnd): 106 1 107 2010-11-04 Kent Tamura <tkent@chromium.org> 2 108 -
trunk/WebCore/css/CSSStyleSelector.cpp
r71348 r71382 1754 1754 style->position() == RelativePosition) 1755 1755 style->setPosition(StaticPosition); 1756 1757 // FIXME: Since we don't support block-flow on either tables or flexible boxes yet, disallow setting 1756 1757 // writing-mode does not apply to table row groups, table column groups, table rows, and table columns. 1758 // FIXME: Table cells should be allowed to be perpendicular or flipped with respect to the table, though. 1759 if (style->display() == TABLE_COLUMN || style->display() == TABLE_COLUMN_GROUP || style->display() == TABLE_FOOTER_GROUP 1760 || style->display() == TABLE_HEADER_GROUP || style->display() == TABLE_ROW || style->display() == TABLE_ROW_GROUP 1761 || style->display() == TABLE_CELL) 1762 style->setWritingMode(parentStyle->writingMode()); 1763 1764 // FIXME: Since we don't support block-flow on flexible boxes yet, disallow setting 1758 1765 // of block-flow to anything other than TopToBottomWritingMode. 1759 // https://bugs.webkit.org/show_bug.cgi?id=46417 - Tables support1760 1766 // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support. 1761 if (style->writingMode() != TopToBottomWritingMode && (style->display() == TABLE || style->display() == INLINE_TABLE 1762 || style->display() == TABLE_HEADER_GROUP || style->display() == TABLE_ROW_GROUP 1763 || style->display() == TABLE_FOOTER_GROUP || style->display() == TABLE_ROW || style->display() == TABLE_CELL 1764 || style->display() == BOX || style->display() == INLINE_BOX)) 1767 if (style->writingMode() != TopToBottomWritingMode && (style->display() == BOX || style->display() == INLINE_BOX)) 1765 1768 style->setWritingMode(TopToBottomWritingMode); 1766 1769 } -
trunk/WebCore/html/HTMLTableElement.cpp
r69868 r71382 425 425 if (!attr->value().isEmpty()) { 426 426 if (equalIgnoringCase(attr->value(), "center")) { 427 addCSSProperty(attr, CSSProperty MarginLeft, CSSValueAuto);428 addCSSProperty(attr, CSSProperty MarginRight, CSSValueAuto);427 addCSSProperty(attr, CSSPropertyWebkitMarginStart, CSSValueAuto); 428 addCSSProperty(attr, CSSPropertyWebkitMarginEnd, CSSValueAuto); 429 429 } else 430 430 addCSSProperty(attr, CSSPropertyFloat, attr->value()); -
trunk/WebCore/rendering/RenderTable.cpp
r69437 r71382 5 5 * (C) 1999 Lars Knoll (knoll@kde.org) 6 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 8 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 9 9 * … … 57 57 , m_hSpacing(0) 58 58 , m_vSpacing(0) 59 , m_border Left(0)60 , m_border Right(0)59 , m_borderStart(0) 60 , m_borderEnd(0) 61 61 { 62 62 setChildrenInline(false); … … 84 84 // According to the CSS2 spec, you only use fixed table layout if an 85 85 // explicit width is specified on the table. Auto width implies auto table layout. 86 if (style()->tableLayout() == TFIXED && !style()-> width().isAuto())86 if (style()->tableLayout() == TFIXED && !style()->logicalWidth().isAuto()) 87 87 m_tableLayout.set(new FixedTableLayout(this)); 88 88 else … … 205 205 206 206 RenderBlock* cb = containingBlock(); 207 int availableWidth = cb->availableLogicalWidth(); 208 209 LengthType widthType = style()->width().type(); 210 if (widthType > Relative && style()->width().isPositive()) { 207 208 int availableLogicalWidth = containingBlockLogicalWidthForContent(); 209 bool hasPerpendicularContainingBlock = cb->style()->isHorizontalWritingMode() != style()->isHorizontalWritingMode(); 210 int containerWidthInInlineDirection = hasPerpendicularContainingBlock ? perpendicularContainingBlockLogicalHeight() : availableLogicalWidth; 211 212 LengthType logicalWidthType = style()->logicalWidth().type(); 213 if (logicalWidthType > Relative && style()->logicalWidth().isPositive()) { 211 214 // Percent or fixed table 212 set Width(style()->width().calcMinValue(availableWidth));213 set Width(max(minPreferredLogicalWidth(), width()));215 setLogicalWidth(style()->logicalWidth().calcMinValue(containerWidthInInlineDirection)); 216 setLogicalWidth(max(minPreferredLogicalWidth(), logicalWidth())); 214 217 } else { 215 // An auto width table should shrink to fit within the line width if necessary in order to216 // avoid overlapping floats.217 availableWidth = cb->availableLogicalWidthForLine(y(), false);218 219 218 // Subtract out any fixed margins from our available width for auto width tables. 220 219 int marginTotal = 0; 221 if (!style()->margin Left().isAuto())222 marginTotal += style()->margin Left().calcValue(availableWidth);223 if (!style()->margin Right().isAuto())224 marginTotal += style()->margin Right().calcValue(availableWidth);220 if (!style()->marginStart().isAuto()) 221 marginTotal += style()->marginStart().calcValue(availableLogicalWidth); 222 if (!style()->marginEnd().isAuto()) 223 marginTotal += style()->marginEnd().calcValue(availableLogicalWidth); 225 224 226 225 // Subtract out our margins to get the available content width. 227 int avail ContentWidth = max(0, availableWidth- marginTotal);226 int availableContentLogicalWidth = max(0, containerWidthInInlineDirection - marginTotal); 228 227 229 228 // Ensure we aren't bigger than our max width or smaller than our min width. 230 set Width(min(availContentWidth, maxPreferredLogicalWidth()));231 } 232 233 set Width(max(width(), minPreferredLogicalWidth()));229 setLogicalWidth(min(availableContentLogicalWidth, maxPreferredLogicalWidth())); 230 } 231 232 setLogicalWidth(max(logicalWidth(), minPreferredLogicalWidth())); 234 233 235 234 // Finally, with our true width determined, compute our margins for real. 236 m_marginRight = 0; 237 m_marginLeft = 0; 238 computeInlineDirectionMargins(cb, availableWidth, width()); 235 setMarginStart(0); 236 setMarginEnd(0); 237 if (!hasPerpendicularContainingBlock) 238 computeInlineDirectionMargins(cb, availableLogicalWidth, logicalWidth()); 239 else { 240 setMarginStart(style()->marginStart().calcMinValue(availableLogicalWidth)); 241 setMarginEnd(style()->marginEnd().calcMinValue(availableLogicalWidth)); 242 } 239 243 } 240 244 … … 251 255 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y())); 252 256 253 set Height(0);257 setLogicalHeight(0); 254 258 m_overflow.clear(); 255 259 256 260 initMaxMarginValues(); 257 261 258 int old Width = width();262 int oldLogicalWidth = logicalWidth(); 259 263 computeLogicalWidth(); 260 264 261 if (m_caption && width() != oldWidth)265 if (m_caption && logicalWidth() != oldLogicalWidth) 262 266 m_caption->setNeedsLayout(true, false); 263 267 … … 269 273 m_tableLayout->layout(); 270 274 271 setCellWidths(); 272 273 // layout child objects 274 int calculatedHeight = 0; 275 int oldTableTop = m_caption ? m_caption->height() + m_caption->marginTop() + m_caption->marginBottom() : 0; 275 setCellLogicalWidths(); 276 277 int totalSectionLogicalHeight = 0; 278 int oldTableLogicalTop = m_caption ? m_caption->logicalHeight() + m_caption->marginBefore() + m_caption->marginAfter() : 0; 276 279 277 280 bool collapsing = collapseBorders(); … … 281 284 child->layoutIfNeeded(); 282 285 RenderTableSection* section = toRenderTableSection(child); 283 calculatedHeight += section->calcRowHeight();286 totalSectionLogicalHeight += section->calcRowLogicalHeight(); 284 287 if (collapsing) 285 288 section->recalcOuterBorder(); … … 299 302 // did not shift). 300 303 bool sectionMoved = false; 301 int movedSection Top = 0;304 int movedSectionLogicalTop = 0; 302 305 303 306 // FIXME: Collapse caption margin. … … 305 308 IntRect captionRect(m_caption->x(), m_caption->y(), m_caption->width(), m_caption->height()); 306 309 307 m_caption->setLo cation(m_caption->marginLeft(), height());310 m_caption->setLogicalLocation(m_caption->marginStart(), logicalHeight()); 308 311 if (!selfNeedsLayout() && m_caption->checkForRepaintDuringLayout()) 309 312 m_caption->repaintDuringLayoutIfMoved(captionRect); 310 313 311 set Height(height() + m_caption->height() + m_caption->marginTop() + m_caption->marginBottom());312 313 if ( height() != oldTableTop) {314 setLogicalHeight(logicalHeight() + m_caption->logicalHeight() + m_caption->marginBefore() + m_caption->marginAfter()); 315 316 if (logicalHeight() != oldTableLogicalTop) { 314 317 sectionMoved = true; 315 movedSection Top = min(height(), oldTableTop);316 } 317 } 318 319 int b pTop = borderTop() + (collapsing ? 0 : paddingTop());320 int b pBottom = borderBottom() + (collapsing ? 0 : paddingBottom());321 322 set Height(height() + bpTop);318 movedSectionLogicalTop = min(logicalHeight(), oldTableLogicalTop); 319 } 320 } 321 322 int borderAndPaddingBefore = borderBefore() + (collapsing ? 0 : paddingBefore()); 323 int borderAndPaddingAfter = borderAfter() + (collapsing ? 0 : paddingAfter()); 324 325 setLogicalHeight(logicalHeight() + borderAndPaddingBefore); 323 326 324 327 if (!isPositioned()) 325 328 computeLogicalHeight(); 326 329 327 Length h = style()->height();328 int th= 0;329 if ( h.isFixed())330 Length logicalHeightLength = style()->logicalHeight(); 331 int computedLogicalHeight = 0; 332 if (logicalHeightLength.isFixed()) { 330 333 // Tables size as though CSS height includes border/padding. 331 th = h.value() - (bpTop + bpBottom);332 else if (h.isPercent())333 th = computePercentageLogicalHeight(h);334 th = max(0, th);334 computedLogicalHeight = logicalHeightLength.value() - (borderAndPaddingBefore + borderAndPaddingAfter); 335 } else if (logicalHeightLength.isPercent()) 336 computedLogicalHeight = computePercentageLogicalHeight(logicalHeightLength); 337 computedLogicalHeight = max(0, computedLogicalHeight); 335 338 336 339 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { 337 340 if (child->isTableSection()) 338 341 // FIXME: Distribute extra height between all table body sections instead of giving it all to the first one. 339 toRenderTableSection(child)->layoutRows(child == m_firstBody ? max(0, th - calculatedHeight) : 0);340 } 341 342 if (!m_firstBody && th > calculatedHeight && !document()->inQuirksMode()) {342 toRenderTableSection(child)->layoutRows(child == m_firstBody ? max(0, computedLogicalHeight - totalSectionLogicalHeight) : 0); 343 } 344 345 if (!m_firstBody && computedLogicalHeight > totalSectionLogicalHeight && !document()->inQuirksMode()) { 343 346 // Completely empty tables (with no sections or anything) should at least honor specified height 344 347 // in strict mode. 345 set Height(height() + th);346 } 347 348 int bl = borderLeft();348 setLogicalHeight(logicalHeight() + computedLogicalHeight); 349 } 350 351 int sectionLogicalLeft = style()->isLeftToRightDirection() ? borderStart() : borderEnd(); 349 352 if (!collapsing) 350 bl += paddingLeft();353 sectionLogicalLeft += style()->isLeftToRightDirection() ? paddingStart() : paddingEnd(); 351 354 352 355 // position the table sections 353 356 RenderTableSection* section = m_head ? m_head : (m_firstBody ? m_firstBody : m_foot); 354 357 while (section) { 355 if (!sectionMoved && section-> y() != height()) {358 if (!sectionMoved && section->logicalTop() != logicalHeight()) { 356 359 sectionMoved = true; 357 movedSection Top = min(height(), section->y()) + section->topVisibleOverflow();358 } 359 section->setLo cation(bl, height());360 361 set Height(height() + section->height());360 movedSectionLogicalTop = min(logicalHeight(), section->logicalTop()) + (style()->isHorizontalWritingMode() ? section->topVisibleOverflow() : section->leftVisibleOverflow()); 361 } 362 section->setLogicalLocation(sectionLogicalLeft, logicalHeight()); 363 364 setLogicalHeight(logicalHeight() + section->logicalHeight()); 362 365 section = sectionBelow(section); 363 366 } 364 367 365 set Height(height() + bpBottom);368 setLogicalHeight(logicalHeight() + borderAndPaddingAfter); 366 369 367 370 if (m_caption && m_caption->style()->captionSide() == CAPBOTTOM) { 368 371 IntRect captionRect(m_caption->x(), m_caption->y(), m_caption->width(), m_caption->height()); 369 372 370 m_caption->setLo cation(m_caption->marginLeft(), height());373 m_caption->setLogicalLocation(m_caption->marginStart(), logicalHeight()); 371 374 if (!selfNeedsLayout() && m_caption->checkForRepaintDuringLayout()) 372 375 m_caption->repaintDuringLayoutIfMoved(captionRect); 373 376 374 set Height(height() + m_caption->height() + m_caption->marginTop() + m_caption->marginBottom());377 setLogicalHeight(logicalHeight() + m_caption->logicalHeight() + m_caption->marginBefore() + m_caption->marginAfter()); 375 378 } 376 379 … … 411 414 bool didFullRepaint = repainter.repaintAfterLayout(); 412 415 // Repaint with our new bounds if they are different from our old bounds. 413 if (!didFullRepaint && sectionMoved) 414 repaintRectangle(IntRect(leftVisibleOverflow(), movedSectionTop, rightVisibleOverflow() - leftVisibleOverflow(), bottomVisibleOverflow() - movedSectionTop)); 415 416 if (!didFullRepaint && sectionMoved) { 417 if (style()->isHorizontalWritingMode()) 418 repaintRectangle(IntRect(leftVisibleOverflow(), movedSectionLogicalTop, rightVisibleOverflow() - leftVisibleOverflow(), bottomVisibleOverflow() - movedSectionLogicalTop)); 419 else 420 repaintRectangle(IntRect(movedSectionLogicalTop, topVisibleOverflow(), rightVisibleOverflow() - movedSectionLogicalTop, bottomVisibleOverflow() - topVisibleOverflow())); 421 } 422 416 423 setNeedsLayout(false); 417 424 } 418 425 419 void RenderTable::setCell Widths()426 void RenderTable::setCellLogicalWidths() 420 427 { 421 428 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { 422 429 if (child->isTableSection()) 423 toRenderTableSection(child)->setCell Widths();430 toRenderTableSection(child)->setCellLogicalWidths(); 424 431 } 425 432 } … … 468 475 469 476 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { 470 if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child == m_caption)) 471 child->paint(info, tx, ty); 477 if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child == m_caption)) { 478 IntPoint childPoint = flipForWritingMode(toRenderBox(child), IntPoint(tx, ty), ParentToChildFlippingAdjustment); 479 child->paint(info, childPoint.x(), childPoint.y()); 480 } 472 481 } 473 482 … … 479 488 RenderTableCell::CollapsedBorderStyles borderStyles; 480 489 RenderObject* stop = nextInPreOrderAfterChildren(); 481 for (RenderObject* o = firstChild(); o && o != stop; o = o->nextInPreOrder()) 490 for (RenderObject* o = firstChild(); o && o != stop; o = o->nextInPreOrder()) { 482 491 if (o->isTableCell()) 483 492 toRenderTableCell(o)->collectBorderStyles(borderStyles); 493 } 484 494 RenderTableCell::sortBorderStyles(borderStyles); 485 495 size_t count = borderStyles.size(); … … 487 497 m_currentBorder = &borderStyles[i]; 488 498 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) 489 if (child->isTableSection()) 490 child->paint(info, tx, ty); 499 if (child->isTableSection()) { 500 IntPoint childPoint = flipForWritingMode(toRenderTableSection(child), IntPoint(tx, ty), ParentToChildFlippingAdjustment); 501 child->paint(info, childPoint.x(), childPoint.y()); 502 } 491 503 } 492 504 m_currentBorder = 0; 505 } 506 } 507 508 void RenderTable::subtractCaptionRect(IntRect& rect) const 509 { 510 if (!m_caption) 511 return; 512 513 int captionLogicalHeight = m_caption->logicalHeight() + m_caption->marginBefore() + m_caption->marginAfter(); 514 bool captionIsBefore = (m_caption->style()->captionSide() != CAPBOTTOM) ^ style()->isFlippedBlocksWritingMode(); 515 if (style()->isHorizontalWritingMode()) { 516 rect.setHeight(rect.height() - captionLogicalHeight); 517 if (captionIsBefore) 518 rect.move(0, captionLogicalHeight); 519 } else { 520 rect.setWidth(rect.width() - captionLogicalHeight); 521 if (captionIsBefore) 522 rect.move(captionLogicalHeight, 0); 493 523 } 494 524 } … … 499 529 return; 500 530 501 int w = width(); 502 int h = height(); 503 504 // Account for the caption. 505 if (m_caption) { 506 int captionHeight = (m_caption->height() + m_caption->marginBottom() + m_caption->marginTop()); 507 h -= captionHeight; 508 if (m_caption->style()->captionSide() != CAPBOTTOM) 509 ty += captionHeight; 510 } 511 512 paintBoxShadow(paintInfo.context, tx, ty, w, h, style(), Normal); 531 IntRect rect(tx, ty, width(), height()); 532 subtractCaptionRect(rect); 533 534 paintBoxShadow(paintInfo.context, rect.x(), rect.y(), rect.width(), rect.height(), style(), Normal); 513 535 514 paintFillLayers(paintInfo, style()->visitedDependentColor(CSSPropertyBackgroundColor), style()->backgroundLayers(), tx, ty, w, h);515 paintBoxShadow(paintInfo.context, tx, ty, w, h, style(), Inset);536 paintFillLayers(paintInfo, style()->visitedDependentColor(CSSPropertyBackgroundColor), style()->backgroundLayers(), rect.x(), rect.y(), rect.width(), rect.height()); 537 paintBoxShadow(paintInfo.context, rect.x(), rect.y(), rect.width(), rect.height(), style(), Inset); 516 538 517 539 if (style()->hasBorder() && !collapseBorders()) 518 paintBorder(paintInfo.context, tx, ty, w, h, style());540 paintBorder(paintInfo.context, rect.x(), rect.y(), rect.width(), rect.height(), style()); 519 541 } 520 542 … … 524 546 return; 525 547 526 int w = width(); 527 int h = height(); 528 529 // Account for the caption. 530 if (m_caption) { 531 int captionHeight = (m_caption->height() + m_caption->marginBottom() + m_caption->marginTop()); 532 h -= captionHeight; 533 if (m_caption->style()->captionSide() != CAPBOTTOM) 534 ty += captionHeight; 535 } 536 537 paintMaskImages(paintInfo, tx, ty, w, h); 548 IntRect rect(tx, ty, width(), height()); 549 subtractCaptionRect(rect); 550 551 paintMaskImages(paintInfo, rect.x(), rect.y(), rect.width(), rect.height()); 538 552 } 539 553 … … 543 557 544 558 recalcSectionsIfNeeded(); 545 recalc HorizontalBorders();559 recalcBordersInRowDirection(); 546 560 547 561 m_tableLayout->computePreferredLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); … … 722 736 } 723 737 724 int RenderTable::calcBorder Left() const738 int RenderTable::calcBorderStart() const 725 739 { 726 740 if (collapseBorders()) { … … 731 745 unsigned borderWidth = 0; 732 746 733 const BorderValue& tb = style()->border Left();747 const BorderValue& tb = style()->borderStart(); 734 748 if (tb.style() == BHIDDEN) 735 749 return 0; … … 737 751 borderWidth = tb.width(); 738 752 739 int leftmostColumn = !style()->isLeftToRightDirection() ? numEffCols() - 1 : 0; 740 RenderTableCol* colGroup = colElement(leftmostColumn); 741 if (colGroup) { 742 const BorderValue& gb = style()->borderLeft(); 753 if (RenderTableCol* colGroup = colElement(0)) { 754 const BorderValue& gb = colGroup->style()->borderStart(); 743 755 if (gb.style() == BHIDDEN) 744 756 return 0; … … 752 764 753 765 if (firstNonEmptySection) { 754 const BorderValue& sb = firstNonEmptySection->style()->border Left();766 const BorderValue& sb = firstNonEmptySection->style()->borderStart(); 755 767 if (sb.style() == BHIDDEN) 756 768 return 0; … … 759 771 borderWidth = max(borderWidth, static_cast<unsigned>(sb.width())); 760 772 761 const RenderTableSection::CellStruct& cs = firstNonEmptySection->cellAt(0, leftmostColumn);773 const RenderTableSection::CellStruct& cs = firstNonEmptySection->cellAt(0, 0); 762 774 763 775 if (cs.hasCells()) { 764 const BorderValue& cb = cs.primaryCell()->style()->border Left();776 const BorderValue& cb = cs.primaryCell()->style()->borderStart(); // FIXME: Make this work with perpendicualr and flipped cells. 765 777 if (cb.style() == BHIDDEN) 766 778 return 0; 767 779 768 const BorderValue& rb = cs.primaryCell()->parent()->style()->border Left();780 const BorderValue& rb = cs.primaryCell()->parent()->style()->borderStart(); 769 781 if (rb.style() == BHIDDEN) 770 782 return 0; … … 776 788 } 777 789 } 778 return borderWidth/ 2;779 } 780 return RenderBlock::border Left();781 } 782 783 int RenderTable::calcBorder Right() const790 return (borderWidth + (style()->isLeftToRightDirection() ? 0 : 1)) / 2; 791 } 792 return RenderBlock::borderStart(); 793 } 794 795 int RenderTable::calcBorderEnd() const 784 796 { 785 797 if (collapseBorders()) { … … 790 802 unsigned borderWidth = 0; 791 803 792 const BorderValue& tb = style()->border Right();804 const BorderValue& tb = style()->borderEnd(); 793 805 if (tb.style() == BHIDDEN) 794 806 return 0; … … 796 808 borderWidth = tb.width(); 797 809 798 int rightmostColumn = !style()->isLeftToRightDirection() ? 0 : numEffCols() - 1; 799 RenderTableCol* colGroup = colElement(rightmostColumn); 800 if (colGroup) { 801 const BorderValue& gb = style()->borderRight(); 810 int endColumn = numEffCols() - 1; 811 if (RenderTableCol* colGroup = colElement(endColumn)) { 812 const BorderValue& gb = colGroup->style()->borderEnd(); 802 813 if (gb.style() == BHIDDEN) 803 814 return 0; … … 811 822 812 823 if (firstNonEmptySection) { 813 const BorderValue& sb = firstNonEmptySection->style()->border Right();824 const BorderValue& sb = firstNonEmptySection->style()->borderEnd(); 814 825 if (sb.style() == BHIDDEN) 815 826 return 0; … … 818 829 borderWidth = max(borderWidth, static_cast<unsigned>(sb.width())); 819 830 820 const RenderTableSection::CellStruct& cs = firstNonEmptySection->cellAt(0, rightmostColumn);831 const RenderTableSection::CellStruct& cs = firstNonEmptySection->cellAt(0, endColumn); 821 832 822 833 if (cs.hasCells()) { 823 const BorderValue& cb = cs.primaryCell()->style()->border Right();834 const BorderValue& cb = cs.primaryCell()->style()->borderEnd(); // FIXME: Make this work with perpendicular and flipped cells. 824 835 if (cb.style() == BHIDDEN) 825 836 return 0; 826 837 827 const BorderValue& rb = cs.primaryCell()->parent()->style()->border Right();838 const BorderValue& rb = cs.primaryCell()->parent()->style()->borderEnd(); 828 839 if (rb.style() == BHIDDEN) 829 840 return 0; … … 835 846 } 836 847 } 837 return (borderWidth + 1) / 2;838 } 839 return RenderBlock::border Right();840 } 841 842 void RenderTable::recalc HorizontalBorders()843 { 844 m_border Left = calcBorderLeft();845 m_border Right = calcBorderRight();846 } 847 848 int RenderTable::border Top() const848 return (borderWidth + (style()->isLeftToRightDirection() ? 1 : 0)) / 2; 849 } 850 return RenderBlock::borderEnd(); 851 } 852 853 void RenderTable::recalcBordersInRowDirection() 854 { 855 m_borderStart = calcBorderStart(); 856 m_borderEnd = calcBorderEnd(); 857 } 858 859 int RenderTable::borderBefore() const 849 860 { 850 861 if (collapseBorders()) 851 return outerBorder Top();852 return RenderBlock::border Top();853 } 854 855 int RenderTable::border Bottom() const862 return outerBorderBefore(); 863 return RenderBlock::borderBefore(); 864 } 865 866 int RenderTable::borderAfter() const 856 867 { 857 868 if (collapseBorders()) 858 return outerBorder Bottom();859 return RenderBlock::border Bottom();860 } 861 862 int RenderTable::outerBorder Top() const869 return outerBorderAfter(); 870 return RenderBlock::borderAfter(); 871 } 872 873 int RenderTable::outerBorderBefore() const 863 874 { 864 875 if (!collapseBorders()) … … 875 886 topSection = 0; 876 887 if (topSection) { 877 borderWidth = topSection->outerBorder Top();888 borderWidth = topSection->outerBorderBefore(); 878 889 if (borderWidth == -1) 879 890 return 0; // Overridden by hidden 880 891 } 881 const BorderValue& tb = style()->border Top();892 const BorderValue& tb = style()->borderBefore(); 882 893 if (tb.style() == BHIDDEN) 883 894 return 0; … … 887 898 } 888 899 889 int RenderTable::outerBorder Bottom() const900 int RenderTable::outerBorderAfter() const 890 901 { 891 902 if (!collapseBorders()) … … 901 912 } 902 913 if (bottomSection) { 903 borderWidth = bottomSection->outerBorder Bottom();914 borderWidth = bottomSection->outerBorderAfter(); 904 915 if (borderWidth == -1) 905 916 return 0; // Overridden by hidden 906 917 } 907 const BorderValue& tb = style()->border Bottom();918 const BorderValue& tb = style()->borderAfter(); 908 919 if (tb.style() == BHIDDEN) 909 920 return 0; … … 913 924 } 914 925 915 int RenderTable::outerBorder Left() const926 int RenderTable::outerBorderStart() const 916 927 { 917 928 if (!collapseBorders()) … … 920 931 int borderWidth = 0; 921 932 922 const BorderValue& tb = style()->border Left();933 const BorderValue& tb = style()->borderStart(); 923 934 if (tb.style() == BHIDDEN) 924 935 return 0; 925 936 if (tb.style() > BHIDDEN) 926 borderWidth = tb.width() / 2;937 borderWidth = (tb.width() + (style()->isLeftToRightDirection() ? 0 : 1)) / 2; 927 938 928 939 bool allHidden = true; … … 930 941 if (!child->isTableSection()) 931 942 continue; 932 int sw = toRenderTableSection(child)->outerBorder Left();943 int sw = toRenderTableSection(child)->outerBorderStart(); 933 944 if (sw == -1) 934 945 continue; … … 943 954 } 944 955 945 int RenderTable::outerBorder Right() const956 int RenderTable::outerBorderEnd() const 946 957 { 947 958 if (!collapseBorders()) … … 950 961 int borderWidth = 0; 951 962 952 const BorderValue& tb = style()->border Right();963 const BorderValue& tb = style()->borderEnd(); 953 964 if (tb.style() == BHIDDEN) 954 965 return 0; 955 966 if (tb.style() > BHIDDEN) 956 borderWidth = (tb.width() + 1) / 2;967 borderWidth = (tb.width() + (style()->isLeftToRightDirection() ? 1 : 0)) / 2; 957 968 958 969 bool allHidden = true; … … 960 971 if (!child->isTableSection()) 961 972 continue; 962 int sw = toRenderTableSection(child)->outerBorder Right();973 int sw = toRenderTableSection(child)->outerBorderEnd(); 963 974 if (sw == -1) 964 975 continue; … … 1098 1109 int RenderTable::firstLineBoxBaseline() const 1099 1110 { 1111 if (isWritingModeRoot()) 1112 return -1; 1113 1100 1114 RenderTableSection* firstNonEmptySection = m_head ? m_head : (m_firstBody ? m_firstBody : m_foot); 1101 1115 if (firstNonEmptySection && !firstNonEmptySection->numRows()) … … 1105 1119 return -1; 1106 1120 1107 return firstNonEmptySection-> y() + firstNonEmptySection->firstLineBoxBaseline();1121 return firstNonEmptySection->logicalTop() + firstNonEmptySection->firstLineBoxBaseline(); 1108 1122 } 1109 1123 … … 1119 1133 // we might have to hack this code first (depending on what order we do these bug fixes in). 1120 1134 if (m_caption) { 1121 rect.setHeight(height()); 1122 rect.setY(ty); 1135 if (style()->isHorizontalWritingMode()) { 1136 rect.setHeight(height()); 1137 rect.setY(ty); 1138 } else { 1139 rect.setWidth(width()); 1140 rect.setX(tx); 1141 } 1123 1142 } 1124 1143 -
trunk/WebCore/rendering/RenderTable.h
r71262 r71382 5 5 * (C) 1999 Lars Knoll (knoll@kde.org) 6 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 7 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.7 * Copyright (C) 2003, 2004, 2005, 2006, 2009, 2010 Apple Inc. All rights reserved. 8 8 * 9 9 * This library is free software; you can redistribute it and/or … … 48 48 49 49 bool collapseBorders() const { return style()->borderCollapse(); } 50 int borderLeft() const { return m_borderLeft; } 51 int borderRight() const { return m_borderRight; } 52 int borderTop() const; 53 int borderBottom() const; 54 50 51 int borderStart() const { return m_borderStart; } 52 int borderEnd() const { return m_borderEnd; } 53 int borderBefore() const; 54 int borderAfter() const; 55 56 int borderLeft() const 57 { 58 if (style()->isHorizontalWritingMode()) 59 return style()->isLeftToRightDirection() ? borderStart() : borderEnd(); 60 return style()->isFlippedBlocksWritingMode() ? borderAfter() : borderBefore(); 61 } 62 63 int borderRight() const 64 { 65 if (style()->isHorizontalWritingMode()) 66 return style()->isLeftToRightDirection() ? borderEnd() : borderStart(); 67 return style()->isFlippedBlocksWritingMode() ? borderBefore() : borderAfter(); 68 } 69 70 int borderTop() const 71 { 72 if (style()->isHorizontalWritingMode()) 73 return style()->isFlippedBlocksWritingMode() ? borderAfter() : borderBefore(); 74 return style()->isLeftToRightDirection() ? borderStart() : borderEnd(); 75 } 76 77 int borderBottom() const 78 { 79 if (style()->isHorizontalWritingMode()) 80 return style()->isFlippedBlocksWritingMode() ? borderBefore() : borderAfter(); 81 return style()->isLeftToRightDirection() ? borderEnd() : borderStart(); 82 } 83 55 84 const Color bgColor() const { return style()->visitedDependentColor(CSSPropertyBackgroundColor); } 56 85 57 int outerBorderTop() const; 58 int outerBorderBottom() const; 59 int outerBorderLeft() const; 60 int outerBorderRight() const; 61 62 int calcBorderLeft() const; 63 int calcBorderRight() const; 64 void recalcHorizontalBorders(); 86 int outerBorderBefore() const; 87 int outerBorderAfter() const; 88 int outerBorderStart() const; 89 int outerBorderEnd() const; 90 91 int outerBorderLeft() const 92 { 93 if (style()->isHorizontalWritingMode()) 94 return style()->isLeftToRightDirection() ? outerBorderStart() : outerBorderEnd(); 95 return style()->isFlippedBlocksWritingMode() ? outerBorderAfter() : outerBorderBefore(); 96 } 97 98 int outerBorderRight() const 99 { 100 if (style()->isHorizontalWritingMode()) 101 return style()->isLeftToRightDirection() ? outerBorderEnd() : outerBorderStart(); 102 return style()->isFlippedBlocksWritingMode() ? outerBorderBefore() : outerBorderAfter(); 103 } 104 105 int outerBorderTop() const 106 { 107 if (style()->isHorizontalWritingMode()) 108 return style()->isFlippedBlocksWritingMode() ? outerBorderAfter() : outerBorderBefore(); 109 return style()->isLeftToRightDirection() ? outerBorderStart() : outerBorderEnd(); 110 } 111 112 int outerBorderBottom() const 113 { 114 if (style()->isHorizontalWritingMode()) 115 return style()->isFlippedBlocksWritingMode() ? outerBorderBefore() : outerBorderAfter(); 116 return style()->isLeftToRightDirection() ? outerBorderEnd() : outerBorderStart(); 117 } 118 119 int calcBorderStart() const; 120 int calcBorderEnd() const; 121 void recalcBordersInRowDirection(); 65 122 66 123 virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0); … … 111 168 int bordersPaddingAndSpacingInRowDirection() const 112 169 { 113 return border Left() + borderRight() +114 (collapseBorders() ? 0 : (padding Left() + paddingRight() + (numEffCols() + 1) * hBorderSpacing()));170 return borderStart() + borderEnd() + 171 (collapseBorders() ? 0 : (paddingStart() + paddingEnd() + (numEffCols() + 1) * hBorderSpacing())); 115 172 } 116 173 … … 170 227 virtual void updateFirstLetter(); 171 228 172 virtual void setCell Widths();229 virtual void setCellLogicalWidths(); 173 230 174 231 virtual void computeLogicalWidth(); 175 232 176 233 virtual IntRect overflowClipRect(int tx, int ty); 234 235 void subtractCaptionRect(IntRect&) const; 177 236 178 237 void recalcSections() const; … … 195 254 short m_hSpacing; 196 255 short m_vSpacing; 197 int m_border Left;198 int m_border Right;256 int m_borderStart; 257 int m_borderEnd; 199 258 }; 200 259 -
trunk/WebCore/rendering/RenderTableRow.cpp
r68427 r71382 5 5 * (C) 1999 Lars Knoll (knoll@kde.org) 6 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 7 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 8 8 * 9 9 * This library is free software; you can redistribute it and/or … … 55 55 void RenderTableRow::styleWillChange(StyleDifference diff, const RenderStyle* newStyle) 56 56 { 57 if (section() && style() && style()-> height() != newStyle->height())57 if (section() && style() && style()->logicalHeight() != newStyle->logicalHeight()) 58 58 section()->setNeedsCellRecalc(); 59 59 -
trunk/WebCore/rendering/RenderTableSection.cpp
r71251 r71382 5 5 * (C) 1999 Lars Knoll (knoll@kde.org) 6 6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserved. 8 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 9 9 * … … 44 44 using namespace HTMLNames; 45 45 46 static inline void setRow HeightToRowStyleHeightIfNotRelative(RenderTableSection::RowStruct* row)46 static inline void setRowLogicalHeightToRowStyleLogicalHeightIfNotRelative(RenderTableSection::RowStruct* row) 47 47 { 48 48 ASSERT(row && row->rowRenderer); 49 row-> height = row->rowRenderer->style()->height();50 if (row-> height.isRelative())51 row-> height = Length();49 row->logicalHeight = row->rowRenderer->style()->logicalHeight(); 50 if (row->logicalHeight.isRelative()) 51 row->logicalHeight = Length(); 52 52 } 53 53 … … 57 57 , m_cCol(0) 58 58 , m_cRow(-1) 59 , m_outerBorder Left(0)60 , m_outerBorder Right(0)61 , m_outerBorder Top(0)62 , m_outerBorder Bottom(0)59 , m_outerBorderStart(0) 60 , m_outerBorderEnd(0) 61 , m_outerBorderBefore(0) 62 , m_outerBorderAfter(0) 63 63 , m_needsCellRecalc(false) 64 64 , m_hasOverflowingCell(false) … … 134 134 135 135 if (!beforeChild) 136 setRow HeightToRowStyleHeightIfNotRelative(&m_grid[m_cRow]);136 setRowLogicalHeightToRowStyleLogicalHeightIfNotRelative(&m_grid[m_cRow]); 137 137 138 138 // If the next renderer is actually wrapped in an anonymous table row, we need to go up and find that. … … 166 166 m_grid[r].rowRenderer = 0; 167 167 m_grid[r].baseline = 0; 168 m_grid[r]. height = Length();168 m_grid[r].logicalHeight = Length(); 169 169 } 170 170 } … … 191 191 if (rSpan == 1) { 192 192 // we ignore height settings on rowspan cells 193 Length height = cell->style()->height();194 if ( height.isPositive() || (height.isRelative() && height.value() >= 0)) {195 Length cRow Height = m_grid[m_cRow].height;196 switch ( height.type()) {193 Length logicalHeight = cell->style()->logicalHeight(); 194 if (logicalHeight.isPositive() || (logicalHeight.isRelative() && logicalHeight.value() >= 0)) { 195 Length cRowLogicalHeight = m_grid[m_cRow].logicalHeight; 196 switch (logicalHeight.type()) { 197 197 case Percent: 198 if (!(cRow Height.isPercent()) ||199 (cRow Height.isPercent() && cRowHeight.rawValue() < height.rawValue()))200 m_grid[m_cRow]. height = height;198 if (!(cRowLogicalHeight.isPercent()) || 199 (cRowLogicalHeight.isPercent() && cRowLogicalHeight.rawValue() < logicalHeight.rawValue())) 200 m_grid[m_cRow].logicalHeight = logicalHeight; 201 201 break; 202 202 case Fixed: 203 if (cRow Height.type() < Percent ||204 (cRow Height.isFixed() && cRowHeight.value() < height.value()))205 m_grid[m_cRow]. height = height;203 if (cRowLogicalHeight.type() < Percent || 204 (cRowLogicalHeight.isFixed() && cRowLogicalHeight.value() < logicalHeight.value())) 205 m_grid[m_cRow].logicalHeight = logicalHeight; 206 206 break; 207 207 case Relative: … … 249 249 } 250 250 251 void RenderTableSection::setCell Widths()251 void RenderTableSection::setCellLogicalWidths() 252 252 { 253 253 Vector<int>& columnPos = table()->columnPositions(); … … 271 271 } 272 272 int w = columnPos[endCol] - columnPos[j] - table()->hBorderSpacing(); 273 int old Width = cell->width();274 if (w != old Width) {273 int oldLogicalWidth = cell->logicalWidth(); 274 if (w != oldLogicalWidth) { 275 275 cell->setNeedsLayout(true); 276 276 if (!table()->selfNeedsLayout() && cell->checkForRepaintDuringLayout()) { … … 290 290 } 291 291 292 int RenderTableSection::calcRow Height()292 int RenderTableSection::calcRowLogicalHeight() 293 293 { 294 294 #ifndef NDEBUG … … 312 312 int baseline = 0; 313 313 int bdesc = 0; 314 int ch = m_grid[r]. height.calcMinValue(0);314 int ch = m_grid[r].logicalHeight.calcMinValue(0); 315 315 int pos = m_rowPos[r] + ch + (m_grid[r].rowRenderer ? spacing : 0); 316 316 … … 342 342 cell->layoutIfNeeded(); 343 343 } 344 345 int adjustedPadding Top = cell->paddingTop() - cell->intrinsicPaddingBefore();346 int adjustedPadding Bottom = cell->paddingBottom() - cell->intrinsicPaddingAfter();347 int adjusted Height = cell->height() - (cell->intrinsicPaddingBefore() + cell->intrinsicPaddingAfter());348 344 345 int adjustedPaddingBefore = cell->paddingBefore() - cell->intrinsicPaddingBefore(); 346 int adjustedPaddingAfter = cell->paddingAfter() - cell->intrinsicPaddingAfter(); 347 int adjustedLogicalHeight = cell->logicalHeight() - (cell->intrinsicPaddingBefore() + cell->intrinsicPaddingAfter()); 348 349 349 // Explicit heights use the border box in quirks mode. In strict mode do the right 350 350 // thing and actually add in the border and padding. 351 ch = cell->style()-> height().calcValue(0) +352 (document()->inQuirksMode() ? 0 : (adjustedPadding Top + adjustedPaddingBottom+353 cell->border Top() + cell->borderBottom()));354 ch = max(ch, adjusted Height);351 ch = cell->style()->logicalHeight().calcValue(0) + 352 (document()->inQuirksMode() ? 0 : (adjustedPaddingBefore + adjustedPaddingAfter + 353 cell->borderBefore() + cell->borderAfter())); 354 ch = max(ch, adjustedLogicalHeight); 355 355 356 356 pos = m_rowPos[indx] + ch + (m_grid[r].rowRenderer ? spacing : 0); … … 362 362 if (va == BASELINE || va == TEXT_BOTTOM || va == TEXT_TOP || va == SUPER || va == SUB) { 363 363 int b = cell->baselinePosition(); 364 if (b > cell->border Top() + cell->paddingTop()) {364 if (b > cell->borderBefore() + cell->paddingBefore()) { 365 365 baseline = max(baseline, b - cell->intrinsicPaddingBefore()); 366 366 bdesc = max(bdesc, m_rowPos[indx] + ch - (b - cell->intrinsicPaddingBefore())); … … 418 418 419 419 // Set the width of our section now. The rows will also be this width. 420 set Width(table()->contentWidth());420 setLogicalWidth(table()->contentLogicalWidth()); 421 421 m_overflow.clear(); 422 422 m_hasOverflowingCell = false; … … 429 429 int numAuto = 0; 430 430 for (int r = 0; r < totalRows; r++) { 431 if (m_grid[r]. height.isAuto())431 if (m_grid[r].logicalHeight.isAuto()) 432 432 numAuto++; 433 else if (m_grid[r]. height.isPercent())434 totalPercent += m_grid[r]. height.rawValue();433 else if (m_grid[r].logicalHeight.isPercent()) 434 totalPercent += m_grid[r].logicalHeight.rawValue(); 435 435 } 436 436 if (totalPercent) { … … 440 440 int rh = m_rowPos[1] - m_rowPos[0]; 441 441 for (int r = 0; r < totalRows; r++) { 442 if (totalPercent > 0 && m_grid[r]. height.isPercent()) {443 int toAdd = min(dh, (totalHeight * m_grid[r]. height.rawValue() / (100 * percentScaleFactor)) - rh);442 if (totalPercent > 0 && m_grid[r].logicalHeight.isPercent()) { 443 int toAdd = min(dh, (totalHeight * m_grid[r].logicalHeight.rawValue() / (100 * percentScaleFactor)) - rh); 444 444 // If toAdd is negative, then we don't want to shrink the row (this bug 445 445 // affected Outlook Web Access). … … 447 447 add += toAdd; 448 448 dh -= toAdd; 449 totalPercent -= m_grid[r]. height.rawValue();449 totalPercent -= m_grid[r].logicalHeight.rawValue(); 450 450 } 451 451 if (r < totalRows - 1) … … 458 458 int add = 0; 459 459 for (int r = 0; r < totalRows; r++) { 460 if (numAuto > 0 && m_grid[r]. height.isAuto()) {460 if (numAuto > 0 && m_grid[r].logicalHeight.isAuto()) { 461 461 int toAdd = dh / numAuto; 462 462 add += toAdd; … … 491 491 if (RenderTableRow* rowRenderer = m_grid[r].rowRenderer) { 492 492 rowRenderer->setLocation(0, m_rowPos[r]); 493 rowRenderer->set Width(width());494 rowRenderer->set Height(m_rowPos[r + 1] - m_rowPos[r] - vspacing);493 rowRenderer->setLogicalWidth(logicalWidth()); 494 rowRenderer->setLogicalHeight(m_rowPos[r + 1] - m_rowPos[r] - vspacing); 495 495 } 496 496 … … 519 519 // bugs. :) 520 520 bool cellChildrenFlex = false; 521 bool flexAllChildren = cell->style()-> height().isFixed()522 || (!table()->style()-> height().isAuto() && rHeight != cell->height());521 bool flexAllChildren = cell->style()->logicalHeight().isFixed() 522 || (!table()->style()->logicalHeight().isAuto() && rHeight != cell->logicalHeight()); 523 523 524 524 for (RenderObject* o = cell->firstChild(); o; o = o->nextSibling()) { 525 if (!o->isText() && o->style()-> height().isPercent() && (flexAllChildren || o->isReplaced() || (o->isBox() && toRenderBox(o)->scrollsOverflow()))) {525 if (!o->isText() && o->style()->logicalHeight().isPercent() && (flexAllChildren || o->isReplaced() || (o->isBox() && toRenderBox(o)->scrollsOverflow()))) { 526 526 // Tables with no sections do not flex. 527 527 if (!o->isTable() || toRenderTable(o)->hasSections()) { … … 558 558 // been resized based off its percentage. 559 559 cell->setOverrideSize(max(0, 560 rHeight - cell->border Top() - cell->paddingTop() -561 cell->border Bottom() - cell->paddingBottom()));560 rHeight - cell->borderBefore() - cell->paddingBefore() - 561 cell->borderAfter() - cell->paddingAfter())); 562 562 cell->layoutIfNeeded(); 563 563 564 564 // If the baseline moved, we may have to update the data for our row. Find out the new baseline. 565 565 EVerticalAlign va = cell->style()->verticalAlign(); 566 566 if (va == BASELINE || va == TEXT_BOTTOM || va == TEXT_TOP || va == SUPER || va == SUB) { 567 567 int b = cell->baselinePosition(); 568 if (b > cell->border Top() + cell->paddingTop())568 if (b > cell->borderBefore() + cell->paddingBefore()) 569 569 m_grid[r].baseline = max(m_grid[r].baseline, b); 570 570 } 571 571 } 572 573 int old Te = cell->intrinsicPaddingBefore();574 int old Be= cell->intrinsicPaddingAfter();575 int heightWithoutIntrinsicPadding = cell->height() - oldTe - oldBe;576 577 int te = 0;572 573 int oldIntrinsicPaddingBefore = cell->intrinsicPaddingBefore(); 574 int oldIntrinsicPaddingAfter = cell->intrinsicPaddingAfter(); 575 int logicalHeightWithoutIntrinsicPadding = cell->logicalHeight() - oldIntrinsicPaddingBefore - oldIntrinsicPaddingAfter; 576 577 int intrinsicPaddingBefore = 0; 578 578 switch (cell->style()->verticalAlign()) { 579 579 case SUB: … … 583 583 case BASELINE: { 584 584 int b = cell->baselinePosition(); 585 if (b > cell->border Top() + cell->paddingTop())586 te = getBaseline(r) - (b - oldTe);585 if (b > cell->borderBefore() + cell->paddingBefore()) 586 intrinsicPaddingBefore = getBaseline(r) - (b - oldIntrinsicPaddingBefore); 587 587 break; 588 588 } 589 589 case TOP: 590 te = 0;591 590 break; 592 591 case MIDDLE: 593 te = (rHeight - heightWithoutIntrinsicPadding) / 2;592 intrinsicPaddingBefore = (rHeight - logicalHeightWithoutIntrinsicPadding) / 2; 594 593 break; 595 594 case BOTTOM: 596 te = rHeight - heightWithoutIntrinsicPadding;595 intrinsicPaddingBefore = rHeight - logicalHeightWithoutIntrinsicPadding; 597 596 break; 598 597 default: … … 600 599 } 601 600 602 int be = rHeight - heightWithoutIntrinsicPadding - te;603 cell->setIntrinsicPaddingBefore( te);604 cell->setIntrinsicPaddingAfter( be);605 601 int intrinsicPaddingAfter = rHeight - logicalHeightWithoutIntrinsicPadding - intrinsicPaddingBefore; 602 cell->setIntrinsicPaddingBefore(intrinsicPaddingBefore); 603 cell->setIntrinsicPaddingAfter(intrinsicPaddingAfter); 604 606 605 IntRect oldCellRect(cell->x(), cell->y() , cell->width(), cell->height()); 607 606 608 607 if (!style()->isLeftToRightDirection()) 609 cell->setLo cation(table()->columnPositions()[nEffCols] - table()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + hspacing, m_rowPos[rindx]);608 cell->setLogicalLocation(table()->columnPositions()[nEffCols] - table()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + hspacing, m_rowPos[rindx]); 610 609 else 611 cell->setLo cation(table()->columnPositions()[c] + hspacing, m_rowPos[rindx]);610 cell->setLogicalLocation(table()->columnPositions()[c] + hspacing, m_rowPos[rindx]); 612 611 view()->addLayoutDelta(IntSize(oldCellRect.x() - cell->x(), oldCellRect.y() - cell->y())); 613 612 614 if ( te != oldTe || be != oldBe)613 if (intrinsicPaddingBefore != oldIntrinsicPaddingBefore || intrinsicPaddingAfter != oldIntrinsicPaddingAfter) 615 614 cell->setNeedsLayout(true, false); 616 615 617 616 if (!cell->needsLayout() && view()->layoutState()->m_pageHeight && view()->layoutState()->pageY(cell->y()) != cell->pageY()) 618 617 cell->setChildNeedsLayout(true, false); 619 618 620 619 cell->layoutIfNeeded(); 621 622 if (view()->layoutState()->m_pageHeight && cell->height() != rHeight) 620 621 // FIXME: Make pagination work with vertical tables. 622 if (style()->isHorizontalWritingMode() && view()->layoutState()->m_pageHeight && cell->height() != rHeight) 623 623 cell->setHeight(rHeight); // FIXME: Pagination might have made us change size. For now just shrink or grow the cell to fit without doing a relayout. 624 624 625 625 IntSize childOffset(cell->x() - oldCellRect.x(), cell->y() - oldCellRect.y()); 626 626 if (childOffset.width() || childOffset.height()) { … … 642 642 ASSERT(!needsLayout()); 643 643 644 set Height(m_rowPos[totalRows]);644 setLogicalHeight(m_rowPos[totalRows]); 645 645 646 646 // Now that our height has been determined, add in overflow from cells. … … 734 734 } 735 735 736 int RenderTableSection::calcOuterBorder Top() const736 int RenderTableSection::calcOuterBorderBefore() const 737 737 { 738 738 int totalCols = table()->numEffCols(); … … 742 742 unsigned borderWidth = 0; 743 743 744 const BorderValue& sb = style()->border Top();744 const BorderValue& sb = style()->borderBefore(); 745 745 if (sb.style() == BHIDDEN) 746 746 return -1; … … 748 748 borderWidth = sb.width(); 749 749 750 const BorderValue& rb = firstChild()->style()->border Top();750 const BorderValue& rb = firstChild()->style()->borderBefore(); 751 751 if (rb.style() == BHIDDEN) 752 752 return -1; … … 759 759 if (current.inColSpan || !current.hasCells()) 760 760 continue; 761 const BorderValue& cb = current.primaryCell()->style()->border Top();761 const BorderValue& cb = current.primaryCell()->style()->borderBefore(); // FIXME: Make this work with perpendicular and flipped cells. 762 762 // FIXME: Don't repeat for the same col group 763 763 RenderTableCol* colGroup = table()->colElement(c); 764 764 if (colGroup) { 765 const BorderValue& gb = colGroup->style()->border Top();765 const BorderValue& gb = colGroup->style()->borderBefore(); 766 766 if (gb.style() == BHIDDEN || cb.style() == BHIDDEN) 767 767 continue; … … 785 785 } 786 786 787 int RenderTableSection::calcOuterBorder Bottom() const787 int RenderTableSection::calcOuterBorderAfter() const 788 788 { 789 789 int totalCols = table()->numEffCols(); … … 793 793 unsigned borderWidth = 0; 794 794 795 const BorderValue& sb = style()->border Bottom();795 const BorderValue& sb = style()->borderAfter(); 796 796 if (sb.style() == BHIDDEN) 797 797 return -1; … … 799 799 borderWidth = sb.width(); 800 800 801 const BorderValue& rb = lastChild()->style()->border Bottom();801 const BorderValue& rb = lastChild()->style()->borderAfter(); 802 802 if (rb.style() == BHIDDEN) 803 803 return -1; … … 810 810 if (current.inColSpan || !current.hasCells()) 811 811 continue; 812 const BorderValue& cb = current.primaryCell()->style()->border Bottom();812 const BorderValue& cb = current.primaryCell()->style()->borderAfter(); // FIXME: Make this work with perpendicular and flipped cells. 813 813 // FIXME: Don't repeat for the same col group 814 814 RenderTableCol* colGroup = table()->colElement(c); 815 815 if (colGroup) { 816 const BorderValue& gb = colGroup->style()->border Bottom();816 const BorderValue& gb = colGroup->style()->borderAfter(); 817 817 if (gb.style() == BHIDDEN || cb.style() == BHIDDEN) 818 818 continue; … … 836 836 } 837 837 838 int RenderTableSection::calcOuterBorder Left(bool rtl) const838 int RenderTableSection::calcOuterBorderStart() const 839 839 { 840 840 int totalCols = table()->numEffCols(); … … 844 844 unsigned borderWidth = 0; 845 845 846 const BorderValue& sb = style()->border Left();846 const BorderValue& sb = style()->borderStart(); 847 847 if (sb.style() == BHIDDEN) 848 848 return -1; … … 850 850 borderWidth = sb.width(); 851 851 852 int leftmostColumn = rtl ? totalCols - 1 : 0; 853 RenderTableCol* colGroup = table()->colElement(leftmostColumn); 854 if (colGroup) { 855 const BorderValue& gb = colGroup->style()->borderLeft(); 852 if (RenderTableCol* colGroup = table()->colElement(0)) { 853 const BorderValue& gb = colGroup->style()->borderStart(); 856 854 if (gb.style() == BHIDDEN) 857 855 return -1; … … 862 860 bool allHidden = true; 863 861 for (int r = 0; r < m_gridRows; r++) { 864 const CellStruct& current = cellAt(r, leftmostColumn);862 const CellStruct& current = cellAt(r, 0); 865 863 if (!current.hasCells()) 866 864 continue; 867 865 // FIXME: Don't repeat for the same cell 868 const BorderValue& cb = current.primaryCell()->style()->border Left();869 const BorderValue& rb = current.primaryCell()->parent()->style()->border Left();866 const BorderValue& cb = current.primaryCell()->style()->borderStart(); // FIXME: Make this work with perpendicular and flipped cells. 867 const BorderValue& rb = current.primaryCell()->parent()->style()->borderStart(); 870 868 if (cb.style() == BHIDDEN || rb.style() == BHIDDEN) 871 869 continue; … … 879 877 return -1; 880 878 881 return borderWidth/ 2;882 } 883 884 int RenderTableSection::calcOuterBorder Right(bool rtl) const879 return (borderWidth + (table()->style()->isLeftToRightDirection() ? 0 : 1)) / 2; 880 } 881 882 int RenderTableSection::calcOuterBorderEnd() const 885 883 { 886 884 int totalCols = table()->numEffCols(); … … 890 888 unsigned borderWidth = 0; 891 889 892 const BorderValue& sb = style()->border Right();890 const BorderValue& sb = style()->borderEnd(); 893 891 if (sb.style() == BHIDDEN) 894 892 return -1; … … 896 894 borderWidth = sb.width(); 897 895 898 int rightmostColumn = rtl ? 0 : totalCols - 1; 899 RenderTableCol* colGroup = table()->colElement(rightmostColumn); 900 if (colGroup) { 901 const BorderValue& gb = colGroup->style()->borderRight(); 896 if (RenderTableCol* colGroup = table()->colElement(totalCols - 1)) { 897 const BorderValue& gb = colGroup->style()->borderEnd(); 902 898 if (gb.style() == BHIDDEN) 903 899 return -1; … … 908 904 bool allHidden = true; 909 905 for (int r = 0; r < m_gridRows; r++) { 910 const CellStruct& current = cellAt(r, rightmostColumn);906 const CellStruct& current = cellAt(r, totalCols - 1); 911 907 if (!current.hasCells()) 912 908 continue; 913 909 // FIXME: Don't repeat for the same cell 914 const BorderValue& cb = current.primaryCell()->style()->border Right();915 const BorderValue& rb = current.primaryCell()->parent()->style()->border Right();910 const BorderValue& cb = current.primaryCell()->style()->borderEnd(); // FIXME: Make this work with perpendicular and flipped cells. 911 const BorderValue& rb = current.primaryCell()->parent()->style()->borderEnd(); 916 912 if (cb.style() == BHIDDEN || rb.style() == BHIDDEN) 917 913 continue; … … 925 921 return -1; 926 922 927 return (borderWidth + 1) / 2;923 return (borderWidth + (table()->style()->isLeftToRightDirection() ? 1 : 0)) / 2; 928 924 } 929 925 930 926 void RenderTableSection::recalcOuterBorder() 931 927 { 932 bool rtl = !table()->style()->isLeftToRightDirection(); 933 m_outerBorderTop = calcOuterBorderTop(); 934 m_outerBorderBottom = calcOuterBorderBottom(); 935 m_outerBorderLeft = calcOuterBorderLeft(rtl); 936 m_outerBorderRight = calcOuterBorderRight(rtl); 928 m_outerBorderBefore = calcOuterBorderBefore(); 929 m_outerBorderAfter = calcOuterBorderAfter(); 930 m_outerBorderStart = calcOuterBorderStart(); 931 m_outerBorderEnd = calcOuterBorderEnd(); 937 932 } 938 933 … … 952 947 RenderTableCell* cell = cs.primaryCell(); 953 948 if (cell) 954 firstLineBaseline = max(firstLineBaseline, cell-> y() + cell->paddingTop() + cell->borderTop() + cell->contentHeight());949 firstLineBaseline = max(firstLineBaseline, cell->logicalTop() + cell->paddingBefore() + cell->borderBefore() + cell->contentLogicalHeight()); 955 950 } 956 951 … … 989 984 void RenderTableSection::paintCell(RenderTableCell* cell, PaintInfo& paintInfo, int tx, int ty) 990 985 { 986 IntPoint cellPoint = flipForWritingMode(cell, IntPoint(tx, ty), ParentToChildFlippingAdjustment); 991 987 PaintPhase paintPhase = paintInfo.phase; 992 988 RenderTableRow* row = toRenderTableRow(cell->parent()); … … 1005 1001 // Note that we deliberately ignore whether or not the cell has a layer, since these backgrounds paint "behind" the 1006 1002 // cell. 1007 cell->paintBackgroundsBehindCell(paintInfo, tx, ty, colGroup);1008 cell->paintBackgroundsBehindCell(paintInfo, tx, ty, col);1003 cell->paintBackgroundsBehindCell(paintInfo, cellPoint.x(), cellPoint.y(), colGroup); 1004 cell->paintBackgroundsBehindCell(paintInfo, cellPoint.x(), cellPoint.y(), col); 1009 1005 1010 1006 // Paint the row group next. 1011 cell->paintBackgroundsBehindCell(paintInfo, tx, ty, this);1007 cell->paintBackgroundsBehindCell(paintInfo, cellPoint.x(), cellPoint.y(), this); 1012 1008 1013 1009 // Paint the row next, but only if it doesn't have a layer. If a row has a layer, it will be responsible for 1014 1010 // painting the row background for the cell. 1015 1011 if (!row->hasSelfPaintingLayer()) 1016 cell->paintBackgroundsBehindCell(paintInfo, tx, ty, row);1012 cell->paintBackgroundsBehindCell(paintInfo, cellPoint.x(), cellPoint.y(), row); 1017 1013 } 1018 1014 if ((!cell->hasSelfPaintingLayer() && !row->hasSelfPaintingLayer()) || paintInfo.phase == PaintPhaseCollapsedTableBorders) 1019 cell->paint(paintInfo, tx, ty); 1020 1015 cell->paint(paintInfo, cellPoint.x(), cellPoint.y()); 1021 1016 } 1022 1017 … … 1141 1136 RenderTableRow* tableRow = toRenderTableRow(row); 1142 1137 m_grid[m_cRow].rowRenderer = tableRow; 1143 setRow HeightToRowStyleHeightIfNotRelative(&m_grid[m_cRow]);1138 setRowLogicalHeightToRowStyleLogicalHeightIfNotRelative(&m_grid[m_cRow]); 1144 1139 1145 1140 for (RenderObject* cell = row->firstChild(); cell; cell = cell->nextSibling()) { -
trunk/WebCore/rendering/RenderTableSection.h
r70170 r71382 48 48 void addCell(RenderTableCell*, RenderTableRow* row); 49 49 50 void setCell Widths();51 int calcRow Height();52 int layoutRows(int height);50 void setCellLogicalWidths(); 51 int calcRowLogicalHeight(); 52 int layoutRows(int logicalHeight); 53 53 54 54 RenderTable* table() const { return toRenderTable(parent()); } … … 80 80 RenderTableRow* rowRenderer; 81 81 int baseline; 82 Length height;82 Length logicalHeight; 83 83 }; 84 84 … … 94 94 void splitColumn(int pos, int first); 95 95 96 int calcOuterBorder Top() const;97 int calcOuterBorder Bottom() const;98 int calcOuterBorder Left(bool rtl) const;99 int calcOuterBorder Right(bool rtl) const;96 int calcOuterBorderBefore() const; 97 int calcOuterBorderAfter() const; 98 int calcOuterBorderStart() const; 99 int calcOuterBorderEnd() const; 100 100 void recalcOuterBorder(); 101 101 102 int outerBorder Top() const { return m_outerBorderTop; }103 int outerBorder Bottom() const { return m_outerBorderBottom; }104 int outerBorder Left() const { return m_outerBorderLeft; }105 int outerBorder Right() const { return m_outerBorderRight; }102 int outerBorderBefore() const { return m_outerBorderBefore; } 103 int outerBorderAfter() const { return m_outerBorderAfter; } 104 int outerBorderStart() const { return m_outerBorderStart; } 105 int outerBorderEnd() const { return m_outerBorderEnd; } 106 106 107 107 int numRows() const { return m_gridRows; } … … 164 164 int m_cRow; 165 165 166 int m_outerBorder Left;167 int m_outerBorder Right;168 int m_outerBorder Top;169 int m_outerBorder Bottom;166 int m_outerBorderStart; 167 int m_outerBorderEnd; 168 int m_outerBorderBefore; 169 int m_outerBorderAfter; 170 170 171 171 bool m_needsCellRecalc;
Note:
See TracChangeset
for help on using the changeset viewer.