Commit f327d5d6 authored by Vladimir Levin's avatar Vladimir Levin Committed by Commit Bot

DL: Don't consider the legend when painting display-locked fieldset border.

This patch ensures that we don't consider the legend when painting
the fieldset border, since the legend may be out of date and is considered
a child of the fieldset (meaning we have to not paint it).

Also updates the fieldset tests to do a double raf before running the test
to ensure that everything is parsed and rendered.

R=chrishtr@chromium.org, rakina@chromium.org

Bug: 993755
Change-Id: I0f27ad0242ceaa76d00513aa14e94aef5ddfb04f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1754702Reviewed-by: default avatarRakina Zata Amni <rakina@chromium.org>
Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#687328}
parent 300c55ff
...@@ -38,7 +38,7 @@ void FieldsetPainter::PaintBoxDecorationBackground( ...@@ -38,7 +38,7 @@ void FieldsetPainter::PaintBoxDecorationBackground(
const PhysicalOffset& paint_offset) { const PhysicalOffset& paint_offset) {
PhysicalRect paint_rect(paint_offset, layout_fieldset_.Size()); PhysicalRect paint_rect(paint_offset, layout_fieldset_.Size());
LayoutBox* legend = layout_fieldset_.FindInFlowLegend(); LayoutBox* legend = layout_fieldset_.FindInFlowLegend();
if (!legend) { if (!legend || paint_info.DescendantPaintingBlocked()) {
return BoxPainter(layout_fieldset_) return BoxPainter(layout_fieldset_)
.PaintBoxDecorationBackground(paint_info, paint_offset); .PaintBoxDecorationBackground(paint_info, paint_offset);
} }
...@@ -102,7 +102,7 @@ void FieldsetPainter::PaintMask(const PaintInfo& paint_info, ...@@ -102,7 +102,7 @@ void FieldsetPainter::PaintMask(const PaintInfo& paint_info,
PhysicalRect paint_rect(paint_offset, layout_fieldset_.Size()); PhysicalRect paint_rect(paint_offset, layout_fieldset_.Size());
LayoutBox* legend = layout_fieldset_.FindInFlowLegend(); LayoutBox* legend = layout_fieldset_.FindInFlowLegend();
if (!legend) if (!legend || paint_info.DescendantPaintingBlocked())
return BoxPainter(layout_fieldset_).PaintMask(paint_info, paint_offset); return BoxPainter(layout_fieldset_).PaintMask(paint_info, paint_offset);
if (DrawingRecorder::UseCachedDrawingIfPossible( if (DrawingRecorder::UseCachedDrawingIfPossible(
......
...@@ -31,7 +31,7 @@ async function runTest() { ...@@ -31,7 +31,7 @@ async function runTest() {
takeScreenshot(); takeScreenshot();
} }
window.onload = runTest; window.onload = requestAnimationFrame(() => requestAnimationFrame(runTest));
</script> </script>
</html> </html>
...@@ -28,7 +28,7 @@ async function runTest() { ...@@ -28,7 +28,7 @@ async function runTest() {
takeScreenshot(); takeScreenshot();
} }
window.onload = runTest; window.onload = requestAnimationFrame(() => requestAnimationFrame(runTest));
</script> </script>
</html> </html>
...@@ -31,7 +31,7 @@ async function runTest() { ...@@ -31,7 +31,7 @@ async function runTest() {
takeScreenshot(); takeScreenshot();
} }
window.onload = runTest; window.onload = requestAnimationFrame(() => requestAnimationFrame(runTest));
</script> </script>
</html> </html>
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
<title>Display Locking: fieldset with legend</title> <title>Display Locking: fieldset with legend</title>
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org"> <link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
<link rel="help" href="https://github.com/WICG/display-locking"> <link rel="help" href="https://github.com/WICG/display-locking">
<!-- The legend should be ignored when sizing, resulting in the same ref as empty -->
<link rel="match" href="fieldset-empty-ref.html"> <link rel="match" href="fieldset-empty-ref.html">
<script src="/common/reftest-wait.js"></script> <script src="/common/reftest-wait.js"></script>
...@@ -31,7 +30,7 @@ async function runTest() { ...@@ -31,7 +30,7 @@ async function runTest() {
takeScreenshot(); takeScreenshot();
} }
window.onload = runTest; window.onload = requestAnimationFrame(() => requestAnimationFrame(runTest));
</script> </script>
</html> </html>
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