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 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1071 forceFullCompositingUpdate(); | 1071 forceFullCompositingUpdate(); |
1072 | 1072 |
1073 ASSERT_FALSE(frameView->mainThreadScrollingReasons() & reason); | 1073 ASSERT_FALSE(frameView->mainThreadScrollingReasons() & reason); |
1074 | 1074 |
1075 // Add target attribute would again lead to scroll on main thread | 1075 // Add target attribute would again lead to scroll on main thread |
1076 container->setAttribute("class", target.c_str(), ASSERT_NO_EXCEPTION); | 1076 container->setAttribute("class", target.c_str(), ASSERT_NO_EXCEPTION); |
1077 forceFullCompositingUpdate(); | 1077 forceFullCompositingUpdate(); |
1078 | 1078 |
1079 ASSERT_TRUE(frameView->mainThreadScrollingReasons() & reason); | 1079 ASSERT_TRUE(frameView->mainThreadScrollingReasons() & reason); |
1080 | 1080 |
1081 webViewImpl()->settings()->setPreferCompositingToLCDTextEnabled(true); | 1081 if (reason & (MainThreadScrollingReason::kHasOpacity | |
1082 forceFullCompositingUpdate(); | 1082 MainThreadScrollingReason::kHasTransform | |
1083 | 1083 MainThreadScrollingReason::kBackgroundNotOpaqueInRect)) { |
bokan
2017/01/05 14:05:48
You should also check that there aren't any of the
yigu
2017/01/05 14:46:51
Done.
| |
1084 ASSERT_FALSE(frameView->mainThreadScrollingReasons()); | 1084 webViewImpl()->settings()->setPreferCompositingToLCDTextEnabled(true); |
1085 forceFullCompositingUpdate(); | |
1086 ASSERT_FALSE(frameView->mainThreadScrollingReasons()); | |
1087 } | |
1085 } | 1088 } |
1086 }; | 1089 }; |
1087 | 1090 |
1088 TEST_F(StyleRelatedMainThreadScrollingReasonTest, TransparentTest) { | 1091 TEST_F(StyleRelatedMainThreadScrollingReasonTest, TransparentTest) { |
1089 testStyle("transparent", MainThreadScrollingReason::kHasOpacity); | 1092 testStyle("transparent", MainThreadScrollingReason::kHasOpacity); |
1090 } | 1093 } |
1091 | 1094 |
1092 TEST_F(StyleRelatedMainThreadScrollingReasonTest, TransformTest) { | 1095 TEST_F(StyleRelatedMainThreadScrollingReasonTest, TransformTest) { |
1093 testStyle("transform", MainThreadScrollingReason::kHasTransform); | 1096 testStyle("transform", MainThreadScrollingReason::kHasTransform); |
1094 } | 1097 } |
1095 | 1098 |
1096 TEST_F(StyleRelatedMainThreadScrollingReasonTest, BackgroundNotOpaqueTest) { | 1099 TEST_F(StyleRelatedMainThreadScrollingReasonTest, BackgroundNotOpaqueTest) { |
1097 testStyle("background-not-opaque", | 1100 testStyle("background-not-opaque", |
1098 MainThreadScrollingReason::kBackgroundNotOpaqueInRect); | 1101 MainThreadScrollingReason::kBackgroundNotOpaqueInRect); |
1099 } | 1102 } |
1100 | 1103 |
1104 TEST_F(StyleRelatedMainThreadScrollingReasonTest, BorderRadiusTest) { | |
1105 testStyle("border-radius", MainThreadScrollingReason::kHasBorderRadius); | |
1106 } | |
1107 | |
1108 TEST_F(StyleRelatedMainThreadScrollingReasonTest, ClipTest) { | |
1109 testStyle("clip", MainThreadScrollingReason::kHasClipRelatedProperty); | |
1110 } | |
1111 | |
1112 TEST_F(StyleRelatedMainThreadScrollingReasonTest, ClipPathTest) { | |
1113 testStyle("clip-path", MainThreadScrollingReason::kHasClipRelatedProperty); | |
1114 } | |
1115 | |
1101 } // namespace blink | 1116 } // namespace blink |
OLD | NEW |