Lay out table children in visual order, and set position and size.

Set caption and section positions before the first layout pass, and set the
logical height right after. This will help the fragmentation code break at the
right places.

By doing it in visual order right away we can also get rid of some code that
dealt with sections being moved after layout.

BUG=534751

Review-Url: https://codereview.chromium.org/2421613002
Cr-Commit-Position: refs/heads/master@{#425425}
diff --git a/third_party/WebKit/LayoutTests/fragmentation/break-in-second-table-section.html b/third_party/WebKit/LayoutTests/fragmentation/break-in-second-table-section.html
new file mode 100644
index 0000000..720eb6c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fragmentation/break-in-second-table-section.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<style>
+    body {
+        overflow:scroll; /* A second layout pass might hide bugs. */
+        color: black;
+        background: white;
+    }
+</style>
+<p>There should be a blue square below.</p>
+<div id="multicol" style="position:relative; columns:3; column-gap:0; column-fill:auto; height:99px; line-height:20px; orphans:1; widows:1;">
+    <br>
+    <br>
+    <table cellspacing="0" cellpadding="0">
+        <col style="width:20px;">
+        <col style="width:20px;">
+        <thead>
+            <tr>
+                <td style="vertical-align:top;"><br><br></td>
+                <td style="vertical-align:top;"><br><br></td>
+            </tr>
+        </thead>
+        <tbody>
+            <tr data-expected-height="79">
+                <td data-expected-height="79" style="vertical-align:top;">
+                    <br>
+                    <div data-offset-y="20" style="position:relative; background:blue;">
+                        <br><br>
+                    </div>
+                </td>
+                <td data-expected-height="79" style="vertical-align:top; background:blue;">
+                    <div style="background:white;"><br></div>
+                    <div data-offset-y="20" style="position:relative;"></div>
+                </td>
+            </tr>
+        </tbody>
+    </table>
+</div>
+<script src="../resources/check-layout.js"></script>
+<script>
+    checkLayout("#multicol");
+</script>