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

Unified Diff: third_party/WebKit/LayoutTests/paint/invalidation/svg/animated-svg-as-image-background-offscreen.html

Issue 2783133002: Implement Image::maybeAnimated for SVGImage (Closed)
Patch Set: Fix typo Created 3 years, 9 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 | « no previous file | third_party/WebKit/LayoutTests/paint/invalidation/svg/animated-svg-as-image-background-offscreen-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/paint/invalidation/svg/animated-svg-as-image-background-offscreen.html
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/svg/animated-svg-as-image-background-offscreen.html b/third_party/WebKit/LayoutTests/paint/invalidation/svg/animated-svg-as-image-background-offscreen.html
new file mode 100644
index 0000000000000000000000000000000000000000..0d1e8227ea5d1488b61ea5b44255a1450beeaba0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/svg/animated-svg-as-image-background-offscreen.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<script src="../resources/text-based-repaint.js"></script>
+<script>
+window.testIsAsync = true;
+
+// Disable under-invalidation checking because the "under-invalidation" of
+// offscreen SVG animation is intentional.
+if (window.internals)
+ internals.runtimeFlags.paintUnderInvalidationCheckingEnabled = false;
+
+function repaintTest() {
+ if (window.internals)
+ internals.advanceImageAnimation(testTarget);
+ requestAnimationFrame(function() {
+ finishRepaintTest();
+ });
+}
+
+function targetImageOnload() {
+ // Scroll targetImage offscreen.
+ window.scrollTo(0, 1000);
+ runRepaintTest();
+}
+
+window.onload = function() {
+ targetImage.style.background = "url(../../../svg/as-image/resources/animated-rect-fixed-size-2.svg)";
chrishtr 2017/03/30 15:42:35 Does this sufficiently test the case of an animate
fs 2017/03/31 10:32:46 Yes, this should trigger the code in LayoutBox::im
+
+ // Use a parallel image element as a hack to detect whether the image has loaded, and therefore
+ // we'll get a frame.
chrishtr 2017/03/30 15:42:35 onload events don't work for SVG Images? Weird. Wh
fs 2017/03/31 10:32:46 They do, but for background images you won't get a
+ testTarget.onload = targetImageOnload;
+ testTarget.src = "../../../svg/as-image/resources/animated-rect-fixed-size-2.svg";
+}
+</script>
+<div style="height: 2000px; width: 2000px;">
+ <div id="targetImage" style="width: 50px; height: 50px"></div>
+ <img id="testTarget" style="visibility: hidden">
+</div>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/paint/invalidation/svg/animated-svg-as-image-background-offscreen-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698