Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(900)

Unified Diff: third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp

Issue 2000053002: WIP: Reset paint invalidation at transform boundaries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698