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

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

Issue 2682933002: Fix PaintLayer::compositingContainer for self-painting non-stacked layers (Closed)
Patch Set: Created 3 years, 10 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/PaintLayer.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/html/HTMLIFrameElement.h" 7 #include "core/html/HTMLIFrameElement.h"
8 #include "core/layout/LayoutBoxModelObject.h" 8 #include "core/layout/LayoutBoxModelObject.h"
9 #include "core/layout/LayoutTestHelper.h" 9 #include "core/layout/LayoutTestHelper.h"
10 #include "core/layout/LayoutView.h" 10 #include "core/layout/LayoutView.h"
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 ->layer(); 656 ->layer();
657 657
658 // enclosingLayerWithCompositedLayerMapping is not needed or applicable to 658 // enclosingLayerWithCompositedLayerMapping is not needed or applicable to
659 // SPv2. 659 // SPv2.
660 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 660 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
661 EXPECT_EQ(compositedContainer, 661 EXPECT_EQ(compositedContainer,
662 target->enclosingLayerWithCompositedLayerMapping(ExcludeSelf)); 662 target->enclosingLayerWithCompositedLayerMapping(ExcludeSelf));
663 } 663 }
664 } 664 }
665 665
666 TEST_P(PaintLayerTest, CompositingContainerSelfPaintingNonStackedFloat) {
667 setBodyInnerHTML(
668 "<div id='container' style='position: relative'>"
669 " <span id='span' style='opacity: 0.9'>"
670 " <div id='target' style='columns: 1; float: left'></div>"
chrishtr 2017/02/08 16:56:20 Add a comment that this is testing a non-stacked,
Xianzhu 2017/02/09 01:21:55 Done.
671 " </span>"
672 "</div>");
673
674 PaintLayer* target =
675 toLayoutBoxModelObject(getLayoutObjectByElementId("target"))->layer();
676 PaintLayer* container =
677 toLayoutBoxModelObject(getLayoutObjectByElementId("container"))->layer();
678 PaintLayer* span =
679 toLayoutBoxModelObject(getLayoutObjectByElementId("span"))->layer();
680 EXPECT_EQ(container, target->containingLayer());
681 EXPECT_EQ(span, target->compositingContainer());
682 }
683
666 TEST_P(PaintLayerTest, ColumnSpanLayerUnderExtraLayerScrolled) { 684 TEST_P(PaintLayerTest, ColumnSpanLayerUnderExtraLayerScrolled) {
667 setBodyInnerHTML( 685 setBodyInnerHTML(
668 "<div id='columns' style='overflow: hidden; width: 80px; height: 80px; " 686 "<div id='columns' style='overflow: hidden; width: 80px; height: 80px; "
669 " columns: 2; column-gap: 0'>" 687 " columns: 2; column-gap: 0'>"
670 " <div id='extraLayer'" 688 " <div id='extraLayer'"
671 " style='position: relative; top: 100px; left: 100px'>" 689 " style='position: relative; top: 100px; left: 100px'>"
672 " <div id='spanner' style='column-span: all; position: relative; " 690 " <div id='spanner' style='column-span: all; position: relative; "
673 " top: 50px; left: 50px'>" 691 " top: 50px; left: 50px'>"
674 " </div>" 692 " </div>"
675 " </div>" 693 " </div>"
(...skipping 17 matching lines...) Expand all
693 EXPECT_EQ(LayoutPoint(-150, 50), spanner->location()); 711 EXPECT_EQ(LayoutPoint(-150, 50), spanner->location());
694 EXPECT_EQ(LayoutPoint(100, 100), extraLayer->location()); 712 EXPECT_EQ(LayoutPoint(100, 100), extraLayer->location());
695 // -60 = 2nd-column-x(40) - scroll-offset-x(200) + x-location(100) 713 // -60 = 2nd-column-x(40) - scroll-offset-x(200) + x-location(100)
696 // 20 = y-location(100) - column-height(80) 714 // 20 = y-location(100) - column-height(80)
697 EXPECT_EQ(LayoutPoint(-60, 20), 715 EXPECT_EQ(LayoutPoint(-60, 20),
698 extraLayer->visualOffsetFromAncestor(columns)); 716 extraLayer->visualOffsetFromAncestor(columns));
699 EXPECT_EQ(LayoutPoint(-150, 50), spanner->visualOffsetFromAncestor(columns)); 717 EXPECT_EQ(LayoutPoint(-150, 50), spanner->visualOffsetFromAncestor(columns));
700 } 718 }
701 719
702 } // namespace blink 720 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698