| OLD | NEW |
| 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 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1129 TestNonCompositedReasons("transform", | 1129 TestNonCompositedReasons("transform", |
| 1130 MainThreadScrollingReason::kHasTransformAndLCDText); | 1130 MainThreadScrollingReason::kHasTransformAndLCDText); |
| 1131 } | 1131 } |
| 1132 | 1132 |
| 1133 TEST_P(NonCompositedMainThreadScrollingReasonTest, BackgroundNotOpaqueTest) { | 1133 TEST_P(NonCompositedMainThreadScrollingReasonTest, BackgroundNotOpaqueTest) { |
| 1134 TestNonCompositedReasons( | 1134 TestNonCompositedReasons( |
| 1135 "background-not-opaque", | 1135 "background-not-opaque", |
| 1136 MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText); | 1136 MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText); |
| 1137 } | 1137 } |
| 1138 | 1138 |
| 1139 TEST_P(NonCompositedMainThreadScrollingReasonTest, BorderRadiusTest) { | |
| 1140 TestNonCompositedReasons("border-radius", | |
| 1141 MainThreadScrollingReason::kHasBorderRadius); | |
| 1142 } | |
| 1143 | |
| 1144 TEST_P(NonCompositedMainThreadScrollingReasonTest, ClipTest) { | 1139 TEST_P(NonCompositedMainThreadScrollingReasonTest, ClipTest) { |
| 1145 TestNonCompositedReasons("clip", | 1140 TestNonCompositedReasons("clip", |
| 1146 MainThreadScrollingReason::kHasClipRelatedProperty); | 1141 MainThreadScrollingReason::kHasClipRelatedProperty); |
| 1147 } | 1142 } |
| 1148 | 1143 |
| 1149 TEST_P(NonCompositedMainThreadScrollingReasonTest, ClipPathTest) { | 1144 TEST_P(NonCompositedMainThreadScrollingReasonTest, ClipPathTest) { |
| 1150 uint32_t clip_reason = MainThreadScrollingReason::kHasClipRelatedProperty; | 1145 uint32_t clip_reason = MainThreadScrollingReason::kHasClipRelatedProperty; |
| 1151 GetWebView()->GetSettings()->SetPreferCompositingToLCDTextEnabled(false); | 1146 GetWebView()->GetSettings()->SetPreferCompositingToLCDTextEnabled(false); |
| 1152 Document* document = GetFrame()->GetDocument(); | 1147 Document* document = GetFrame()->GetDocument(); |
| 1153 // Test ancestor with ClipPath | 1148 // Test ancestor with ClipPath |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1189 | 1184 |
| 1190 // Remove clip path from descendant. | 1185 // Remove clip path from descendant. |
| 1191 element->removeAttribute(HTMLNames::styleAttr); | 1186 element->removeAttribute(HTMLNames::styleAttr); |
| 1192 ForceFullCompositingUpdate(); | 1187 ForceFullCompositingUpdate(); |
| 1193 EXPECT_FALSE(scrollable_area->GetNonCompositedMainThreadScrollingReasons() & | 1188 EXPECT_FALSE(scrollable_area->GetNonCompositedMainThreadScrollingReasons() & |
| 1194 clip_reason); | 1189 clip_reason); |
| 1195 EXPECT_FALSE(frame_view->GetMainThreadScrollingReasons() & clip_reason); | 1190 EXPECT_FALSE(frame_view->GetMainThreadScrollingReasons() & clip_reason); |
| 1196 } | 1191 } |
| 1197 | 1192 |
| 1198 TEST_P(NonCompositedMainThreadScrollingReasonTest, LCDTextEnabledTest) { | 1193 TEST_P(NonCompositedMainThreadScrollingReasonTest, LCDTextEnabledTest) { |
| 1199 TestNonCompositedReasons("transparent border-radius", | 1194 TestNonCompositedReasons("transparent", |
| 1200 MainThreadScrollingReason::kHasOpacityAndLCDText | | 1195 MainThreadScrollingReason::kHasOpacityAndLCDText); |
| 1201 MainThreadScrollingReason::kHasBorderRadius); | |
| 1202 } | 1196 } |
| 1203 | 1197 |
| 1204 TEST_P(NonCompositedMainThreadScrollingReasonTest, BoxShadowTest) { | 1198 TEST_P(NonCompositedMainThreadScrollingReasonTest, BoxShadowTest) { |
| 1205 TestNonCompositedReasons( | 1199 TestNonCompositedReasons( |
| 1206 "box-shadow", MainThreadScrollingReason::kHasBoxShadowFromNonRootLayer); | 1200 "box-shadow", MainThreadScrollingReason::kHasBoxShadowFromNonRootLayer); |
| 1207 } | 1201 } |
| 1208 | 1202 |
| 1209 TEST_P(NonCompositedMainThreadScrollingReasonTest, StackingContextTest) { | 1203 TEST_P(NonCompositedMainThreadScrollingReasonTest, StackingContextTest) { |
| 1210 GetWebView()->GetSettings()->SetPreferCompositingToLCDTextEnabled(false); | 1204 GetWebView()->GetSettings()->SetPreferCompositingToLCDTextEnabled(false); |
| 1211 | 1205 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1246 Element* container = document->getElementById("scroller1"); | 1240 Element* container = document->getElementById("scroller1"); |
| 1247 ASSERT_TRUE(container); | 1241 ASSERT_TRUE(container); |
| 1248 container->setAttribute("class", "composited transparent", | 1242 container->setAttribute("class", "composited transparent", |
| 1249 ASSERT_NO_EXCEPTION); | 1243 ASSERT_NO_EXCEPTION); |
| 1250 ForceFullCompositingUpdate(); | 1244 ForceFullCompositingUpdate(); |
| 1251 | 1245 |
| 1252 PaintLayerScrollableArea* scrollable_area = | 1246 PaintLayerScrollableArea* scrollable_area = |
| 1253 ToLayoutBoxModelObject(container->GetLayoutObject())->GetScrollableArea(); | 1247 ToLayoutBoxModelObject(container->GetLayoutObject())->GetScrollableArea(); |
| 1254 ASSERT_TRUE(scrollable_area); | 1248 ASSERT_TRUE(scrollable_area); |
| 1255 EXPECT_FALSE(scrollable_area->GetNonCompositedMainThreadScrollingReasons()); | 1249 EXPECT_FALSE(scrollable_area->GetNonCompositedMainThreadScrollingReasons()); |
| 1256 | |
| 1257 Element* container2 = document->getElementById("scroller2"); | |
| 1258 ASSERT_TRUE(container2); | |
| 1259 container2->setAttribute("class", "composited border-radius", | |
| 1260 ASSERT_NO_EXCEPTION); | |
| 1261 ForceFullCompositingUpdate(); | |
| 1262 PaintLayerScrollableArea* scrollable_area2 = | |
| 1263 ToLayoutBoxModelObject(container2->GetLayoutObject()) | |
| 1264 ->GetScrollableArea(); | |
| 1265 ASSERT_TRUE(scrollable_area2); | |
| 1266 EXPECT_TRUE(scrollable_area2->GetNonCompositedMainThreadScrollingReasons() & | |
| 1267 MainThreadScrollingReason::kHasBorderRadius); | |
| 1268 } | 1250 } |
| 1269 | 1251 |
| 1270 } // namespace blink | 1252 } // namespace blink |
| OLD | NEW |