Bug 139701 - Add layout test for animated GIFs in iframes moved in and out of the viewport using -webkit-transform
Summary: Add layout test for animated GIFs in iframes moved in and out of the viewport...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on: 139672
Blocks:
  Show dependency treegraph
 
Reported: 2014-12-16 13:41 PST by Chris Dumez
Modified: 2015-01-07 14:26 PST (History)
4 users (show)

See Also:


Attachments
Patch (6.42 KB, patch)
2014-12-16 13:47 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (6.34 KB, patch)
2015-01-07 13:44 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2014-12-16 13:41:50 PST
Add layout test for animated GIFs in iframes moved in and out of the viewport using -webkit-transform CSS property.
Comment 1 Chris Dumez 2014-12-16 13:47:19 PST
Created attachment 243390 [details]
Patch
Comment 2 Chris Dumez 2015-01-05 12:27:30 PST
Ping review
Comment 3 Simon Fraser (smfr) 2015-01-07 13:41:12 PST
Comment on attachment 243390 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=243390&action=review

> LayoutTests/fast/images/animated-gif-iframe-webkit-transform.html:58
> +function isFirstImagePaused() {
> +  var firstFrame = document.getElementById("testFrame1");
> +  return internals.hasPausedImageAnimations(firstFrame.contentDocument.getElementById('testImage'));
> +}
> +
> +function isSecondImagePaused() {
> +  var secondFrame = document.getElementById("testFrame2");
> +  return internals.hasPausedImageAnimations(secondFrame.contentDocument.getElementById('testImage'));
> +}
> +
> +function forceLayout() {
> +  document.getElementById("scroller-cont").offsetLeft;
> +}
> +
> +function checkSecondImageUnpaused() {
> +  shouldBecomeEqual("isSecondImagePaused()", "false", translateImagesRight);
> +}
> +
> +function checkSecondImagePaused() {
> +  shouldBecomeEqual("isSecondImagePaused()", "true", finishJSTest);
> +}
> +
> +function translateImagesLeft() {
> +  shouldBeFalse("isFirstImagePaused()");
> +  debug("Translating images left so that first image is no longer visible, but second image is.");
> +  forceLayout();
> +  document.getElementById("scroller-cont").style["-webkit-transform"] = "translate(-800px, 0px)";
> +  shouldBecomeEqual("isFirstImagePaused()", "true", checkSecondImageUnpaused);
> +}
> +
> +function translateImagesRight() {
> +  debug("Translating images right so that second image is no longer visible, but first image is.");
> +  forceLayout();
> +  document.getElementById("scroller-cont").style["-webkit-transform"] = "translate(0px, 0px)";
> +  shouldBecomeEqual("isFirstImagePaused()", "false", checkSecondImagePaused);
> +}

JS style is opening paren on new line.
Comment 4 Chris Dumez 2015-01-07 13:44:47 PST
Created attachment 244188 [details]
Patch
Comment 5 WebKit Commit Bot 2015-01-07 14:26:29 PST
Comment on attachment 244188 [details]
Patch

Clearing flags on attachment: 244188

Committed r178053: <http://trac.webkit.org/changeset/178053>
Comment 6 WebKit Commit Bot 2015-01-07 14:26:33 PST
All reviewed patches have been landed.  Closing bug.