OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/layout/LayoutTestHelper.h" | 5 #include "core/layout/LayoutTestHelper.h" |
6 #include "core/layout/LayoutTreeAsText.h" | 6 #include "core/layout/LayoutTreeAsText.h" |
7 #include "core/layout/api/LayoutViewItem.h" | 7 #include "core/layout/api/LayoutViewItem.h" |
8 #include "core/paint/ObjectPaintProperties.h" | 8 #include "core/paint/ObjectPaintProperties.h" |
9 #include "core/paint/PaintPropertyTreePrinter.h" | 9 #include "core/paint/PaintPropertyTreePrinter.h" |
10 #include "platform/graphics/paint/GeometryMapper.h" | 10 #include "platform/graphics/paint/GeometryMapper.h" |
(...skipping 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1980 const ObjectPaintProperties* overflowBScrollProperties = overflowB->layoutOb
ject()->objectPaintProperties(); | 1980 const ObjectPaintProperties* overflowBScrollProperties = overflowB->layoutOb
ject()->objectPaintProperties(); |
1981 // The overflow child's scroll node should be a child of the parent's (overf
lowA) scroll node. | 1981 // The overflow child's scroll node should be a child of the parent's (overf
lowA) scroll node. |
1982 EXPECT_EQ(overflowAScrollProperties->scroll(), overflowBScrollProperties->sc
roll()->parent()); | 1982 EXPECT_EQ(overflowAScrollProperties->scroll(), overflowBScrollProperties->sc
roll()->parent()); |
1983 EXPECT_EQ(TransformationMatrix().translate(0, -41), overflowBScrollPropertie
s->scroll()->scrollOffsetTranslation()->matrix()); | 1983 EXPECT_EQ(TransformationMatrix().translate(0, -41), overflowBScrollPropertie
s->scroll()->scrollOffsetTranslation()->matrix()); |
1984 EXPECT_EQ(IntSize(5, 3), overflowBScrollProperties->scroll()->clip()); | 1984 EXPECT_EQ(IntSize(5, 3), overflowBScrollProperties->scroll()->clip()); |
1985 EXPECT_EQ(IntSize(5, 100), overflowBScrollProperties->scroll()->bounds()); | 1985 EXPECT_EQ(IntSize(5, 100), overflowBScrollProperties->scroll()->bounds()); |
1986 EXPECT_TRUE(overflowBScrollProperties->scroll()->userScrollableHorizontal())
; | 1986 EXPECT_TRUE(overflowBScrollProperties->scroll()->userScrollableHorizontal())
; |
1987 EXPECT_TRUE(overflowBScrollProperties->scroll()->userScrollableVertical()); | 1987 EXPECT_TRUE(overflowBScrollProperties->scroll()->userScrollableVertical()); |
1988 } | 1988 } |
1989 | 1989 |
| 1990 TEST_P(PaintPropertyTreeBuilderTest, SVGRootClip) |
| 1991 { |
| 1992 setBodyInnerHTML( |
| 1993 "<svg id='svg' xmlns='http://www.w3.org/2000/svg' width='100px' height='
100px'>" |
| 1994 " <rect width='200' height='200' fill='red' />" |
| 1995 "</svg>"); |
| 1996 |
| 1997 const ClipPaintPropertyNode* clip = getLayoutObjectByElementId("svg")->objec
tPaintProperties()->overflowClip(); |
| 1998 EXPECT_EQ(frameContentClip(), clip->parent()); |
| 1999 EXPECT_EQ(FloatRoundedRect(8, 8, 100, 100), clip->clipRect()); |
| 2000 } |
| 2001 |
| 2002 TEST_P(PaintPropertyTreeBuilderTest, SVGRootNoClip) |
| 2003 { |
| 2004 setBodyInnerHTML( |
| 2005 "<svg id='svg' xmlns='http://www.w3.org/2000/svg' width='100px' height='
100px' style='overflow: visible'>" |
| 2006 " <rect width='200' height='200' fill='red' />" |
| 2007 "</svg>"); |
| 2008 |
| 2009 EXPECT_FALSE(getLayoutObjectByElementId("svg")->objectPaintProperties()->ove
rflowClip()); |
| 2010 } |
| 2011 |
1990 } // namespace blink | 2012 } // namespace blink |
OLD | NEW |