| OLD | NEW |
| 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 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 | 824 |
| 825 EXPECT_EQ(LayoutPoint(-150, 50), spanner->location()); | 825 EXPECT_EQ(LayoutPoint(-150, 50), spanner->location()); |
| 826 EXPECT_EQ(LayoutPoint(100, 100), extraLayer->location()); | 826 EXPECT_EQ(LayoutPoint(100, 100), extraLayer->location()); |
| 827 // -60 = 2nd-column-x(40) - scroll-offset-x(200) + x-location(100) | 827 // -60 = 2nd-column-x(40) - scroll-offset-x(200) + x-location(100) |
| 828 // 20 = y-location(100) - column-height(80) | 828 // 20 = y-location(100) - column-height(80) |
| 829 EXPECT_EQ(LayoutPoint(-60, 20), | 829 EXPECT_EQ(LayoutPoint(-60, 20), |
| 830 extraLayer->visualOffsetFromAncestor(columns)); | 830 extraLayer->visualOffsetFromAncestor(columns)); |
| 831 EXPECT_EQ(LayoutPoint(-150, 50), spanner->visualOffsetFromAncestor(columns)); | 831 EXPECT_EQ(LayoutPoint(-150, 50), spanner->visualOffsetFromAncestor(columns)); |
| 832 } | 832 } |
| 833 | 833 |
| 834 TEST_P(PaintLayerTest, PaintLayerTransformUpdatedOnStyleTransformAnimation) { |
| 835 setBodyInnerHTML("<div id='target' style='will-change: transform'></div>"); |
| 836 |
| 837 LayoutObject* targetObject = |
| 838 document().getElementById("target")->layoutObject(); |
| 839 PaintLayer* targetPaintLayer = toLayoutBoxModelObject(targetObject)->layer(); |
| 840 EXPECT_EQ(nullptr, targetPaintLayer->transform()); |
| 841 |
| 842 RefPtr<ComputedStyle> oldStyle = |
| 843 ComputedStyle::clone(targetObject->styleRef()); |
| 844 ComputedStyle* newStyle = targetObject->mutableStyle(); |
| 845 newStyle->setHasCurrentTransformAnimation(); |
| 846 targetPaintLayer->updateTransform(oldStyle.get(), *newStyle); |
| 847 |
| 848 EXPECT_NE(nullptr, targetPaintLayer->transform()); |
| 849 } |
| 850 |
| 834 } // namespace blink | 851 } // namespace blink |
| OLD | NEW |