Improve the break appeal calculation code.

The break_appeal_ member in NGBoxFragmentBuilder was a bit fuzzy, did
too many things, and didn't behave entirely correctly.

Don't let it deal with the break appeal of early-breaks anymore; instead
move this into the NGEarlyBreak object (which also allows us to remove
this member from the rare data object in NGLayoutResult).

Also start off with perfect break appeal (rather than assuming a
last-resort break) in the builder, and downgrade it if we have to,
rather than upgrading it to "perfect" manually in FinishFragmentation().
We'd fail to realize that break appeal was perfect if we had a
break-before break token for a float inside, for instance.

Correctly propagate the break appeal all the way up to the
fragmentainer.

Apart from fixing a few "corner cases", this is needed by nested block
fragmentation (in a follow-up CL), so that we can push the first
fragment of an inner multicol to the next outer fragmentainer, to avoid
violations (e.g. breaking inside something with break-inside:avoid).

Bug: 829028
Change-Id: I4ec2444f623efddf399a34e604a3b1375a171438
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3129466
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Alison Maher <almaher@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#916489}
diff --git a/css/css-break/orphans-in-parallel-flow.html b/css/css-break/orphans-in-parallel-flow.html
new file mode 100644
index 0000000..0cc084a
--- /dev/null
+++ b/css/css-break/orphans-in-parallel-flow.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
+<link rel="help" href="https://www.w3.org/TR/css-break-3/#widows-orphans">
+<link rel="help" href="https://www.w3.org/TR/css-break-3/#parallel-flows">
+<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+<div style="width:100px; height:100px; orphans:2; widows:2; background:red;">
+  <div style="columns:2; column-fill:auto; column-gap:0; height:130px;">
+    <div style="height:100px; background:green;"></div>
+    <div style="height:100px; background:green;">
+      <div style="line-height:20px; height:10px;">
+        <br>
+        <br>
+      </div>
+      <div style="height:10px;"></div>
+    </div>
+  </div>
+</div>
diff --git a/css/css-break/tall-float-pushed-to-next-fragmentainer-003.html b/css/css-break/tall-float-pushed-to-next-fragmentainer-003.html
new file mode 100644
index 0000000..3e28c5c
--- /dev/null
+++ b/css/css-break/tall-float-pushed-to-next-fragmentainer-003.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
+<link rel="help" href="https://www.w3.org/TR/css-break-3/">
+<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
+<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
+<div style="columns:2; column-fill:auto; column-gap:0; width:100px; height:100px; background:red;">
+  <div style="height:50px; background:green;"></div>
+  <div style="height:100px; background:green;">
+    <div style="float:left; break-inside:avoid; width:100%; height:100px; background:green;"></div>
+  </div>
+</div>