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

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

Issue 2828323003: Stop clipping to visual rect bounds in PLC::CalculateBackgroundClipRect (Closed)
Patch Set: none Created 3 years, 8 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 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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 LayoutRect layer_bounds(infinite_rect); 505 LayoutRect layer_bounds(infinite_rect);
506 ClipRect background_rect(infinite_rect); 506 ClipRect background_rect(infinite_rect);
507 ClipRect foreground_rect(infinite_rect); 507 ClipRect foreground_rect(infinite_rect);
508 target->Clipper(option).CalculateRects(context, infinite_rect, layer_bounds, 508 target->Clipper(option).CalculateRects(context, infinite_rect, layer_bounds,
509 background_rect, foreground_rect); 509 background_rect, foreground_rect);
510 510
511 EXPECT_EQ(LayoutRect(-12, -9, 124, 224), background_rect.Rect()); 511 EXPECT_EQ(LayoutRect(-12, -9, 124, 224), background_rect.Rect());
512 EXPECT_EQ(LayoutRect(0, 0, 100, 200), foreground_rect.Rect()); 512 EXPECT_EQ(LayoutRect(0, 0, 100, 200), foreground_rect.Rect());
513 } 513 }
514 514
515 TEST_P(PaintLayerClipperTest, CalculateBackgroundClipRectRoot) {
516 SetBodyInnerHTML(
517 "<style>"
518 " * { margin: 0 }"
519 " #target { "
520 " position: relative; "
521 " overflow: hidden;"
522 " width: 100px; height: 200px;"
523 " }"
524 "</style>"
525 "<div id='target'></div>");
526
527 PaintLayer* target =
528 ToLayoutBoxModelObject(GetLayoutObjectByElementId("target"))->Layer();
529 ClipRectsContext context(target, kUncachedClipRects);
530 PaintLayer::GeometryMapperOption option = PaintLayer::kDoNotUseGeometryMapper;
531 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
532 option = PaintLayer::kUseGeometryMapper;
533 ClipRect output;
534
535 target->Clipper(option).CalculateBackgroundClipRect(context, output);
536 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
537 EXPECT_EQ(LayoutRect(FloatRect(LayoutRect::InfiniteIntRect())),
538 output.Rect());
539 } else {
540 EXPECT_EQ(LayoutRect(LayoutRect::InfiniteIntRect()), output.Rect());
541 }
542 }
543
515 } // namespace blink 544 } // 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