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

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

Issue 2767783003: Incorporate ComputedStyle::hasTransform when diffing transform styles. (Closed)
Patch Set: Sync to head. Created 3 years, 9 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 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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