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

Unified Diff: third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp

Issue 1954093003: Don't try to paint graphics layers inside throttled frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add tests. Created 4 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp b/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
index a739e015bc405ddc375d6f9a245d8e2f44fce7c3..ae063ee128ba1fe7491c4ff8669534796e37d68c 100644
--- a/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
+++ b/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
@@ -778,4 +778,35 @@ TEST_F(FrameThrottlingTest, ThrottleSubtreeAtomically)
EXPECT_TRUE(childFrameElement->contentDocument()->view()->canThrottleRendering());
}
+TEST_F(FrameThrottlingTest, SkipPaintingLayersInThrottledFrames)
+{
+ webView().settings()->setAcceleratedCompositingEnabled(true);
+ webView().settings()->setPreferCompositingToLCDTextEnabled(true);
+
+ SimRequest mainResource("https://example.com/", "text/html");
+ SimRequest frameResource("https://example.com/iframe.html", "text/html");
+
+ loadURL("https://example.com/");
+ mainResource.complete("<iframe id=frame sandbox src=iframe.html></iframe>");
+ frameResource.complete("<div id=div style='transform: translateZ(0); background: red'>layer</div>");
+ auto displayItems = compositeFrame();
+ EXPECT_TRUE(displayItems.contains(SimCanvas::Rect, "red"));
+
+ auto* frameElement = toHTMLIFrameElement(document().getElementById("frame"));
+ frameElement->setAttribute(styleAttr, "transform: translateY(480px)");
+ compositeFrame();
+ EXPECT_TRUE(frameElement->contentDocument()->view()->canThrottleRendering());
+
+ auto* frameDocument = frameElement->contentDocument();
+ EXPECT_EQ(DocumentLifecycle::PaintClean, frameDocument->lifecycle().state());
+
+ // Simulate the paint for a graphics layer being externally invalidated
+ // (e.g., by video playback).
+ frameDocument->view()->layoutView()->invalidatePaintForViewAndCompositedLayers();
+
+ // The layer inside the throttled frame should not get painted.
+ auto displayItems2 = compositeFrame();
+ EXPECT_FALSE(displayItems2.contains(SimCanvas::Rect, "red"));
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698