| 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..1a1b566159e7be87fc9a628b32461838221ea1b1 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);
|
| + std::unique_ptr<JSONArray> invalidations = document().view()->trackedObjectPaintInvalidationsAsJSON();
|
| + document().view()->setTracksPaintInvalidations(false);
|
| +
|
| + ASSERT_EQ(4u, invalidations->size());
|
| + String s;
|
| + JSONObject::cast(invalidations->at(0))->get("object")->asString(&s);
|
| + EXPECT_EQ(getLayoutObjectByElementId("container")->debugName(), s);
|
| + JSONObject::cast(invalidations->at(1))->get("object")->asString(&s);
|
| + EXPECT_EQ(getLayoutObjectByElementId("normal-child")->debugName(), s);
|
| + JSONObject::cast(invalidations->at(2))->get("object")->asString(&s);
|
| + EXPECT_EQ(getLayoutObjectByElementId("stacked-child")->debugName(), s);
|
| + JSONObject::cast(invalidations->at(3))->get("object")->asString(&s);
|
| + EXPECT_EQ(getLayoutObjectByElementId("stacked-child-of-composited-non-stacking-context")->debugName(), s);
|
| +}
|
| +
|
| } // namespace blink
|
|
|