WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-138884-20141119144332.patch (text/plain), 3.38 KB, created by
Chris Dumez
on 2014-11-19 14:43:18 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2014-11-19 14:43:18 PST
Size:
3.38 KB
patch
obsolete
>Subversion Revision: 176335 >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 689dd4a3b97cb2a95239844f45ca434b8198005e..e27ded4a3b02918537ff4bfd15b45651ad2b4fad 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,5 +1,18 @@ > 2014-11-19 Chris Dumez <cdumez@apple.com> > >+ Add layout test for DOM timer throttling in iframe scrolled out of viewport >+ https://bugs.webkit.org/show_bug.cgi?id=138884 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a layout test to test that a repeating DOM timer inside an iframe >+ get throttled if the iframe is scrolled out of the viewport. >+ >+ * fast/dom/resources/timer-throttling-iframe.html: Added. >+ * fast/dom/timer-throttle-on-scrolling-iframe-away.html: Added. >+ >+2014-11-19 Chris Dumez <cdumez@apple.com> >+ > Add layout test for throttling of DOM timer changing the style of visible and invisible elements > https://bugs.webkit.org/show_bug.cgi?id=138875 > >diff --git a/LayoutTests/fast/dom/resources/timer-throttling-iframe.html b/LayoutTests/fast/dom/resources/timer-throttling-iframe.html >new file mode 100644 >index 0000000000000000000000000000000000000000..6f5c2488a86a4245a13cde52d43dc49535cda971 >--- /dev/null >+++ b/LayoutTests/fast/dom/resources/timer-throttling-iframe.html >@@ -0,0 +1,23 @@ >+<!DOCTYPE html> >+<body> >+<div id="testElement">TEST</div> >+<script> >+var testElement = document.getElementById("testElement"); >+var iterationCount = 0; >+var timeoutId; >+ >+function timerCallback() { >+ ++iterationCount; >+ >+ // Change style of Element. >+ testElement.style["opacity"] = "" + (iterationCount / 10.); >+ >+ parent.timerFired(iterationCount, internals.isTimerThrottled(timeoutId)); >+ >+ if (iterationCount == 7) >+ clearInterval(timeoutId); >+} >+ >+timeoutId = setInterval(timerCallback, 0); >+</script> >+</body> >diff --git a/LayoutTests/fast/dom/timer-throttle-on-scrolling-iframe-away.html b/LayoutTests/fast/dom/timer-throttle-on-scrolling-iframe-away.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d5dcab8a06fdb69bc75a94d9d93ca4d563a4368f >--- /dev/null >+++ b/LayoutTests/fast/dom/timer-throttle-on-scrolling-iframe-away.html >@@ -0,0 +1,34 @@ >+<!DOCTYPE html> >+<body> >+<script src="../../resources/js-test-pre.js"></script> >+<script> >+description("Tests that a repeating timer in an iframe changing the style of an element gets throttled when scrolling the frame out of view."); >+jsTestIsAsync = true; >+ >+function scrollFrameOutOfView() >+{ >+ debug("Scrolling frame out of view."); >+ window.scrollBy(0,800); >+} >+ >+function timerFired(iterationCount, isThrottled) { >+ // 5 iterations should suffice to throttle the timer. >+ if (iterationCount == 5) { >+ debug("Frame is inside viewport, timer should not be throttled"); >+ isTimerThrottledBeforeScroll = isThrottled; >+ shouldBeFalse("isTimerThrottledBeforeScroll"); >+ scrollFrameOutOfView(); >+ } else if (iterationCount == 7) { >+ debug("Frame is outside viewport, timer should now be throttled"); >+ isTimerThrottledAfterScroll = isThrottled; >+ shouldBeTrue("isTimerThrottledAfterScroll"); >+ finishJSTest(); >+ } >+} >+ >+</script> >+<div style="position: relative; width: 1600px; height: 2400px; background-color: green;"> >+ <iframe id="testFrame" src="resources/timer-throttling-iframe.html" style="width: 100px; height: 100px;"></iframe> >+</div> >+<script src="../../resources/js-test-post.js"></script> >+</body>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 138884
: 241890