Bug 139701

Summary: Add layout test for animated GIFs in iframes moved in and out of the viewport using -webkit-transform
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Layout and RenderingAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, commit-queue, koivisto, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 139672    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch none

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.