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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp

Issue 2831203002: Fix LayoutObject::SetSubtreeNeedsPaintPropertyUpdate() to set ancestor flags (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp b/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp
index e1beee33b14b9205bb0303130927983f8bf7d375..b099b184c4eea2c1a24966d16e0c048565b21fdb 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp
@@ -198,10 +198,11 @@ TEST_F(LayoutObjectTest, MutableForPaintingClearPaintFlags) {
EXPECT_TRUE(object->BackgroundChangedSinceLastPaintInvalidation());
object->SetNeedsPaintPropertyUpdate();
EXPECT_TRUE(object->NeedsPaintPropertyUpdate());
+ EXPECT_TRUE(object->Parent()->DescendantNeedsPaintPropertyUpdate());
object->bitfields_.SetDescendantNeedsPaintPropertyUpdate(true);
EXPECT_TRUE(object->DescendantNeedsPaintPropertyUpdate());
- ScopedSlimmingPaintV2ForTest enable_s_pv2(true);
+ ScopedSlimmingPaintInvalidationForTest enable_sp_invalidation(true);
GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInPrePaint);
object->GetMutableForPainting().ClearPaintFlags();
@@ -215,6 +216,21 @@ TEST_F(LayoutObjectTest, MutableForPaintingClearPaintFlags) {
EXPECT_FALSE(object->DescendantNeedsPaintPropertyUpdate());
}
+TEST_F(LayoutObjectTest, SubtreeNeedsPaintPropertyUpdate) {
+ LayoutObject* object = GetDocument().body()->GetLayoutObject();
+ object->SetSubtreeNeedsPaintPropertyUpdate();
+ EXPECT_TRUE(object->SubtreeNeedsPaintPropertyUpdate());
+ EXPECT_TRUE(object->NeedsPaintPropertyUpdate());
+ EXPECT_TRUE(object->Parent()->DescendantNeedsPaintPropertyUpdate());
+
+ ScopedSlimmingPaintInvalidationForTest enable_sp_invalidation(true);
+ GetDocument().Lifecycle().AdvanceTo(DocumentLifecycle::kInPrePaint);
+ object->GetMutableForPainting().ClearPaintFlags();
+
+ EXPECT_FALSE(object->SubtreeNeedsPaintPropertyUpdate());
+ EXPECT_FALSE(object->NeedsPaintPropertyUpdate());
+}
+
TEST_F(LayoutObjectTest, NeedsPaintOffsetAndVisualRectUpdate) {
LayoutObject* object = GetDocument().body()->GetLayoutObject();
LayoutObject* parent = object->Parent();

Powered by Google App Engine
This is Rietveld 408576698