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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerTest.cpp

Issue 2521033003: Reland: Don't early out recursion into PaintLayerChildren when computing composited bounds. (Closed)
Patch Set: none Created 4 years, 1 month 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/paint/PaintLayerClipperTest.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/paint/PaintLayerTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
index 2bc81e53c895e933ce018777509a908b8febfc49..f06dd39a3603f2865d2cf3113733169bad58f0d2 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp
@@ -12,6 +12,26 @@ namespace blink {
using PaintLayerTest = RenderingTest;
+TEST_F(PaintLayerTest, CompositedBoundsAbsPosGrandchild) {
+ setBodyInnerHTML(
+ " <div id='parent'><div id='absposparent'><div id='absposchild'>"
+ " </div></div></div>"
+ "<style>"
+ " #parent { position: absolute; z-index: 0; overflow: hidden;"
+ " background: lightgray; width: 150px; height: 150px;"
+ " will-change: transform; }"
+ " #absposparent { position: absolute; z-index: 0; }"
+ " #absposchild { position: absolute; top: 0px; left: 0px; height: 200px;"
+ " width: 200px; background: lightblue; }</style>");
+
+ PaintLayer* parentLayer =
+ toLayoutBoxModelObject(getLayoutObjectByElementId("parent"))->layer();
+ // Since "absposchild" is clipped by "parent", it should not expand the
+ // composited bounds for "parent" beyond its intrinsic size of 150x150.
+ EXPECT_EQ(LayoutRect(0, 0, 150, 150),
+ parentLayer->boundingBoxForCompositing());
+}
+
TEST_F(PaintLayerTest, PaintingExtentReflection) {
setBodyInnerHTML(
"<div id='target' style='background-color: blue; position: absolute;"
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698