Commit c0fdc9ba authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

Fix typo leading to double-calls to mapToVisualRectInAncestorSpace.

This was accidentally introduced by https://codereview.chromium.org/2727093002.
It affects only LayoutViews for iframes that end up in the slow path for
paint invalidation, which is only for content under filter or multicolumn.

Bug: 750925
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I9a183e0151f584e299134ba3091c440a7d24f0d1
Reviewed-on: https://chromium-review.googlesource.com/599113
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491605}
parent fd0d247e
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
#include "core/paint/BoxPaintInvalidator.h" #include "core/paint/BoxPaintInvalidator.h"
#include "core/HTMLNames.h" #include "core/HTMLNames.h"
#include "core/frame/FrameTestHelpers.h"
#include "core/frame/LocalFrameView.h" #include "core/frame/LocalFrameView.h"
#include "core/html/HTMLFrameOwnerElement.h"
#include "core/layout/LayoutTestHelper.h" #include "core/layout/LayoutTestHelper.h"
#include "core/layout/LayoutView.h" #include "core/layout/LayoutView.h"
#include "core/paint/PaintInvalidator.h" #include "core/paint/PaintInvalidator.h"
...@@ -115,6 +117,33 @@ class BoxPaintInvalidatorTest : public ::testing::WithParamInterface<bool>, ...@@ -115,6 +117,33 @@ class BoxPaintInvalidatorTest : public ::testing::WithParamInterface<bool>,
INSTANTIATE_TEST_CASE_P(All, BoxPaintInvalidatorTest, ::testing::Bool()); INSTANTIATE_TEST_CASE_P(All, BoxPaintInvalidatorTest, ::testing::Bool());
TEST_P(BoxPaintInvalidatorTest, SlowMapToVisualRectInAncestorSpaceLayoutView) {
SetBodyInnerHTML(
"<!doctype html>"
"<style>"
"#parent {"
" display: inline-block;"
" width: 300px;"
" height: 300px;"
" margin-top: 200px;"
" filter: blur(3px);" // Forces the slow path in
// SlowMapToVisualRectInAncestorSpace.
" border: 1px solid rebeccapurple;"
"}"
"</style>"
"<div id=parent>"
" <iframe id='target' src='data:text/html,<body style='background: "
"blue;'></body>'></iframe>"
"</div>");
auto& target = *GetDocument().getElementById("target");
EXPECT_RECT_EQ(IntRect(2, 202, 318, 168),
EnclosingIntRect(ToHTMLFrameOwnerElement(target)
.contentDocument()
->GetLayoutView()
->VisualRect()));
}
TEST_P(BoxPaintInvalidatorTest, ComputePaintInvalidationReasonPaintingNothing) { TEST_P(BoxPaintInvalidatorTest, ComputePaintInvalidationReasonPaintingNothing) {
ScopedSlimmingPaintV2ForTest spv2(true); ScopedSlimmingPaintV2ForTest spv2(true);
......
...@@ -38,9 +38,9 @@ static LayoutRect SlowMapToVisualRectInAncestorSpace( ...@@ -38,9 +38,9 @@ static LayoutRect SlowMapToVisualRectInAncestorSpace(
if (object.IsLayoutView()) { if (object.IsLayoutView()) {
ToLayoutView(object).MapToVisualRectInAncestorSpace( ToLayoutView(object).MapToVisualRectInAncestorSpace(
&ancestor, result, kInputIsInFrameCoordinates, kDefaultVisualRectFlags); &ancestor, result, kInputIsInFrameCoordinates, kDefaultVisualRectFlags);
} else {
object.MapToVisualRectInAncestorSpace(&ancestor, result);
} }
object.MapToVisualRectInAncestorSpace(&ancestor, result);
return result; return result;
} }
......
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