OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/compositing/CompositedLayerMapping.h" | 5 #include "core/layout/compositing/CompositedLayerMapping.h" |
6 | 6 |
7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
8 #include "core/layout/LayoutBoxModelObject.h" | 8 #include "core/layout/LayoutBoxModelObject.h" |
9 #include "core/layout/LayoutTestHelper.h" | 9 #include "core/layout/LayoutTestHelper.h" |
10 #include "core/layout/api/LayoutViewItem.h" | 10 #include "core/layout/api/LayoutViewItem.h" |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 newInterestRect.move(0, 512); | 376 newInterestRect.move(0, 512); |
377 EXPECT_FALSE(interestRectChangedEnoughToRepaint(previousInterestRect, newInt
erestRect, layerSize)); | 377 EXPECT_FALSE(interestRectChangedEnoughToRepaint(previousInterestRect, newInt
erestRect, layerSize)); |
378 newInterestRect.move(1, 0); | 378 newInterestRect.move(1, 0); |
379 EXPECT_TRUE(interestRectChangedEnoughToRepaint(previousInterestRect, newInte
restRect, layerSize)); | 379 EXPECT_TRUE(interestRectChangedEnoughToRepaint(previousInterestRect, newInte
restRect, layerSize)); |
380 newInterestRect.move(-1, 1); | 380 newInterestRect.move(-1, 1); |
381 EXPECT_TRUE(interestRectChangedEnoughToRepaint(previousInterestRect, newInte
restRect, layerSize)); | 381 EXPECT_TRUE(interestRectChangedEnoughToRepaint(previousInterestRect, newInte
restRect, layerSize)); |
382 } | 382 } |
383 | 383 |
384 TEST_F(CompositedLayerMappingTest, InterestRectChangeOnViewportScroll) | 384 TEST_F(CompositedLayerMappingTest, InterestRectChangeOnViewportScroll) |
385 { | 385 { |
386 if (document().frame()->settings()->rootLayerScrolls()) | 386 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) |
387 return; | 387 return; |
388 | 388 |
389 setBodyInnerHTML( | 389 setBodyInnerHTML( |
390 "<style>" | 390 "<style>" |
391 " ::-webkit-scrollbar { width: 0; height: 0; }" | 391 " ::-webkit-scrollbar { width: 0; height: 0; }" |
392 " body { margin: 0; }" | 392 " body { margin: 0; }" |
393 "</style>" | 393 "</style>" |
394 "<div id='div' style='width: 100px; height: 10000px'>Text</div>"); | 394 "<div id='div' style='width: 100px; height: 10000px'>Text</div>"); |
395 | 395 |
396 document().view()->updateAllLifecyclePhases(); | 396 document().view()->updateAllLifecyclePhases(); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller1")); | 653 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller1")); |
654 | 654 |
655 // Second scroller cannot paint background into scrolling contents layer bec
ause it has a content-box clip without local attachment. | 655 // Second scroller cannot paint background into scrolling contents layer bec
ause it has a content-box clip without local attachment. |
656 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller2")); | 656 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller2")); |
657 | 657 |
658 // Third scroller can paint background into scrolling contents layer. | 658 // Third scroller can paint background into scrolling contents layer. |
659 EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller3")); | 659 EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller3")); |
660 } | 660 } |
661 | 661 |
662 } // namespace blink | 662 } // namespace blink |
OLD | NEW |