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

Unified Diff: LayoutTests/fast/repaint/iframe-throttling-unthrottled.html

Issue 1246173002: Throttle rendering pipeline for invisible iframes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add layout tests. Created 5 years, 3 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: LayoutTests/fast/repaint/iframe-throttling-unthrottled.html
diff --git a/LayoutTests/fast/repaint/iframe-throttling-unthrottled.html b/LayoutTests/fast/repaint/iframe-throttling-unthrottled.html
new file mode 100644
index 0000000000000000000000000000000000000000..d5049b46d8e7da6b91ce938e5c8decb0891d652b
--- /dev/null
+++ b/LayoutTests/fast/repaint/iframe-throttling-unthrottled.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<!-- Check that a throttled iframe repaints itself when scrolled into view. -->
+<style>
+#frame
+{
+ position: absolute;
+ top: 2000px;
+}
+</style>
+
+<script src="resources/text-based-repaint.js"></script>
+<script>
+window.testIsAsync = true;
+
+function repaintTest()
+{
+ var frame = document.querySelector('#frame');
+ frame.scrollIntoView();
+ // The first animation frame after this one updates the scroll position and
+ // unthrottles the frame. The repainting of the iframe happens in the frame
+ // after that. Therefore, we must wait for two requestAnimationFrames to
+ // finish the test.
+ window.requestAnimationFrame(waitForRepaint);
+}
+
+function waitForRepaint()
+{
+ window.requestAnimationFrame(finishRepaintTest);
+}
+
+window.addEventListener('load', runRepaintTest);
+</script>
+
+<!-- Use sandboxing to allow rendering pipeline throtting. -->
+<iframe id="frame" srcdoc="<style> body { background: green; } </style>" sandbox="" width="64" height="64"></iframe>

Powered by Google App Engine
This is Rietveld 408576698