Detect when we reach the block-end of a table row.

... and don't let row fragments that are past the block-end of their row
node participate in border collapsing.

We check outgoing non-rowspanned table cells whether they have outgoing
break tokens (that are not at the block-end). Simply checking the if the
pre-calculated row block-size is small enough to fit in the
fragmentainer wouldn't do, since table cells may have forced breaks
inside and thus stretch the rows.

Bug: 1428930
Change-Id: Ic62d7e936718ad86f15d06177ae9309670215416
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4414682
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1128843}
diff --git a/css/css-break/table/border-collapse-001.html b/css/css-break/table/border-collapse-001.html
new file mode 100644
index 0000000..626935f
--- /dev/null
+++ b/css/css-break/table/border-collapse-001.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
+<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1428930">
+<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
+<style>
+  td { padding:0; }
+</style>
+<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+<div style="columns:2; gap:0; column-fill:auto; width:200px; height:200px; margin-left:-100px; margin-top:-40px;">
+  <table style="border-collapse:collapse;">
+    <tr>
+      <td rowspan="3"></td>
+      <td><div style="height:100px;"></div></td>
+    </tr>
+    <tr>
+      <td><div style="height:100px;"></div></td>
+    </tr>
+    <tr>
+      <td><div style="height:40px;"></div></td>
+    </tr>
+    <tr style="background:red;">
+      <td style="border:10px solid green;"><div style="width:35px; height:80px; background:green;"></div></td>
+      <td style="border:10px solid green;"><div style="width:35px; height:80px; background:green;"></div></td>
+    </tr>
+  </table>
+</div>