Reland again "Fieldset NG: Fix paint order of OOF objects in a LEGEND and the corresponding anonymous content box."
This is a reland of commit 2c20b99e08731c4bae71da9d4598d10146f52848
The differences from the original CL:
Because the original CL caused a performance regression, this CL adds
a cache of the state of CanContainAbsolutePositionObjects().
LayoutObjectBitfields already has 96 bits, and this CL adds a bit flag
between full_paint_invalidation_reason_ and the bitfields. The size
of LayoutObject is not changed by this CL.
The differences from the first reland CL:
Fix Windows x64 build failure.
Original change's description:
> Fieldset NG: Fix paint order of OOF objects in a LEGEND and the
> corresponding anonymous content box.
>
> If a FIELDSET is an OOF container, we made its anonymous content box
> an OOF container by setting position:relative. It's bad because OOF
> objects in the LEGEND is painted behind the anonymous content box. So
> this CL updates OOF container conditions for anonymous fieldset content
> boxes, and avoids setting position:relative.
>
> * ng_fieldset_algorithm.cc:
> Handle NGBreakStatus::kDisableFragmentation.
> Without this change, floated-multicol-in-multicol-crash.html in WPT has
> a DCHECK failure.
>
> Bug: 1341413
> Change-Id: I650b3020df53eba5d05f930bc44675b80ff4e90b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3764404
> Reviewed-by: Koji Ishii <kojii@chromium.org>
> Commit-Queue: Kent Tamura <tkent@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1025081}
Bug: 1341413
Change-Id: Ib539ae3b11700cc7f51eb11ae33a8e972c940538
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3767050
Auto-Submit: Kent Tamura <tkent@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1025608}
diff --git a/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/absolute-fixed-in-legend-ref.html b/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/absolute-fixed-in-legend-ref.html
new file mode 100644
index 0000000..f82faee
--- /dev/null
+++ b/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/absolute-fixed-in-legend-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<style>
+div {
+ display: block;
+ font-size: 32px;
+ background: lime;
+ width: 10em;
+}
+</style>
+
+<div>legend</div>
+<div>legend</div>
diff --git a/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/absolute-fixed-in-legend.html b/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/absolute-fixed-in-legend.html
new file mode 100644
index 0000000..56d2969
--- /dev/null
+++ b/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/absolute-fixed-in-legend.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<title>Absolute/fixed-positioned boxes in LEGEND should be painted on the fieldset content</title>
+<link rel=match href=absolute-fixed-in-legend-ref.html>
+<style>
+.absolute-container {
+ position: relative;
+ border: none;
+ padding: 0;
+ margin: 0;
+}
+
+.absolute-container .legend-content {
+ display: block;
+ font-size: 32px;
+ position: absolute;
+ left: 0px;
+ background: lime;
+ width: 10em;
+}
+
+.fixed-container {
+ contain: paint;
+ border: none;
+ padding: 0;
+ margin: 0;
+}
+
+.fixed-container .legend-content {
+ display: block;
+ font-size: 32px;
+ position: fixed;
+ left: 0px;
+ background: lime;
+ width: 10em;
+}
+
+.fieldset-content {
+ background: red;
+ font-size: 32px;
+ width: 10em;
+}
+</style>
+
+<fieldset class="absolute-container">
+ <legend><span class="legend-content">legend</span></legend>
+ <div class="fieldset-content">content</div>
+</fieldset>
+
+<fieldset class="fixed-container">
+ <legend><span class="legend-content">legend</span></legend>
+ <div class="fieldset-content">content</div>
+</fieldset>