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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp

Issue 2502833002: 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerClipper.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/PaintLayerClipper.h" 5 #include "core/paint/PaintLayerClipper.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 #include "core/paint/PaintLayer.h" 10 #include "core/paint/PaintLayer.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 EXPECT_EQ(LayoutRect(0, 0, 200, 400), layerBounds); 110 EXPECT_EQ(LayoutRect(0, 0, 200, 400), layerBounds);
111 111
112 ClipRectsContext contextClip(layer->parent(), PaintingClipRects); 112 ClipRectsContext contextClip(layer->parent(), PaintingClipRects);
113 layer->clipper().calculateRects(contextClip, infiniteRect, layerBounds, 113 layer->clipper().calculateRects(contextClip, infiniteRect, layerBounds,
114 backgroundRect, foregroundRect); 114 backgroundRect, foregroundRect);
115 EXPECT_EQ(LayoutRect(0, 0, 200, 200), backgroundRect.rect()); 115 EXPECT_EQ(LayoutRect(0, 0, 200, 200), backgroundRect.rect());
116 EXPECT_EQ(LayoutRect(0, 0, 200, 200), foregroundRect.rect()); 116 EXPECT_EQ(LayoutRect(0, 0, 200, 200), foregroundRect.rect());
117 EXPECT_EQ(LayoutRect(0, 0, 200, 400), layerBounds); 117 EXPECT_EQ(LayoutRect(0, 0, 200, 400), layerBounds);
118 } 118 }
119 119
120 TEST_F(PaintLayerClipperTest, LocalClipRectFixedUnderTransform) {
121 setBodyInnerHTML(
122 "<div id='transformed'"
123 " style='will-change: transform; width: 100px; height: 100px;"
124 " overflow: hidden'>"
125 " <div id='fixed' "
126 " style='position: fixed; width: 100px; height: 100px;"
127 " top: -50px'>"
128 " </div>"
129 "</div>");
130
131 LayoutRect infiniteRect(LayoutRect::infiniteIntRect());
132 PaintLayer* transformed =
133 toLayoutBoxModelObject(getLayoutObjectByElementId("transformed"))
134 ->layer();
135 PaintLayer* fixed =
136 toLayoutBoxModelObject(getLayoutObjectByElementId("fixed"))->layer();
137
138 EXPECT_EQ(LayoutRect(0, 0, 100, 100),
139 transformed->clipper().localClipRect(transformed));
140 EXPECT_EQ(LayoutRect(0, 50, 100, 100),
141 fixed->clipper().localClipRect(transformed));
142 }
143
120 } // namespace blink 144 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698