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 "platform/graphics/paint/GeometryMapper.h" | 9 #include "platform/graphics/paint/GeometryMapper.h" |
10 #include "platform/graphics/paint/TransformPaintPropertyNode.h" | 10 #include "platform/graphics/paint/TransformPaintPropertyNode.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 } | 137 } |
138 | 138 |
139 TEST_F(PaintPropertyTreeBuilderTest, FrameScrollingTraditional) | 139 TEST_F(PaintPropertyTreeBuilderTest, FrameScrollingTraditional) |
140 { | 140 { |
141 setBodyInnerHTML("<style> body { height: 10000px; } </style>"); | 141 setBodyInnerHTML("<style> body { height: 10000px; } </style>"); |
142 | 142 |
143 document().domWindow()->scrollTo(0, 100); | 143 document().domWindow()->scrollTo(0, 100); |
144 | 144 |
145 FrameView* frameView = document().view(); | 145 FrameView* frameView = document().view(); |
146 frameView->updateAllLifecyclePhases(); | 146 frameView->updateAllLifecyclePhases(); |
147 EXPECT_EQ(TransformationMatrix(), frameView->preTranslation()->matrix()); | 147 EXPECT_EQ(TransformationMatrix(), frameView->preTranslation()->matrix()); |
pdr.
2016/07/13 02:26:51
Which test caused the original test to be rolled o
trchen
2016/07/13 02:50:39
HTMLCanvasPainterTestForSPv2.Canvas2DLayerAppearsI
| |
148 EXPECT_EQ(nullptr, frameView->preTranslation()->parent()); | 148 EXPECT_EQ(frameView->rootTransform(), frameView->preTranslation()->parent()) ; |
149 EXPECT_EQ(nullptr, frameView->rootTransform()->parent()); | |
149 EXPECT_EQ(TransformationMatrix().translate(0, -100), frameView->scrollTransl ation()->matrix()); | 150 EXPECT_EQ(TransformationMatrix().translate(0, -100), frameView->scrollTransl ation()->matrix()); |
150 EXPECT_EQ(frameView->preTranslation(), frameView->scrollTranslation()->paren t()); | 151 EXPECT_EQ(frameView->preTranslation(), frameView->scrollTranslation()->paren t()); |
151 EXPECT_EQ(frameView->preTranslation(), frameView->contentClip()->localTransf ormSpace()); | 152 EXPECT_EQ(frameView->preTranslation(), frameView->contentClip()->localTransf ormSpace()); |
152 EXPECT_EQ(FloatRoundedRect(0, 0, 800, 600), frameView->contentClip()->clipRe ct()); | 153 EXPECT_EQ(FloatRoundedRect(0, 0, 800, 600), frameView->contentClip()->clipRe ct()); |
153 EXPECT_EQ(nullptr, frameView->contentClip()->parent()); | 154 EXPECT_EQ(frameView->rootClip(), frameView->contentClip()->parent()); |
155 EXPECT_EQ(nullptr, frameView->rootClip()->parent()); | |
pdr.
2016/07/13 02:26:51
Add a basic test for effect too?
trchen
2016/07/13 02:50:39
Root effect was already unconditionally created. T
| |
154 | 156 |
155 LayoutViewItem layoutViewItem = document().layoutViewItem(); | 157 LayoutViewItem layoutViewItem = document().layoutViewItem(); |
156 ObjectPaintProperties* layoutViewProperties = layoutViewItem.objectPaintProp erties(); | 158 ObjectPaintProperties* layoutViewProperties = layoutViewItem.objectPaintProp erties(); |
157 EXPECT_EQ(nullptr, layoutViewProperties->scrollTranslation()); | 159 EXPECT_EQ(nullptr, layoutViewProperties->scrollTranslation()); |
158 } | 160 } |
159 | 161 |
160 // TODO(trchen): Settings::rootLayerScrolls cannot be switched after main frame being created. | 162 // TODO(trchen): Settings::rootLayerScrolls cannot be switched after main frame being created. |
161 // Need to set it during test setup. Besides that, the test still won't work bec ause | 163 // Need to set it during test setup. Besides that, the test still won't work bec ause |
162 // root layer scrolling mode is not compatible with SPv2 at this moment. | 164 // root layer scrolling mode is not compatible with SPv2 at this moment. |
163 // (Duplicate display item ID for FrameView and LayoutView.) | 165 // (Duplicate display item ID for FrameView and LayoutView.) |
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1101 | 1103 |
1102 LayoutObject& rectWithTransform = *document().getElementById("rect")->layout Object(); | 1104 LayoutObject& rectWithTransform = *document().getElementById("rect")->layout Object(); |
1103 ObjectPaintProperties* rectWithTransformProperties = rectWithTransform.objec tPaintProperties(); | 1105 ObjectPaintProperties* rectWithTransformProperties = rectWithTransform.objec tPaintProperties(); |
1104 EXPECT_EQ(TransformationMatrix().translate(1, 1), rectWithTransformPropertie s->transform()->matrix()); | 1106 EXPECT_EQ(TransformationMatrix().translate(1, 1), rectWithTransformPropertie s->transform()->matrix()); |
1105 | 1107 |
1106 // Ensure there is no PaintOffset transform between the rect and the svg's t ransform. | 1108 // Ensure there is no PaintOffset transform between the rect and the svg's t ransform. |
1107 EXPECT_EQ(svgWithTransformProperties->transform(), rectWithTransformProperti es->transform()->parent()); | 1109 EXPECT_EQ(svgWithTransformProperties->transform(), rectWithTransformProperti es->transform()->parent()); |
1108 } | 1110 } |
1109 | 1111 |
1110 } // namespace blink | 1112 } // namespace blink |
OLD | NEW |