| 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/layout/LayoutObject.h" | 5 #include "core/layout/LayoutObject.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/layout/LayoutTestHelper.h" | 8 #include "core/layout/LayoutTestHelper.h" |
| 9 #include "core/layout/LayoutView.h" | 9 #include "core/layout/LayoutView.h" |
| 10 #include "platform/json/JSONValues.h" | 10 #include "platform/json/JSONValues.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 LayoutBoxModelObject* layeredSpan = | 162 LayoutBoxModelObject* layeredSpan = |
| 163 toLayoutBoxModelObject(getLayoutObjectByElementId("layered-span")); | 163 toLayoutBoxModelObject(getLayoutObjectByElementId("layered-span")); |
| 164 LayoutObject* floating = getLayoutObjectByElementId("floating"); | 164 LayoutObject* floating = getLayoutObjectByElementId("floating"); |
| 165 | 165 |
| 166 EXPECT_EQ(layeredDiv->layer(), layeredDiv->paintingLayer()); | 166 EXPECT_EQ(layeredDiv->layer(), layeredDiv->paintingLayer()); |
| 167 EXPECT_EQ(layeredSpan->layer(), layeredSpan->paintingLayer()); | 167 EXPECT_EQ(layeredSpan->layer(), layeredSpan->paintingLayer()); |
| 168 EXPECT_EQ(layeredDiv->layer(), floating->paintingLayer()); | 168 EXPECT_EQ(layeredDiv->layer(), floating->paintingLayer()); |
| 169 EXPECT_EQ(container, floating->container()); | 169 EXPECT_EQ(container, floating->container()); |
| 170 EXPECT_EQ(container, floating->containingBlock()); | 170 EXPECT_EQ(container, floating->containingBlock()); |
| 171 | 171 |
| 172 bool ancestorSkipped = false; | 172 LayoutObject::AncestorSkipInfo skipInfo(layeredSpan); |
| 173 EXPECT_EQ(container, floating->container(layeredSpan, &ancestorSkipped)); | 173 EXPECT_EQ(container, floating->container(&skipInfo)); |
| 174 EXPECT_TRUE(ancestorSkipped); | 174 EXPECT_TRUE(skipInfo.ancestorSkipped); |
| 175 | 175 |
| 176 ancestorSkipped = false; | 176 skipInfo.setAncestor(container); |
| 177 EXPECT_EQ(container, floating->container(container, &ancestorSkipped)); | 177 EXPECT_EQ(container, floating->container(&skipInfo)); |
| 178 EXPECT_FALSE(ancestorSkipped); | 178 EXPECT_FALSE(skipInfo.ancestorSkipped); |
| 179 } | 179 } |
| 180 | 180 |
| 181 TEST_F(LayoutObjectTest, MutableForPaintingClearPaintFlags) { | 181 TEST_F(LayoutObjectTest, MutableForPaintingClearPaintFlags) { |
| 182 LayoutObject* object = document().body()->layoutObject(); | 182 LayoutObject* object = document().body()->layoutObject(); |
| 183 object->setShouldDoFullPaintInvalidation(); | 183 object->setShouldDoFullPaintInvalidation(); |
| 184 EXPECT_TRUE(object->shouldDoFullPaintInvalidation()); | 184 EXPECT_TRUE(object->shouldDoFullPaintInvalidation()); |
| 185 object->m_bitfields.setChildShouldCheckForPaintInvalidation(true); | 185 object->m_bitfields.setChildShouldCheckForPaintInvalidation(true); |
| 186 EXPECT_TRUE(object->m_bitfields.childShouldCheckForPaintInvalidation()); | 186 EXPECT_TRUE(object->m_bitfields.childShouldCheckForPaintInvalidation()); |
| 187 object->setMayNeedPaintInvalidation(); | 187 object->setMayNeedPaintInvalidation(); |
| 188 EXPECT_TRUE(object->mayNeedPaintInvalidation()); | 188 EXPECT_TRUE(object->mayNeedPaintInvalidation()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 208 EXPECT_FALSE(object->mayNeedPaintInvalidation()); | 208 EXPECT_FALSE(object->mayNeedPaintInvalidation()); |
| 209 EXPECT_FALSE(object->mayNeedPaintInvalidationSubtree()); | 209 EXPECT_FALSE(object->mayNeedPaintInvalidationSubtree()); |
| 210 EXPECT_FALSE(object->mayNeedPaintInvalidationAnimatedBackgroundImage()); | 210 EXPECT_FALSE(object->mayNeedPaintInvalidationAnimatedBackgroundImage()); |
| 211 EXPECT_FALSE(object->shouldInvalidateSelection()); | 211 EXPECT_FALSE(object->shouldInvalidateSelection()); |
| 212 EXPECT_FALSE(object->backgroundChangedSinceLastPaintInvalidation()); | 212 EXPECT_FALSE(object->backgroundChangedSinceLastPaintInvalidation()); |
| 213 EXPECT_FALSE(object->needsPaintPropertyUpdate()); | 213 EXPECT_FALSE(object->needsPaintPropertyUpdate()); |
| 214 EXPECT_FALSE(object->descendantNeedsPaintPropertyUpdate()); | 214 EXPECT_FALSE(object->descendantNeedsPaintPropertyUpdate()); |
| 215 } | 215 } |
| 216 | 216 |
| 217 } // namespace blink | 217 } // namespace blink |
| OLD | NEW |