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

Side by Side Diff: third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp

Issue 2859483006: cc: Enable composited border-radius scrolling.
Patch Set: fix layout tests Created 3 years, 6 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 TestNonCompositedReasons("transform", 1128 TestNonCompositedReasons("transform",
1129 MainThreadScrollingReason::kHasTransformAndLCDText); 1129 MainThreadScrollingReason::kHasTransformAndLCDText);
1130 } 1130 }
1131 1131
1132 TEST_P(NonCompositedMainThreadScrollingReasonTest, BackgroundNotOpaqueTest) { 1132 TEST_P(NonCompositedMainThreadScrollingReasonTest, BackgroundNotOpaqueTest) {
1133 TestNonCompositedReasons( 1133 TestNonCompositedReasons(
1134 "background-not-opaque", 1134 "background-not-opaque",
1135 MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText); 1135 MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText);
1136 } 1136 }
1137 1137
1138 TEST_P(NonCompositedMainThreadScrollingReasonTest, BorderRadiusTest) {
1139 TestNonCompositedReasons("border-radius",
1140 MainThreadScrollingReason::kHasBorderRadius);
1141 }
1142
1143 TEST_P(NonCompositedMainThreadScrollingReasonTest, ClipTest) { 1138 TEST_P(NonCompositedMainThreadScrollingReasonTest, ClipTest) {
1144 TestNonCompositedReasons("clip", 1139 TestNonCompositedReasons("clip",
1145 MainThreadScrollingReason::kHasClipRelatedProperty); 1140 MainThreadScrollingReason::kHasClipRelatedProperty);
1146 } 1141 }
1147 1142
1148 TEST_P(NonCompositedMainThreadScrollingReasonTest, ClipPathTest) { 1143 TEST_P(NonCompositedMainThreadScrollingReasonTest, ClipPathTest) {
1149 uint32_t clip_reason = MainThreadScrollingReason::kHasClipRelatedProperty; 1144 uint32_t clip_reason = MainThreadScrollingReason::kHasClipRelatedProperty;
1150 GetWebView()->GetSettings()->SetPreferCompositingToLCDTextEnabled(false); 1145 GetWebView()->GetSettings()->SetPreferCompositingToLCDTextEnabled(false);
1151 Document* document = GetFrame()->GetDocument(); 1146 Document* document = GetFrame()->GetDocument();
1152 // Test ancestor with ClipPath 1147 // Test ancestor with ClipPath
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 1183
1189 // Remove clip path from descendant. 1184 // Remove clip path from descendant.
1190 element->removeAttribute(HTMLNames::styleAttr); 1185 element->removeAttribute(HTMLNames::styleAttr);
1191 ForceFullCompositingUpdate(); 1186 ForceFullCompositingUpdate();
1192 EXPECT_FALSE(scrollable_area->GetNonCompositedMainThreadScrollingReasons() & 1187 EXPECT_FALSE(scrollable_area->GetNonCompositedMainThreadScrollingReasons() &
1193 clip_reason); 1188 clip_reason);
1194 EXPECT_FALSE(frame_view->GetMainThreadScrollingReasons() & clip_reason); 1189 EXPECT_FALSE(frame_view->GetMainThreadScrollingReasons() & clip_reason);
1195 } 1190 }
1196 1191
1197 TEST_P(NonCompositedMainThreadScrollingReasonTest, LCDTextEnabledTest) { 1192 TEST_P(NonCompositedMainThreadScrollingReasonTest, LCDTextEnabledTest) {
1198 TestNonCompositedReasons("transparent border-radius", 1193 TestNonCompositedReasons("transparent",
1199 MainThreadScrollingReason::kHasOpacityAndLCDText | 1194 MainThreadScrollingReason::kHasOpacityAndLCDText);
1200 MainThreadScrollingReason::kHasBorderRadius);
1201 } 1195 }
1202 1196
1203 TEST_P(NonCompositedMainThreadScrollingReasonTest, BoxShadowTest) { 1197 TEST_P(NonCompositedMainThreadScrollingReasonTest, BoxShadowTest) {
1204 TestNonCompositedReasons( 1198 TestNonCompositedReasons(
1205 "box-shadow", MainThreadScrollingReason::kHasBoxShadowFromNonRootLayer); 1199 "box-shadow", MainThreadScrollingReason::kHasBoxShadowFromNonRootLayer);
1206 } 1200 }
1207 1201
1208 TEST_P(NonCompositedMainThreadScrollingReasonTest, StackingContextTest) { 1202 TEST_P(NonCompositedMainThreadScrollingReasonTest, StackingContextTest) {
1209 GetWebView()->GetSettings()->SetPreferCompositingToLCDTextEnabled(false); 1203 GetWebView()->GetSettings()->SetPreferCompositingToLCDTextEnabled(false);
1210 1204
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 Element* container = document->getElementById("scroller1"); 1239 Element* container = document->getElementById("scroller1");
1246 ASSERT_TRUE(container); 1240 ASSERT_TRUE(container);
1247 container->setAttribute("class", "composited transparent", 1241 container->setAttribute("class", "composited transparent",
1248 ASSERT_NO_EXCEPTION); 1242 ASSERT_NO_EXCEPTION);
1249 ForceFullCompositingUpdate(); 1243 ForceFullCompositingUpdate();
1250 1244
1251 PaintLayerScrollableArea* scrollable_area = 1245 PaintLayerScrollableArea* scrollable_area =
1252 ToLayoutBoxModelObject(container->GetLayoutObject())->GetScrollableArea(); 1246 ToLayoutBoxModelObject(container->GetLayoutObject())->GetScrollableArea();
1253 ASSERT_TRUE(scrollable_area); 1247 ASSERT_TRUE(scrollable_area);
1254 EXPECT_FALSE(scrollable_area->GetNonCompositedMainThreadScrollingReasons()); 1248 EXPECT_FALSE(scrollable_area->GetNonCompositedMainThreadScrollingReasons());
1255
1256 Element* container2 = document->getElementById("scroller2");
1257 ASSERT_TRUE(container2);
1258 container2->setAttribute("class", "composited border-radius",
1259 ASSERT_NO_EXCEPTION);
1260 ForceFullCompositingUpdate();
1261 PaintLayerScrollableArea* scrollable_area2 =
1262 ToLayoutBoxModelObject(container2->GetLayoutObject())
1263 ->GetScrollableArea();
1264 ASSERT_TRUE(scrollable_area2);
1265 EXPECT_TRUE(scrollable_area2->GetNonCompositedMainThreadScrollingReasons() &
1266 MainThreadScrollingReason::kHasBorderRadius);
1267 } 1249 }
1268 1250
1269 } // namespace blink 1251 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698