Commit f7d4bd8a authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Fieldset NG: Do not miss to paint a LEGEND with position:relative and

overflow:hidden

In PaintLayerPainter, a layer bounding rectangle for a such LEGEND was
incorrect, and nothing was painted if the anonymous fieldset content
box has a layer.

This CL fixes the issue by handling a rendered LEGEND in
PaintLayer::ContainingLayer().

Bug: 1151295
Change-Id: If133d9179d8ab4c70d9b958aef61cedf547f704f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2556626
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830799}
parent c38ae4cd
...@@ -908,8 +908,10 @@ PaintLayer* PaintLayer::ContainingLayer(const PaintLayer* ancestor, ...@@ -908,8 +908,10 @@ PaintLayer* PaintLayer::ContainingLayer(const PaintLayer* ancestor,
// inline parent to find the actual containing layer through the containing // inline parent to find the actual containing layer through the containing
// block chain. // block chain.
// Column span need to find the containing layer through its containing block. // Column span need to find the containing layer through its containing block.
// A rendered legend needs to find the containing layer through its containing
// block to skip anonymous fieldset content box.
if ((!Parent() || Parent()->GetLayoutObject().IsLayoutBlock()) && if ((!Parent() || Parent()->GetLayoutObject().IsLayoutBlock()) &&
!layout_object.IsColumnSpanAll()) !layout_object.IsColumnSpanAll() && !layout_object.IsRenderedLegend())
return Parent(); return Parent();
// This is a universal approach to find containing layer, but is slower than // This is a universal approach to find containing layer, but is slower than
......
...@@ -421,6 +421,7 @@ crbug.com/591099 external/wpt/html/rendering/non-replaced-elements/the-fieldset- ...@@ -421,6 +421,7 @@ crbug.com/591099 external/wpt/html/rendering/non-replaced-elements/the-fieldset-
crbug.com/591099 external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-overflow.html [ Crash Failure ] crbug.com/591099 external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-overflow.html [ Crash Failure ]
crbug.com/591099 external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-vertical.html [ Failure ] crbug.com/591099 external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-vertical.html [ Failure ]
crbug.com/875235 external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-painting-order.html [ Failure ] crbug.com/875235 external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-painting-order.html [ Failure ]
crbug.com/1151295 external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-position-relative-2.html [ Failure ]
### virtual/text-antialias/ ### virtual/text-antialias/
crbug.com/591099 virtual/text-antialias/justify-ideograph-simple.html [ Failure ] crbug.com/591099 virtual/text-antialias/justify-ideograph-simple.html [ Failure ]
......
<!DOCTYPE html>
<title>Reference for legend position: relative</title>
<style>
#fieldset2 {
background: lime;
border: 2px solid lime;
width: 200px;
padding: 0;
margin: 0;
}
#legend2 {
background: #00ffff;
}
</style>
<p>"Legend" should be shown.</p>
<fieldset id="fieldset2"><legend id="legend2">Legend</legend></fieldset>
<!DOCTYPE html>
<title>legend position: relative</title>
<link ref=help href="http://crbug.com/1151295">
<link rel=match href=legend-position-relative-2-ref.html>
<style>
#fieldset2 {
background: lime;
border: 2px solid lime;
width: 200px;
padding: 0;
margin: 0;
overflow: hidden;
}
#legend2 {
position: relative;
overflow: hidden;
background: #00ffff;
}
</style>
<p>"Legend" should be shown.</p>
<fieldset id="fieldset2"><legend id="legend2">Legend</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