Chromium Code Reviews| 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 6a86f8c51280fd286c050447144efd31bf19439b..6c1af3251ea025ebc6d2f00fdcca66b24b3b1f2b 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp |
| @@ -4,9 +4,11 @@ |
| #include "core/layout/LayoutObject.h" |
| +#include "core/frame/FrameView.h" |
| #include "core/layout/LayoutTestHelper.h" |
| #include "core/layout/LayoutView.h" |
| #include "core/layout/api/LayoutAPIShim.h" |
| +#include "platform/JSONValues.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| namespace blink { |
| @@ -124,4 +126,43 @@ TEST_F(LayoutObjectTest, PaintingLayerOfOverflowClipLayerUnderColumnSpanAll) |
| EXPECT_EQ(columns->layer(), overflowClipObject->paintingLayer()); |
| } |
| +TEST_F(LayoutObjectTest, TraverseNonCompositingDescendantsInPaintOrder) |
| +{ |
| + if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
| + return; |
| + |
| + enableCompositing(); |
| + setBodyInnerHTML( |
| + "<style>div { width: 10px; height: 10px; background-color: green; }</style>" |
| + "<div id='container' style='position: fixed'>" |
| + " <div id='normal-child'></div>" |
| + " <div id='stacked-child' style='position: relative'></div>" |
| + " <div id='composited-stacking-context' style='will-change: transform'>" |
| + " <div id='normal-child-of-composited-stacking-context'></div>" |
| + " <div id='stacked-child-of-composited-stacking-context' style='position: relative'></div>" |
| + " </div>" |
| + " <div id='composited-non-stacking-context' style='backface-visibility: hidden'>" |
| + " <div id='normal-child-of-composited-non-stacking-context'></div>" |
| + " <div id='stacked-child-of-composited-non-stacking-context' style='position: relative'></div>" |
| + " <div id='non-stacked-layered-child-of-composited-non-stacking-context' style='overflow: scroll'></div>" |
| + " </div>" |
| + "</div>"); |
| + |
| + document().view()->setTracksPaintInvalidations(true); |
| + getLayoutObjectByElementId("container")->invalidateDisplayItemClientsIncludingNonCompositingDescendants(PaintInvalidationSubtree); |
| + RefPtr<JSONArray> invalidations = document().view()->trackedObjectPaintInvalidationsAsJSON(); |
|
iclelland
2016/08/05 17:10:27
Drive-by note, because of the revert. This needs t
|
| + document().view()->setTracksPaintInvalidations(false); |
| + |
| + ASSERT_EQ(4u, invalidations->length()); |
| + String s; |
| + static_cast<JSONObject*>(invalidations->get(0).get())->get("object")->asString(&s); |
| + EXPECT_EQ(getLayoutObjectByElementId("container")->debugName(), s); |
| + static_cast<JSONObject*>(invalidations->get(1).get())->get("object")->asString(&s); |
| + EXPECT_EQ(getLayoutObjectByElementId("normal-child")->debugName(), s); |
| + static_cast<JSONObject*>(invalidations->get(2).get())->get("object")->asString(&s); |
| + EXPECT_EQ(getLayoutObjectByElementId("stacked-child")->debugName(), s); |
| + static_cast<JSONObject*>(invalidations->get(3).get())->get("object")->asString(&s); |
| + EXPECT_EQ(getLayoutObjectByElementId("stacked-child-of-composited-non-stacking-context")->debugName(), s); |
| +} |
| + |
| } // namespace blink |