Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp

Issue 2716203003: Fix paint property under-invalidation of CSS clip on resize (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/paint/PaintPropertyTreeBuilderTest.h" 6 #include "core/paint/PaintPropertyTreeBuilderTest.h"
7 #include "core/paint/PaintPropertyTreePrinter.h" 7 #include "core/paint/PaintPropertyTreePrinter.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 auto* transformObject = transform->layoutObject(); 643 auto* transformObject = transform->layoutObject();
644 EXPECT_EQ(TransformationMatrix().translate3d(50, 100, 0), 644 EXPECT_EQ(TransformationMatrix().translate3d(50, 100, 0),
645 transformObject->paintProperties()->transform()->matrix()); 645 transformObject->paintProperties()->transform()->matrix());
646 646
647 transform->setAttribute(HTMLNames::styleAttr, "width: 200px; height: 300px;"); 647 transform->setAttribute(HTMLNames::styleAttr, "width: 200px; height: 300px;");
648 document().view()->updateAllLifecyclePhases(); 648 document().view()->updateAllLifecyclePhases();
649 EXPECT_EQ(TransformationMatrix().translate3d(100, 150, 0), 649 EXPECT_EQ(TransformationMatrix().translate3d(100, 150, 0),
650 transformObject->paintProperties()->transform()->matrix()); 650 transformObject->paintProperties()->transform()->matrix());
651 } 651 }
652 652
653 TEST_P(PaintPropertyTreeUpdateTest, CSSClipDependingOnSize) {
654 setBodyInnerHTML(
655 "<style>"
656 " body { margin: 0 }"
657 " #outer {"
658 " position: absolute;"
659 " width: 100px; height: 100px; top: 50px; left: 50px;"
660 " }"
661 " #clip {"
662 " position: absolute;"
663 " clip: rect(auto auto auto -5px);"
664 " top: 0; left: 0; right: 0; bottom: 0;"
665 " }"
666 "</style>"
667 "<div id='outer'>"
668 " <div id='clip'></div>"
669 "</div>");
670
671 auto* outer = document().getElementById("outer");
672 auto* clip = getLayoutObjectByElementId("clip");
673 EXPECT_EQ(FloatRect(45, 50, 105, 100),
674 clip->paintProperties()->cssClip()->clipRect().rect());
675
676 outer->setAttribute(HTMLNames::styleAttr, "height: 200px");
677 document().view()->updateAllLifecyclePhases();
678 EXPECT_EQ(FloatRect(45, 50, 105, 200),
679 clip->paintProperties()->cssClip()->clipRect().rect());
680 }
681
653 } // namespace blink 682 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698