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

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

Issue 2428513004: [SPv2] Create effect nodes for CSS filter (Closed)
Patch Set: address pdr's comment Created 4 years, 1 month 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 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 "core/paint/PaintPropertyTreePrinter.h" 9 #include "core/paint/PaintPropertyTreePrinter.h"
10 #include "platform/graphics/paint/GeometryMapper.h" 10 #include "platform/graphics/paint/GeometryMapper.h"
(...skipping 2858 matching lines...) Expand 10 before | Expand all | Expand 10 after
2869 " <div id=spanner style='column-span: all'>" 2869 " <div id=spanner style='column-span: all'>"
2870 " <div id=absolute style='position: absolute'>absolute</div>" 2870 " <div id=absolute style='position: absolute'>absolute</div>"
2871 " </div>" 2871 " </div>"
2872 " </span>" 2872 " </span>"
2873 "</div>"); 2873 "</div>");
2874 // There should be anonymous block created containing the inline "relative", 2874 // There should be anonymous block created containing the inline "relative",
2875 // serving as the container of "absolute". 2875 // serving as the container of "absolute".
2876 EXPECT_TRUE( 2876 EXPECT_TRUE(
2877 getLayoutObjectByElementId("absolute")->container()->isLayoutBlock()); 2877 getLayoutObjectByElementId("absolute")->container()->isLayoutBlock());
2878 } 2878 }
2879
2880 TEST_P(PaintPropertyTreeBuilderTest, SimpleFilter) {
2881 setBodyInnerHTML(
2882 "<div id='filter' style='filter:opacity(0.5); height:1000px;'>"
2883 "</div>");
2884 const ObjectPaintProperties* filterProperties =
2885 getLayoutObjectByElementId("filter")->objectPaintProperties();
2886 EXPECT_TRUE(filterProperties->effect()->parent()->isRoot());
2887 EXPECT_EQ(frameScrollTranslation(),
2888 filterProperties->effect()->localTransformSpace());
2889 EXPECT_EQ(frameContentClip(), filterProperties->effect()->outputClip());
2890 }
2891
2892 TEST_P(PaintPropertyTreeBuilderTest, FilterReparentClips) {
2893 setBodyInnerHTML(
2894 "<div id='clip' style='overflow:hidden;'>"
2895 " <div id='filter' style='filter:opacity(0.5); height:1000px;'>"
2896 " <div id='child' style='position:fixed;'></div>"
2897 " </div>"
2898 "</div>");
2899 const ObjectPaintProperties* clipProperties =
2900 getLayoutObjectByElementId("clip")->objectPaintProperties();
2901 const ObjectPaintProperties* filterProperties =
2902 getLayoutObjectByElementId("filter")->objectPaintProperties();
2903 EXPECT_TRUE(filterProperties->effect()->parent()->isRoot());
2904 EXPECT_EQ(frameScrollTranslation(),
2905 filterProperties->effect()->localTransformSpace());
2906 EXPECT_EQ(clipProperties->overflowClip(),
2907 filterProperties->effect()->outputClip());
2908
2909 const ObjectPaintProperties* childProperties =
2910 getLayoutObjectByElementId("child")->objectPaintProperties();
2911 const PropertyTreeState& childPaintState =
2912 childProperties->localBorderBoxProperties()->propertyTreeState;
2913 EXPECT_EQ(framePreTranslation(),
2914 childProperties->paintOffsetTranslation()->parent());
2915 EXPECT_EQ(childProperties->paintOffsetTranslation(),
2916 childPaintState.transform());
2917 // This will change once we added clip expansion node.
2918 EXPECT_EQ(filterProperties->effect()->outputClip(), childPaintState.clip());
2919 EXPECT_EQ(filterProperties->effect(), childPaintState.effect());
2920 }
2921
2879 } // namespace blink 2922 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698