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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
640 "<div id='scroller1' class='scroller' style='background: white local;'>" | 640 "<div id='scroller1' class='scroller' style='background: white local;'>" |
641 " <div id='negative-composited-child' style='background-color: red; w idth: 1px; height: 1px; position: absolute; backface-visibility: hidden; z-index : -1'></div>" | 641 " <div id='negative-composited-child' style='background-color: red; w idth: 1px; height: 1px; position: absolute; backface-visibility: hidden; z-index : -1'></div>" |
642 " <div class='spacer'></div>" | 642 " <div class='spacer'></div>" |
643 "</div>" | 643 "</div>" |
644 "<div id='scroller2' class='scroller' style='background: white content-b ox; padding: 10px;'><div class='spacer'></div></div>" | 644 "<div id='scroller2' class='scroller' style='background: white content-b ox; padding: 10px;'><div class='spacer'></div></div>" |
645 "<div id='scroller3' class='scroller' style='background: white local con tent-box; padding: 10px;'><div class='spacer'></div></div>" | 645 "<div id='scroller3' class='scroller' style='background: white local con tent-box; padding: 10px;'><div class='spacer'></div></div>" |
646 "<div id='scroller4' class='scroller' style='background: url(data:image/ png;base64,iVBORw0KGgoAAAANSUhEUg), white local;'><div class='spacer'></div></di v>" | 646 "<div id='scroller4' class='scroller' style='background: url(data:image/ png;base64,iVBORw0KGgoAAAANSUhEUg), white local;'><div class='spacer'></div></di v>" |
647 "<div id='scroller5' class='scroller' style='background: url(data:image/ png;base64,iVBORw0KGgoAAAANSUhEUg) local, white local;'><div class='spacer'></di v></div>" | 647 "<div id='scroller5' class='scroller' style='background: url(data:image/ png;base64,iVBORw0KGgoAAAANSUhEUg) local, white local;'><div class='spacer'></di v></div>" |
648 "<div id='scroller6' class='scroller' style='background: url(data:image/ png;base64,iVBORw0KGgoAAAANSUhEUg) local, white padding-box; padding: 10px;'><di v class='spacer'></div></div>" | 648 "<div id='scroller6' class='scroller' style='background: url(data:image/ png;base64,iVBORw0KGgoAAAANSUhEUg) local, white padding-box; padding: 10px;'><di v class='spacer'></div></div>" |
649 "<div id='scroller7' class='scroller' style='background: url(data:image/ png;base64,iVBORw0KGgoAAAANSUhEUg) local, white content-box; padding: 10px;'><di v class='spacer'></div></div>" | 649 "<div id='scroller7' class='scroller' style='background: url(data:image/ png;base64,iVBORw0KGgoAAAANSUhEUg) local, white content-box; padding: 10px;'><di v class='spacer'></div></div>" |
650 "<div id='scroller8' class='scroller' style='background: white border-bo x;'><div class='spacer'></div></div>" | |
651 "<div id='scroller9' class='scroller' style='background: white border-bo x; border: 10px solid black;'><div class='spacer'></div></div>" | |
652 "<div id='scroller10' class='scroller' style='background: white border-b ox; border: 10px solid rgba(0, 0, 0, 0.5);'><div class='spacer'></div></div>" | |
653 "<div id='scroller11' class='scroller' style='background: white content- box;'><div class='spacer'></div></div>" | |
654 "<div id='scroller12' class='scroller' style='background: white content- box; padding: 10px;'><div class='spacer'></div></div>" | |
650 ); | 655 ); |
651 | 656 |
652 // First scroller cannot paint background into scrolling contents layer beca use it has a negative z-index child. | 657 // #scroller1 cannot paint background into scrolling contents layer because it has a negative z-index child. |
653 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller1")); | 658 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller1")); |
654 | 659 |
655 // Second scroller cannot paint background into scrolling contents layer bec ause it has a content-box clip without local attachment. | 660 // #scroller2 cannot paint background into scrolling contents layer because it has a content-box clip without local attachment. |
656 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller2")); | 661 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller2")); |
657 | 662 |
658 // Third scroller can paint background into scrolling contents layer. | 663 // #scroller3 can paint background into scrolling contents layer. |
659 EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller3")); | 664 EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller3")); |
660 | 665 |
661 // Fourth scroller cannot paint background into scrolling contents layer bec ause the background image is not locally attached. | 666 // #scroller4 cannot paint background into scrolling contents layer because the background image is not locally attached. |
662 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller4")); | 667 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller4")); |
663 | 668 |
664 // Fifth scroller can paint background into scrolling contents layer because both the image and color are locally attached. | 669 // #scroller5 can paint background into scrolling contents layer because bot h the image and color are locally attached. |
665 EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller5")); | 670 EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller5")); |
666 | 671 |
667 // Sixth scroller can paint background into scrolling contents layer because the image is locally attached and even though | 672 // #scroller6 can paint background into scrolling contents layer because the image is locally attached and even though |
668 // the color is not, it is filled to the padding box so it will be drawn the same as a locally attached background. | 673 // the color is not, it is filled to the padding box so it will be drawn the same as a locally attached background. |
669 EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller6")); | 674 EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller6")); |
670 | 675 |
671 // Seventh scroller cannot paint background into scrolling contents layer be cause the color is filled to the content | 676 // #scroller7 cannot paint background into scrolling contents layer because the color is filled to the content |
672 // box and we have padding so it is not equivalent to a locally attached bac kground. | 677 // box and we have padding so it is not equivalent to a locally attached bac kground. |
673 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller7")); | 678 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller7")); |
679 | |
680 // #scroller8 can paint background into scrolling contents layer because its border-box is equivalent to its | |
681 // padding box since it has no border. | |
682 EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller8")); | |
683 | |
684 // #scroller9 can paint background into scrolling contents layer because its border is opaque so it completely | |
685 // covers the background outside of the padding-box. | |
686 EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller9")); | |
687 | |
688 // #scroller10 cannot paint background into scrolling contents layer because its border is partially transparent | |
689 // so the background must be drawn to the border-box edges. | |
690 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller10")); | |
691 | |
692 // #scroller11 can paint background into scrolling contents layer because it s content-box is equivalent to its | |
693 // padding box since it has no padding | |
chrishtr
2016/08/22 22:10:51
nit: add period.
flackr
2016/08/26 15:41:16
Done.
| |
694 EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller11")); | |
695 | |
696 // #scroller12 cannot paint background into scrolling contents layer because it has padding so its content-box | |
697 // is not equivalent to its padding-box. | |
698 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller12")); | |
674 } | 699 } |
675 | 700 |
676 } // namespace blink | 701 } // namespace blink |
OLD | NEW |