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/paint/PaintPropertyTreeBuilderTest.h" | 5 #include "core/paint/PaintPropertyTreeBuilderTest.h" |
6 | 6 |
7 #include "core/html/HTMLIFrameElement.h" | 7 #include "core/html/HTMLIFrameElement.h" |
8 #include "core/layout/LayoutTreeAsText.h" | 8 #include "core/layout/LayoutTreeAsText.h" |
9 #include "core/paint/ObjectPaintProperties.h" | 9 #include "core/paint/ObjectPaintProperties.h" |
10 #include "core/paint/PaintPropertyTreePrinter.h" | 10 #include "core/paint/PaintPropertyTreePrinter.h" |
(...skipping 3138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3149 EXPECT_EQ(FloatPoint3D(50, 50, 0), | 3149 EXPECT_EQ(FloatPoint3D(50, 50, 0), |
3150 motionPath->paintProperties()->transform()->origin()); | 3150 motionPath->paintProperties()->transform()->origin()); |
3151 | 3151 |
3152 auto* willChange = document().getElementById("willChange")->layoutObject(); | 3152 auto* willChange = document().getElementById("willChange")->layoutObject(); |
3153 EXPECT_EQ(TransformationMatrix().translate3d(0, 0, 0), | 3153 EXPECT_EQ(TransformationMatrix().translate3d(0, 0, 0), |
3154 willChange->paintProperties()->transform()->matrix()); | 3154 willChange->paintProperties()->transform()->matrix()); |
3155 EXPECT_EQ(FloatPoint3D(0, 0, 0), | 3155 EXPECT_EQ(FloatPoint3D(0, 0, 0), |
3156 willChange->paintProperties()->transform()->origin()); | 3156 willChange->paintProperties()->transform()->origin()); |
3157 } | 3157 } |
3158 | 3158 |
| 3159 TEST_P(PaintPropertyTreeBuilderTest, ChangePositionUpdateDescendantProperties) { |
| 3160 setBodyInnerHTML( |
| 3161 "<style>" |
| 3162 " * { margin: 0; }" |
| 3163 " #ancestor { position: absolute; overflow: hidden }" |
| 3164 " #descendant { position: absolute }" |
| 3165 "</style>" |
| 3166 "<div id='ancestor'>" |
| 3167 " <div id='descendant'></div>" |
| 3168 "</div>"); |
| 3169 |
| 3170 LayoutObject* ancestor = getLayoutObjectByElementId("ancestor"); |
| 3171 LayoutObject* descendant = getLayoutObjectByElementId("descendant"); |
| 3172 EXPECT_EQ(ancestor->paintProperties()->overflowClip(), |
| 3173 descendant->paintProperties() |
| 3174 ->localBorderBoxProperties() |
| 3175 ->propertyTreeState.clip()); |
| 3176 |
| 3177 toElement(ancestor->node()) |
| 3178 ->setAttribute(HTMLNames::styleAttr, "position: static"); |
| 3179 document().view()->updateAllLifecyclePhases(); |
| 3180 EXPECT_NE(ancestor->paintProperties()->overflowClip(), |
| 3181 descendant->paintProperties() |
| 3182 ->localBorderBoxProperties() |
| 3183 ->propertyTreeState.clip()); |
| 3184 } |
| 3185 |
3159 } // namespace blink | 3186 } // namespace blink |
OLD | NEW |