Commit 9138bc27 authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

[LayoutNG] Self-painting border-collapsed table cells need to clip.

In the collapsed table borders model, all borders (from the table
itself, table sections, table columns, table rows and table cells) are
painted in the background-and-borders phase of the table. We need
special code to prevent the background of a self-painting-layer
table-cell from overlapping with the borders that have already been
painted. Similar code exists for legacy in TableCellPainter.

Bug: 869878
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I190dd6a152e751f6b30409104fb466ca46bb9024
Reviewed-on: https://chromium-review.googlesource.com/c/1289890
Commit-Queue: David Grogan <dgrogan@chromium.org>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600959}
parent d6c87b31
......@@ -310,7 +310,6 @@ crbug.com/591099 fast/overflow/overflow-update-transform.html [ Failure ]
crbug.com/591099 fast/sub-pixel/sub-pixel-border-2.html [ Failure ]
crbug.com/591099 fast/table/background-gradient-border-collapsed.html [ Failure Pass ]
crbug.com/591099 fast/table/border-collapsing/004-vertical.html [ Failure ]
crbug.com/591099 fast/table/border-collapsing/composited-cell-collapsed-border.html [ Failure ]
crbug.com/591099 fast/table/height-percent-test-vertical.html [ Failure ]
crbug.com/591099 fast/table/unbreakable-images-quirk.html [ Failure ]
crbug.com/591099 fast/text/descent-clip-in-scaled-page.html [ Failure ]
......
......@@ -544,7 +544,15 @@ void NGBoxFragmentPainter::PaintBoxDecorationBackgroundWithRect(
PaintNormalBoxShadow(paint_info, paint_rect, style, border_edges_.line_left,
border_edges_.line_right);
if (BleedAvoidanceIsClipping(box_decoration_data.bleed_avoidance)) {
if (box_fragment_.HasSelfPaintingLayer() && layout_box.IsTableCell() &&
ToLayoutTableCell(layout_box).Table()->ShouldCollapseBorders()) {
// We have to clip here because the background would paint on top of the
// collapsed table borders otherwise, since this is a self-painting layer.
LayoutRect clip_rect = paint_rect;
clip_rect.Expand(ToLayoutTableCell(layout_box).BorderInsets());
state_saver.Save();
paint_info.context.Clip(PixelSnappedIntRect(clip_rect));
} else if (BleedAvoidanceIsClipping(box_decoration_data.bleed_avoidance)) {
state_saver.Save();
FloatRoundedRect border = style.GetRoundedBorderFor(
paint_rect, border_edges_.line_left, border_edges_.line_right);
......
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