| Index: third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
|
| index 19ae3988e697a2c12509ca68ef72f648931f95f4..b868c3ca60069e9a3632b9fa4d4961be5b4cc3c6 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
|
| @@ -15,11 +15,11 @@
|
| namespace blink {
|
|
|
| class PaintLayerClipperTest : public ::testing::WithParamInterface<bool>,
|
| - private ScopedSlimmingPaintV2ForTest,
|
| + private ScopedSlimmingPaintInvalidationForTest,
|
| public RenderingTest {
|
| public:
|
| PaintLayerClipperTest()
|
| - : ScopedSlimmingPaintV2ForTest(GetParam()),
|
| + : ScopedSlimmingPaintInvalidationForTest(GetParam()),
|
| RenderingTest(EmptyLocalFrameClient::create()) {}
|
|
|
| void SetUp() override {
|
| @@ -63,8 +63,16 @@ TEST_P(PaintLayerClipperTest, LayoutSVGRoot) {
|
| targetPaintLayer->clipper(option).calculateRects(
|
| context, LayoutRect(LayoutRect::infiniteIntRect()), layerBounds,
|
| backgroundRect, foregroundRect);
|
| - EXPECT_EQ(LayoutRect(FloatRect(8.25, 8.35, 200, 300)), backgroundRect.rect());
|
| - EXPECT_EQ(LayoutRect(FloatRect(8.25, 8.35, 200, 300)), foregroundRect.rect());
|
| + // TODO(chrishtr): investigate why these differences exist.
|
| + if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
|
| + EXPECT_EQ(LayoutRect(FloatRect(8.25, 8.35, 200, 300)),
|
| + backgroundRect.rect());
|
| + EXPECT_EQ(LayoutRect(FloatRect(8.25, 8.35, 200, 300)),
|
| + foregroundRect.rect());
|
| + } else {
|
| + EXPECT_EQ(LayoutRect(FloatRect(8, 8, 200, 300)), backgroundRect.rect());
|
| + EXPECT_EQ(LayoutRect(FloatRect(8, 8, 200, 300)), foregroundRect.rect());
|
| + }
|
| EXPECT_EQ(LayoutRect(8, 8, 200, 300), layerBounds);
|
| }
|
|
|
| @@ -447,4 +455,31 @@ TEST_P(PaintLayerClipperTest, ClearClipRectsRecursiveOneType) {
|
| EXPECT_FALSE(parent->clipRectsCache()->get(AbsoluteClipRects).root);
|
| }
|
|
|
| +TEST_P(PaintLayerClipperTest, CSSClip) {
|
| + setBodyInnerHTML(
|
| + "<style>"
|
| + " #target { "
|
| + " width: 400px; height: 400px; position: absolute;"
|
| + " clip: rect(0, 50px, 100px, 0); "
|
| + " }"
|
| + "</style>"
|
| + "<div id='target'></div>");
|
| +
|
| + PaintLayer* target =
|
| + toLayoutBoxModelObject(getLayoutObjectByElementId("target"))->layer();
|
| + ClipRectsContext context(target, UncachedClipRects);
|
| + PaintLayer::GeometryMapperOption option = PaintLayer::DoNotUseGeometryMapper;
|
| + if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
|
| + option = PaintLayer::UseGeometryMapper;
|
| + LayoutRect infiniteRect(LayoutRect::infiniteIntRect());
|
| + LayoutRect layerBounds(infiniteRect);
|
| + ClipRect backgroundRect(infiniteRect);
|
| + ClipRect foregroundRect(infiniteRect);
|
| + target->clipper(option).calculateRects(context, infiniteRect, layerBounds,
|
| + backgroundRect, foregroundRect);
|
| +
|
| + EXPECT_EQ(LayoutRect(0, 0, 50, 100), backgroundRect.rect());
|
| + EXPECT_EQ(LayoutRect(0, 0, 50, 100), foregroundRect.rect());
|
| +}
|
| +
|
| } // namespace blink
|
|
|