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