The border-collapsing code assumes that cell 0 is the leftmost and that the last cell is the rightmost, which is wrong for tables with RTL direction. As a result: the table's left border is applied to the left border of the rightmost side and vice versa, and a cell's left border is collapsed with the right border of the cell to its right, and vice versa.
Created attachment 6045 [details] Testcase Firefox renders this correctly.
Created attachment 6050 [details] Proposed patch
Comment on attachment 6050 [details] Proposed patch I think it's a little inelegant to have that inLastColumn boolean and those "rtl ? !inLastColumn : (col() > 0)" clauses. Instead, could we just compute an appropriate boolean up front? Something like "righmostColumn" or "leftmostColumn"? Looks great to me. r=me
Created attachment 6072 [details] Updated patch Replaced the inLastColumn booleans with leftmostColumn/rightmostColumn per Darin's suggestion.
Comment on attachment 6072 [details] Updated patch Looks great. I think it's ready to land, but I do have 2 more ideas to improve it. I'll probably just do these if I land it: 1) cellPrevious and cellNext should be named cellBefore and cellAfter to match the names cellAbove and cellBelow 2) code to compute leftmostColumn and rightmostColumn should have more closely-matching sides of the if, no need to use an if statement in the RTL case
Verified in r12476 nightly