| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/html/HTMLIFrameElement.h" | 5 #include "core/html/HTMLIFrameElement.h" |
| 6 #include "core/layout/LayoutTestHelper.h" | 6 #include "core/layout/LayoutTestHelper.h" |
| 7 #include "core/layout/LayoutTreeAsText.h" | 7 #include "core/layout/LayoutTreeAsText.h" |
| 8 #include "core/layout/api/LayoutViewItem.h" | 8 #include "core/layout/api/LayoutViewItem.h" |
| 9 #include "core/paint/ObjectPaintProperties.h" | 9 #include "core/paint/ObjectPaintProperties.h" |
| 10 #include "core/paint/PaintPropertyTreePrinter.h" | 10 #include "core/paint/PaintPropertyTreePrinter.h" |
| (...skipping 2678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2689 EXPECT_TRUE(overflowA->layoutObject() | 2689 EXPECT_TRUE(overflowA->layoutObject() |
| 2690 ->paintProperties() | 2690 ->paintProperties() |
| 2691 ->scroll() | 2691 ->scroll() |
| 2692 ->hasBackgroundAttachmentFixedDescendants()); | 2692 ->hasBackgroundAttachmentFixedDescendants()); |
| 2693 EXPECT_FALSE(overflowB->layoutObject() | 2693 EXPECT_FALSE(overflowB->layoutObject() |
| 2694 ->paintProperties() | 2694 ->paintProperties() |
| 2695 ->scroll() | 2695 ->scroll() |
| 2696 ->hasBackgroundAttachmentFixedDescendants()); | 2696 ->hasBackgroundAttachmentFixedDescendants()); |
| 2697 } | 2697 } |
| 2698 | 2698 |
| 2699 TEST_P(PaintPropertyTreeBuilderTest, MainThreadScrollReasonsWithoutScrolling) { |
| 2700 setBodyInnerHTML( |
| 2701 "<style>" |
| 2702 " #overflow {" |
| 2703 " overflow: scroll;" |
| 2704 " width: 100px;" |
| 2705 " height: 100px;" |
| 2706 " }" |
| 2707 " .backgroundAttachmentFixed {" |
| 2708 " background-image: url('foo');" |
| 2709 " background-attachment: fixed;" |
| 2710 " width: 10px;" |
| 2711 " height: 10px;" |
| 2712 " }" |
| 2713 " .forceScroll {" |
| 2714 " height: 4000px;" |
| 2715 " }" |
| 2716 "</style>" |
| 2717 "<div id='overflow'>" |
| 2718 " <div class='backgroundAttachmentFixed'></div>" |
| 2719 "</div>" |
| 2720 "<div class='forceScroll'></div>"); |
| 2721 Element* overflow = document().getElementById("overflow"); |
| 2722 EXPECT_TRUE(frameScroll()->hasBackgroundAttachmentFixedDescendants()); |
| 2723 EXPECT_TRUE(overflow->layoutObject() |
| 2724 ->paintProperties() |
| 2725 ->scroll() |
| 2726 ->hasBackgroundAttachmentFixedDescendants()); |
| 2727 } |
| 2728 |
| 2699 TEST_P(PaintPropertyTreeBuilderTest, | 2729 TEST_P(PaintPropertyTreeBuilderTest, |
| 2700 BackgroundAttachmentFixedMainThreadScrollReasonsWithFixedScroller) { | 2730 BackgroundAttachmentFixedMainThreadScrollReasonsWithFixedScroller) { |
| 2701 setBodyInnerHTML( | 2731 setBodyInnerHTML( |
| 2702 "<style>" | 2732 "<style>" |
| 2703 " #overflowA {" | 2733 " #overflowA {" |
| 2704 " position: absolute;" | 2734 " position: absolute;" |
| 2705 " overflow: scroll;" | 2735 " overflow: scroll;" |
| 2706 " width: 20px;" | 2736 " width: 20px;" |
| 2707 " height: 20px;" | 2737 " height: 20px;" |
| 2708 " }" | 2738 " }" |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3023 EXPECT_FALSE(document().layoutView()->descendantNeedsPaintPropertyUpdate()); | 3053 EXPECT_FALSE(document().layoutView()->descendantNeedsPaintPropertyUpdate()); |
| 3024 EXPECT_FALSE(transform->needsPaintPropertyUpdate()); | 3054 EXPECT_FALSE(transform->needsPaintPropertyUpdate()); |
| 3025 EXPECT_FALSE(transform->descendantNeedsPaintPropertyUpdate()); | 3055 EXPECT_FALSE(transform->descendantNeedsPaintPropertyUpdate()); |
| 3026 EXPECT_FALSE(iframeLayoutView->needsPaintPropertyUpdate()); | 3056 EXPECT_FALSE(iframeLayoutView->needsPaintPropertyUpdate()); |
| 3027 EXPECT_FALSE(iframeLayoutView->descendantNeedsPaintPropertyUpdate()); | 3057 EXPECT_FALSE(iframeLayoutView->descendantNeedsPaintPropertyUpdate()); |
| 3028 EXPECT_FALSE(iframeTransform->needsPaintPropertyUpdate()); | 3058 EXPECT_FALSE(iframeTransform->needsPaintPropertyUpdate()); |
| 3029 EXPECT_FALSE(iframeTransform->descendantNeedsPaintPropertyUpdate()); | 3059 EXPECT_FALSE(iframeTransform->descendantNeedsPaintPropertyUpdate()); |
| 3030 } | 3060 } |
| 3031 | 3061 |
| 3032 } // namespace blink | 3062 } // namespace blink |
| OLD | NEW |