Commit 1125e910 authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

[LayoutNG] Fix disable_flip logic in PaintInvalidator::MapLocalRectToVisualRectInBacking

The disable_flip added in CL:960403 mistakenly disables inclusion
of LocalClipPathBoundingBox. This patch fixes the logic only to
disable block flipping.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I6617ddf1d852cd9d98dcaa86d6926d01a5e7af8c
Reviewed-on: https://chromium-review.googlesource.com/1013805Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551265}
parent 1a19c914
......@@ -72,18 +72,21 @@ LayoutRect PaintInvalidator::MapLocalRectToVisualRectInBacking(
// coordinates.
Rect rect = local_rect;
// Writing-mode flipping doesn't apply to non-root SVG.
if (!is_svg_child && !disable_flip) {
if (object.IsBox()) {
ToLayoutBox(object).FlipForWritingMode(rect);
} else if (!(context.subtree_flags &
PaintInvalidatorContext::kSubtreeSlowPathRect)) {
// For SPv2 and the GeometryMapper path, we also need to convert the rect
// for non-boxes into physical coordinates before applying paint offset.
// (Otherwise we'll call mapToVisualrectInAncestorSpace() which requires
// physical coordinates for boxes, but "physical coordinates with flipped
// block-flow direction" for non-boxes for which we don't need to flip.)
// TODO(wangxianzhu): Avoid containingBlock().
object.ContainingBlock()->FlipForWritingMode(rect);
if (!is_svg_child) {
if (!disable_flip) {
if (object.IsBox()) {
ToLayoutBox(object).FlipForWritingMode(rect);
} else if (!(context.subtree_flags &
PaintInvalidatorContext::kSubtreeSlowPathRect)) {
// For SPv2 and the GeometryMapper path, we also need to convert the
// rect for non-boxes into physical coordinates before applying paint
// offset. (Otherwise we'll call mapToVisualrectInAncestorSpace() which
// requires physical coordinates for boxes, but "physical coordinates
// with flipped block-flow direction" for non-boxes for which we don't
// need to flip.)
// TODO(wangxianzhu): Avoid containingBlock().
object.ContainingBlock()->FlipForWritingMode(rect);
}
}
// Unite visual rect with clip path bounding rect.
......
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