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

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

Issue 2891453003: Incorporate ComputedStyle::hasTransform when diffing transform styles. (Closed)
Patch Set: Created 3 years, 7 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
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 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 802
803 EXPECT_EQ(LayoutPoint(-150, 50), spanner->location()); 803 EXPECT_EQ(LayoutPoint(-150, 50), spanner->location());
804 EXPECT_EQ(LayoutPoint(100, 100), extraLayer->location()); 804 EXPECT_EQ(LayoutPoint(100, 100), extraLayer->location());
805 // -60 = 2nd-column-x(40) - scroll-offset-x(200) + x-location(100) 805 // -60 = 2nd-column-x(40) - scroll-offset-x(200) + x-location(100)
806 // 20 = y-location(100) - column-height(80) 806 // 20 = y-location(100) - column-height(80)
807 EXPECT_EQ(LayoutPoint(-60, 20), 807 EXPECT_EQ(LayoutPoint(-60, 20),
808 extraLayer->visualOffsetFromAncestor(columns)); 808 extraLayer->visualOffsetFromAncestor(columns));
809 EXPECT_EQ(LayoutPoint(-150, 50), spanner->visualOffsetFromAncestor(columns)); 809 EXPECT_EQ(LayoutPoint(-150, 50), spanner->visualOffsetFromAncestor(columns));
810 } 810 }
811 811
812 TEST_P(PaintLayerTest, PaintLayerTransformUpdatedOnStyleTransformAnimation) {
813 setBodyInnerHTML("<div id='target' style='will-change: transform'></div>");
814
815 LayoutObject* targetObject =
816 document().getElementById("target")->layoutObject();
817 PaintLayer* targetPaintLayer = toLayoutBoxModelObject(targetObject)->layer();
818 EXPECT_EQ(nullptr, targetPaintLayer->transform());
819
820 RefPtr<ComputedStyle> oldStyle =
821 ComputedStyle::clone(targetObject->styleRef());
822 ComputedStyle* newStyle = targetObject->mutableStyle();
823 newStyle->setHasCurrentTransformAnimation();
824 targetPaintLayer->updateTransform(oldStyle.get(), *newStyle);
825
826 EXPECT_NE(nullptr, targetPaintLayer->transform());
827 }
828
812 } // namespace blink 829 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698