Commit 429c5dce authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[BGPT] Fix paint/pagination/composited-paginated-outlined-box.html

For SPv1, we don't fragment a composited or squashed layer, but should
create a single fragment for it under the parent fragment where the
layer's border box starts. Previously we used overflow box to determine
fragments causing the composited/squashed layer to be placed in wrong
parent fragment when the layer has overflows. Now use border box rect
in the case.

Bug: 854192
Cq-Include-Trybots: luci.chromium.try:linux-blink-gen-property-trees;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ib05e8629f423b3a1960de1fc8f3989c42f54766f
Reviewed-on: https://chromium-review.googlesource.com/1180377Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584615}
parent c0ee4f6c
...@@ -256,7 +256,6 @@ crbug.com/853945 fast/block/positioning/rtl-fixed-positioning.html [ Failure ] ...@@ -256,7 +256,6 @@ crbug.com/853945 fast/block/positioning/rtl-fixed-positioning.html [ Failure ]
# Composited multicolumn paints differently. # Composited multicolumn paints differently.
crbug.com/854192 fast/multicol/composited-layer-nested.html [ Failure ] crbug.com/854192 fast/multicol/composited-layer-nested.html [ Failure ]
crbug.com/854192 fast/multicol/vertical-rl/composited-relpos-overlapping-will-change.html [ Failure ] crbug.com/854192 fast/multicol/vertical-rl/composited-relpos-overlapping-will-change.html [ Failure ]
crbug.com/854192 paint/pagination/composited-paginated-outlined-box.html [ Failure ]
Bug(none) fast/dom/scroll-reveal-left-overflow.html [ Failure ] Bug(none) fast/dom/scroll-reveal-left-overflow.html [ Failure ]
Bug(none) fast/dom/scroll-reveal-top-overflow.html [ Failure ] Bug(none) fast/dom/scroll-reveal-top-overflow.html [ Failure ]
......
...@@ -1553,13 +1553,27 @@ static bool IsRepeatingTableSection(const LayoutObject& object) { ...@@ -1553,13 +1553,27 @@ static bool IsRepeatingTableSection(const LayoutObject& object) {
static LayoutRect BoundingBoxInPaginationContainer( static LayoutRect BoundingBoxInPaginationContainer(
const LayoutObject& object, const LayoutObject& object,
const PaintLayer& enclosing_pagination_layer) { const PaintLayer& enclosing_pagination_layer) {
// Non-boxes that have no layer paint in the space of their containing block. // The special path for fragmented layers ensures that the bounding box also
if (!object.IsBox() && !object.HasLayer()) { // covers contents visual overflow, so that the fragments will cover all
// fragments of contents except for self-painting layers, because we initiate
// fragment painting of contents from the layer.
if (object.HasLayer() &&
ToLayoutBoxModelObject(object)
.Layer()
->ShouldFragmentCompositedBounds() &&
// Table section may repeat, and doesn't need the special layer path
// because it doesn't have contents visual overflow.
!object.IsTableSection()) {
return ToLayoutBoxModelObject(object).Layer()->PhysicalBoundingBox(
&enclosing_pagination_layer);
}
// Non-boxes paint in the space of their containing block.
if (!object.IsBox()) {
const LayoutBox& containining_block = *object.ContainingBlock(); const LayoutBox& containining_block = *object.ContainingBlock();
LayoutRect bounds_rect; LayoutRect bounds_rect;
// For non-SVG we can get a more accurate result // For non-SVG we can get a more accurate result with LocalVisualRect,
// with LocalVisualRect, instead of falling back to the bounds of the // instead of falling back to the bounds of the enclosing block.
// enclosing block.
if (!object.IsSVG()) { if (!object.IsSVG()) {
bounds_rect = object.LocalVisualRect(); bounds_rect = object.LocalVisualRect();
containining_block.FlipForWritingMode(bounds_rect); containining_block.FlipForWritingMode(bounds_rect);
...@@ -1571,17 +1585,6 @@ static LayoutRect BoundingBoxInPaginationContainer( ...@@ -1571,17 +1585,6 @@ static LayoutRect BoundingBoxInPaginationContainer(
enclosing_pagination_layer); enclosing_pagination_layer);
} }
// The special path for layers ensures that the bounding box also covers
// contents visual overflow, so that the fragments will cover all fragments of
// contents except for self-painting layers, because we initiate fragment
// painting of contents from the layer.
// Table section may repeat, and doesn't need the special layer path because
// it doesn't have contents visual overflow.
if (object.HasLayer() && !object.IsTableSection()) {
return ToLayoutBoxModelObject(object).Layer()->PhysicalBoundingBox(
&enclosing_pagination_layer);
}
// Compute the bounding box without transforms. // Compute the bounding box without transforms.
// The object is guaranteed to be a box due to the logic above. // The object is guaranteed to be a box due to the logic above.
const LayoutBox& box = ToLayoutBox(object); const LayoutBox& box = ToLayoutBox(object);
...@@ -1991,6 +1994,7 @@ void PaintPropertyTreeBuilder::UpdateCompositedLayerPaginationOffset() { ...@@ -1991,6 +1994,7 @@ void PaintPropertyTreeBuilder::UpdateCompositedLayerPaginationOffset() {
// under the pagination layer. SPv1* doesn't fragment composited layers, // under the pagination layer. SPv1* doesn't fragment composited layers,
// but we still need to set correct pagination offset for correct paint // but we still need to set correct pagination offset for correct paint
// offset calculation. // offset calculation.
DCHECK(!context_.painting_layer->ShouldFragmentCompositedBounds());
FragmentData& first_fragment = FragmentData& first_fragment =
object_.GetMutableForPainting().FirstFragment(); object_.GetMutableForPainting().FirstFragment();
bool is_paint_invalidation_container = object_.IsPaintInvalidationContainer(); bool is_paint_invalidation_container = object_.IsPaintInvalidationContainer();
......
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