| Index: third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp b/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
|
| index 16266d3b97fb408ee2fbec9f287f161d88745d05..9e1e877955fd6e6b41ff33cdf5abeec117281947 100644
|
| --- a/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
|
| @@ -20,8 +20,11 @@ protected:
|
| void checkPaintInvalidationStateRectMapping(const LayoutRect& expectedRect, const LayoutRect& rect, const LayoutObject& object, const LayoutView& layoutView, const LayoutObject& paintInvalidationContainer)
|
| {
|
| Vector<const LayoutObject*> ancestors;
|
| - for (const LayoutObject* ancestor = &object; ancestor != layoutView; ancestor = ancestor->parentCrossingFrameBoundaries())
|
| + LOG(ERROR) << "checkPaintInvalidationStateRectMapping";
|
| + for (const LayoutObject* ancestor = &object; ancestor != layoutView; ancestor = ancestor->parentCrossingFrameBoundaries()) {
|
| ancestors.append(ancestor);
|
| + // ancestor->showLayoutObject();
|
| + }
|
|
|
| Vector<Optional<PaintInvalidationState>> paintInvalidationStates(ancestors.size() + 1);
|
| Vector<LayoutObject*> pendingDelayedPaintInvalidations;
|
| @@ -447,7 +450,7 @@ TEST_F(VisualRectMappingTest, ContainerAndTargetDifferentFlippedWritingMode)
|
| EXPECT_EQ(LayoutRect(-2, 3, 140, 110), rect);
|
| }
|
|
|
| -TEST_F(VisualRectMappingTest, DifferentPaintInvalidaitionContainerForAbsolutePosition)
|
| +TEST_F(VisualRectMappingTest, DifferentPaintInvalidationContainerForAbsolutePosition)
|
| {
|
| enableCompositing();
|
| document().frame()->settings()->setPreferCompositingToLCDTextEnabled(true);
|
| @@ -519,4 +522,33 @@ TEST_F(VisualRectMappingTest, ContainerOfAbsoluteAbovePaintInvalidationContainer
|
| checkPaintInvalidationStateRectMapping(rect, absoluteOverflowRect, *absolute, layoutView(), *stackingContext);
|
| }
|
|
|
| +TEST_F(VisualRectMappingTest, Transform2D)
|
| +{
|
| + enableCompositing();
|
| + document().frame()->settings()->setPreferCompositingToLCDTextEnabled(true);
|
| + setBodyInnerHTML(
|
| + "<div id='target' style='transform: translate(200px, 200px) rotatez(45deg); width: 200px; height: 200px; background: lightgray'>"
|
| + "</div>");
|
| +
|
| + LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target"));
|
| + LayoutRect rect(target->frameRect());
|
| + EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect));
|
| + checkPaintInvalidationStateRectMapping(rect, target->frameRect(), *target, layoutView(), layoutView());
|
| +}
|
| +
|
| +TEST_F(VisualRectMappingTest, Transform2DChild)
|
| +{
|
| + enableCompositing();
|
| + document().frame()->settings()->setPreferCompositingToLCDTextEnabled(true);
|
| + setBodyInnerHTML(
|
| + "<div style='transform: translate(200px, 200px) rotatez(45deg); width: 200px; height: 200px; background: lightgray'>"
|
| + " <div id='target' style='width: 50px; height: 50px; position: relative; top: 25px; left: 25px'></div>"
|
| + "</div>");
|
| +
|
| + LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target"));
|
| + LayoutRect rect(target->frameRect());
|
| + EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect));
|
| +
|
| + checkPaintInvalidationStateRectMapping(rect, target->frameRect(), *target, layoutView(), layoutView());
|
| +}
|
| } // namespace blink
|
|
|