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

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

Issue 2219913002: Reland of Don't traverse non-stacked layer under composited child in traverseNonCompositingDescendants (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix conflict (after JSONValues change) Created 4 years, 4 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 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.cpp ('k') | tools/perf/benchmarks/system_health_smoke_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698