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

Side by Side 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 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/PaintLayer.h" 5 #include "core/paint/PaintLayer.h"
6 6
7 #include "core/layout/LayoutBoxModelObject.h" 7 #include "core/layout/LayoutBoxModelObject.h"
8 #include "core/layout/LayoutTestHelper.h" 8 #include "core/layout/LayoutTestHelper.h"
9 #include "core/layout/LayoutView.h" 9 #include "core/layout/LayoutView.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 using PaintLayerTest = RenderingTest; 13 using PaintLayerTest = RenderingTest;
14 14
15 TEST_F(PaintLayerTest, CompositedBoundsAbsPosGrandchild) {
16 setBodyInnerHTML(
17 " <div id='parent'><div id='absposparent'><div id='absposchild'>"
18 " </div></div></div>"
19 "<style>"
20 " #parent { position: absolute; z-index: 0; overflow: hidden;"
21 " background: lightgray; width: 150px; height: 150px;"
22 " will-change: transform; }"
23 " #absposparent { position: absolute; z-index: 0; }"
24 " #absposchild { position: absolute; top: 0px; left: 0px; height: 200px;"
25 " width: 200px; background: lightblue; }</style>");
26
27 PaintLayer* parentLayer =
28 toLayoutBoxModelObject(getLayoutObjectByElementId("parent"))->layer();
29 // Since "absposchild" is clipped by "parent", it should not expand the
30 // composited bounds for "parent" beyond its intrinsic size of 150x150.
31 EXPECT_EQ(LayoutRect(0, 0, 150, 150),
32 parentLayer->boundingBoxForCompositing());
33 }
34
15 TEST_F(PaintLayerTest, PaintingExtentReflection) { 35 TEST_F(PaintLayerTest, PaintingExtentReflection) {
16 setBodyInnerHTML( 36 setBodyInnerHTML(
17 "<div id='target' style='background-color: blue; position: absolute;" 37 "<div id='target' style='background-color: blue; position: absolute;"
18 " width: 110px; height: 120px; top: 40px; left: 60px;" 38 " width: 110px; height: 120px; top: 40px; left: 60px;"
19 " -webkit-box-reflect: below 3px'>" 39 " -webkit-box-reflect: below 3px'>"
20 "</div>"); 40 "</div>");
21 41
22 PaintLayer* layer = 42 PaintLayer* layer =
23 toLayoutBoxModelObject(getLayoutObjectByElementId("target"))->layer(); 43 toLayoutBoxModelObject(getLayoutObjectByElementId("target"))->layer();
24 EXPECT_EQ( 44 EXPECT_EQ(
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 scrollLayer->getScrollableArea()->setScrollOffset(ScrollOffset(1000, 1000), 106 scrollLayer->getScrollableArea()->setScrollOffset(ScrollOffset(1000, 1000),
87 ProgrammaticScroll); 107 ProgrammaticScroll);
88 document().view()->updateAllLifecyclePhasesExceptPaint(); 108 document().view()->updateAllLifecyclePhasesExceptPaint();
89 EXPECT_EQ(LayoutPoint(-1000, -1000), contentLayer->location()); 109 EXPECT_EQ(LayoutPoint(-1000, -1000), contentLayer->location());
90 EXPECT_TRUE(contentLayer->needsRepaint()); 110 EXPECT_TRUE(contentLayer->needsRepaint());
91 EXPECT_TRUE(scrollLayer->needsRepaint()); 111 EXPECT_TRUE(scrollLayer->needsRepaint());
92 document().view()->updateAllLifecyclePhases(); 112 document().view()->updateAllLifecyclePhases();
93 } 113 }
94 114
95 } // namespace blink 115 } // namespace blink
OLDNEW
« 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