Commit 4fa26a04 authored by Alison Maher's avatar Alison Maher Committed by Commit Bot

[LayoutNG] Update legends from getting painted atomically

Legends were getting painted atomically via
NGFieldsetPainter::PaintLegend(). This is not according to the spec:
https://html.spec.whatwg.org/#the-fieldset-and-legend-elements.

Removing the atomic painting of legends also fixes crashing issues in
which floating children of legends were getting painted twice.

This change adds several test failures to the TestExpectations file.
These failures, however, are temporary and will be fixed in a
soon-to-follow CL:
https://chromium-review.googlesource.com/c/chromium/src/+/2042146

Bug: 875235
Change-Id: I2b9dbc438ba241bcf72eca316ec65aa2f1edc635
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2045194
Commit-Queue: Alison Maher <almaher@microsoft.com>
Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740147}
parent 489ce728
......@@ -32,11 +32,6 @@ void NGFieldsetPainter::PaintBoxDecorationBackground(
// Paint the fieldset (background, other decorations, and) border, with the
// cutout hole for the legend.
PaintFieldsetDecorationBackground(legend, paint_info, paint_offset);
// Proceed to painting the legend. According to the spec, it should be done as
// part of the border phase.
if (legend)
PaintLegend(To<NGPhysicalBoxFragment>(**legend), paint_info);
}
void NGFieldsetPainter::PaintFieldsetDecorationBackground(
......@@ -103,16 +98,4 @@ void NGFieldsetPainter::PaintFieldsetDecorationBackground(
}
}
void NGFieldsetPainter::PaintLegend(const NGPhysicalBoxFragment& legend,
const PaintInfo& paint_info) {
// Unless the legend establishes its own self-painting layer, paint the legend
// as part of the border phase, according to spec.
const LayoutObject* legend_object = legend.GetLayoutObject();
if (ToLayoutBox(legend_object)->HasSelfPaintingLayer())
return;
PaintInfo legend_paint_info = paint_info;
legend_paint_info.phase = PaintPhase::kForeground;
ObjectPainter(*legend_object).PaintAllPhasesAtomically(legend_paint_info);
}
} // namespace blink
......@@ -27,7 +27,6 @@ class NGFieldsetPainter {
void PaintFieldsetDecorationBackground(const NGLink* legend,
const PaintInfo&,
const PhysicalOffset&);
void PaintLegend(const NGPhysicalBoxFragment& legend, const PaintInfo&);
const NGPhysicalBoxFragment& fieldset_;
};
......
......@@ -335,6 +335,9 @@ crbug.com/591099 external/wpt/quirks/line-height-trailing-collapsable-whitespace
### fast/css/
crbug.com/591099 fast/css/absolute-inline-alignment-2.html [ Failure ]
### external/wpt/html/rendering
crbug.com/875235 external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-painting-order.html [ Failure ]
### virtual/text-antialias/
crbug.com/591099 virtual/text-antialias/justify-ideograph-simple.html [ Failure ]
......
......@@ -689,11 +689,9 @@ crbug.com/847274 virtual/layout_ng_fieldset/external/wpt/css/css-contain/contain
crbug.com/880802 virtual/layout_ng_fieldset/external/wpt/css/css-contain/contain-paint-021.html [ Failure ]
crbug.com/882367 virtual/layout_ng_fieldset/external/wpt/css/css-contain/contain-paint-clip-015.html [ Failure ]
crbug.com/882367 virtual/layout_ng_fieldset/external/wpt/css/css-contain/contain-paint-clip-016.html [ Failure ]
crbug.com/845235 virtual/layout_ng_fieldset/external/wpt/css/css-contain/contain-size-flexbox-001.html [ Failure ]
crbug.com/955170 virtual/layout_ng_fieldset/external/wpt/css/css-contain/contain-size-replaced-003a.html [ Failure ]
crbug.com/955163 virtual/layout_ng_fieldset/external/wpt/css/css-contain/contain-size-replaced-003b.html [ Failure ]
crbug.com/955163 virtual/layout_ng_fieldset/external/wpt/css/css-contain/contain-size-replaced-003c.html [ Failure ]
crbug.com/845235 virtual/layout_ng_fieldset/external/wpt/css/css-contain/contain-size-scrollbars-002.html [ Failure ]
crbug.com/882383 virtual/layout_ng_fieldset/external/wpt/css/css-contain/counter-scoping-001.html [ Failure ]
crbug.com/882383 virtual/layout_ng_fieldset/external/wpt/css/css-contain/counter-scoping-002.html [ Failure ]
crbug.com/882383 virtual/layout_ng_fieldset/external/wpt/css/css-contain/counter-scoping-003.html [ Failure ]
......@@ -706,8 +704,6 @@ crbug.com/881057 [ Mac ] virtual/layout_ng_fieldset/external/wpt/css/vendor-impo
crbug.com/881057 [ Mac ] virtual/layout_ng_fieldset/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-paint-clip-005.html [ Failure ]
crbug.com/880802 virtual/layout_ng_fieldset/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-paint-ignored-cases-ruby-stacking-and-clipping-001.html [ Failure ]
crbug.com/965491 virtual/layout_ng_fieldset/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-size-fieldset-002.html [ Failure ]
crbug.com/845235 virtual/layout_ng_fieldset/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-size-flex-001.html [ Failure ]
crbug.com/845235 virtual/layout_ng_fieldset/external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-size-inline-flex-001.html [ Failure ]
# [css-align]
......@@ -1573,27 +1569,30 @@ crbug.com/782948 virtual/layout_ng_flex_box/external/wpt/css/css-flexbox/table-a
# Fieldset in NG
#
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-border-gap-position-relative.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-containing-block.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-overflow.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-painting-order.html [ Failure Crash ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-overflow-hidden.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-painting-order.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-percentage-block-size.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-transform-translatez.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-vertical.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-align.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-auto-margins.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-block-formatting-context.html [ Crash ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-block-margins.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-block-margins-2.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-display-rendering.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-list-item-numbering.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-list-item.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-list-item-numbering.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-margin-inline.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-tall.html [ Failure ]
### virtual/layout_ng_fieldset/fast/forms/fieldset/
crbug.com/875235 virtual/layout_ng_fieldset/fast/forms/fieldset/fieldset-align.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/fast/forms/fieldset/fieldset-legend-change.html [ Crash ]
crbug.com/875235 virtual/layout_ng_fieldset/fast/forms/fieldset/fieldset-legend-padding-unclipped-fieldset-border.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/fast/forms/fieldset/float-before-fieldset.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/fast/forms/fieldset/legend-after-margin-with-before-border-horizontal-mode.html [ Failure ]
crbug.com/875235 virtual/layout_ng_fieldset/fast/forms/fieldset/legend-small-after-margin-before-border-horizontal-mode.html [ Failure ]
# ====== LayoutNG-only failures until here ======
......
<!doctype html>
<title>Reference for fieldset painting order</title>
<p>There should be a green square below, and no red.</p>
<div style="width:100px; height:100px; background:green;"></div>
<!doctype html>
<title>Legend painting order</title>
<link rel=match href=legend-painting-order-ref.html>
<p>There should be a green square below, and no red.</p>
<div style="float:left; width:0px; height:0px;">
<div style="width:100px; height:100px; background:red;"></div>
</div>
<fieldset style="margin:0; border:none; padding:0;">
<legend style="padding:0;">
<div style="float:left; width:100px; height:100px; background:green;"></div>
</legend>
</fieldset>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment