<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[176333] trunk/LayoutTests</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/176333">176333</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-11-19 13:15:00 -0800 (Wed, 19 Nov 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>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
Reviewed by Simon Fraser.
Add a layout test to test that a repeating DOM timer changing the style
of both visible and invisible elements does not get throttled.
Also rename existing tests to use "display-none" instead of "invisible"
for clarity.
* fast/dom/nested-timer-display-none-element-throttling-expected.txt: Renamed from LayoutTests/fast/dom/nested-timer-invisible-element-throttling-expected.txt.
* fast/dom/nested-timer-display-none-element-throttling.html: Renamed from LayoutTests/fast/dom/nested-timer-invisible-element-throttling.html.
* fast/dom/repeating-timer-display-none-element-throttling-expected.txt: Renamed from LayoutTests/fast/dom/repeating-timer-invisible-element-throttling-expected.txt.
* fast/dom/repeating-timer-display-none-element-throttling.html: Renamed from LayoutTests/fast/dom/repeating-timer-invisible-element-throttling.html.
* fast/dom/repeating-timer-mixed-visible-display-none-elements-throttling-expected.txt: Added.
* fast/dom/repeating-timer-mixed-visible-display-none-elements-throttling.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomnestedtimerdisplaynoneelementthrottlingexpectedtxt">trunk/LayoutTests/fast/dom/nested-timer-display-none-element-throttling-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomnestedtimerdisplaynoneelementthrottlinghtml">trunk/LayoutTests/fast/dom/nested-timer-display-none-element-throttling.html</a></li>
<li><a href="#trunkLayoutTestsfastdomrepeatingtimerdisplaynoneelementthrottlingexpectedtxt">trunk/LayoutTests/fast/dom/repeating-timer-display-none-element-throttling-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomrepeatingtimerdisplaynoneelementthrottlinghtml">trunk/LayoutTests/fast/dom/repeating-timer-display-none-element-throttling.html</a></li>
<li><a href="#trunkLayoutTestsfastdomrepeatingtimermixedvisibledisplaynoneelementsthrottlingexpectedtxt">trunk/LayoutTests/fast/dom/repeating-timer-mixed-visible-display-none-elements-throttling-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomrepeatingtimermixedvisibledisplaynoneelementsthrottlinghtml">trunk/LayoutTests/fast/dom/repeating-timer-mixed-visible-display-none-elements-throttling.html</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomnestedtimerinvisibleelementthrottlingexpectedtxt">trunk/LayoutTests/fast/dom/nested-timer-invisible-element-throttling-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomnestedtimerinvisibleelementthrottlinghtml">trunk/LayoutTests/fast/dom/nested-timer-invisible-element-throttling.html</a></li>
<li><a href="#trunkLayoutTestsfastdomrepeatingtimerinvisibleelementthrottlingexpectedtxt">trunk/LayoutTests/fast/dom/repeating-timer-invisible-element-throttling-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomrepeatingtimerinvisibleelementthrottlinghtml">trunk/LayoutTests/fast/dom/repeating-timer-invisible-element-throttling.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (176332 => 176333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-11-19 21:01:55 UTC (rev 176332)
+++ trunk/LayoutTests/ChangeLog        2014-11-19 21:15:00 UTC (rev 176333)
</span><span class="lines">@@ -1,5 +1,25 @@
</span><span class="cx"> 2014-11-19 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><ins>+ 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
+
+ Reviewed by Simon Fraser.
+
+ Add a layout test to test that a repeating DOM timer changing the style
+ of both visible and invisible elements does not get throttled.
+
+ Also rename existing tests to use "display-none" instead of "invisible"
+ for clarity.
+
+ * fast/dom/nested-timer-display-none-element-throttling-expected.txt: Renamed from LayoutTests/fast/dom/nested-timer-invisible-element-throttling-expected.txt.
+ * fast/dom/nested-timer-display-none-element-throttling.html: Renamed from LayoutTests/fast/dom/nested-timer-invisible-element-throttling.html.
+ * fast/dom/repeating-timer-display-none-element-throttling-expected.txt: Renamed from LayoutTests/fast/dom/repeating-timer-invisible-element-throttling-expected.txt.
+ * fast/dom/repeating-timer-display-none-element-throttling.html: Renamed from LayoutTests/fast/dom/repeating-timer-invisible-element-throttling.html.
+ * fast/dom/repeating-timer-mixed-visible-display-none-elements-throttling-expected.txt: Added.
+ * fast/dom/repeating-timer-mixed-visible-display-none-elements-throttling.html: Added.
+
+2014-11-19 Chris Dumez <cdumez@apple.com>
+
</ins><span class="cx"> Add layout test for DOM timer throttling and element moving into view after layout
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=138874
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomnestedtimerdisplaynoneelementthrottlingexpectedtxtfromrev176331trunkLayoutTestsfastdomnestedtimerinvisibleelementthrottlingexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/fast/dom/nested-timer-display-none-element-throttling-expected.txt (from rev 176331, trunk/LayoutTests/fast/dom/nested-timer-invisible-element-throttling-expected.txt) (0 => 176333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/nested-timer-display-none-element-throttling-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/dom/nested-timer-display-none-element-throttling-expected.txt        2014-11-19 21:15:00 UTC (rev 176333)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+Tests that a nested timer changing the style of a display:none element gets throttled.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+The timer should initially not be throttled.
+PASS internals.isTimerThrottled(timeoutId) is false
+5th iteration, timer should have been throttled.
+PASS wasThrottled is true
+6th iteration, timer should still be throttled.
+PASS internals.isTimerThrottled(timeoutId) is true
+Timer mutated the DOM tree.
+7th iteration, timer should no longer be throttled.
+PASS internals.isTimerThrottled(timeoutId) is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomnestedtimerdisplaynoneelementthrottlinghtmlfromrev176331trunkLayoutTestsfastdomnestedtimerinvisibleelementthrottlinghtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/fast/dom/nested-timer-display-none-element-throttling.html (from rev 176331, trunk/LayoutTests/fast/dom/nested-timer-invisible-element-throttling.html) (0 => 176333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/nested-timer-display-none-element-throttling.html         (rev 0)
+++ trunk/LayoutTests/fast/dom/nested-timer-display-none-element-throttling.html        2014-11-19 21:15:00 UTC (rev 176333)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+<!DOCTYPE html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<div id="testElement" style="display: none">Test</div>
+<script>
+description("Tests that a nested timer changing the style of a display:none element gets throttled.");
+jsTestIsAsync = true;
+
+var iterationCount = 0;
+var timeoutId;
+var testElement = document.getElementById("testElement");
+var wasThrottled = false;
+
+function checkTimerThrottleState()
+{
+ if (iterationCount == 5) {
+ // Do not use shouldBeTrue() here because it would cause a DOM tree mutation and
+ // unthrottle the DOM Timer.
+ wasThrottled = internals.isTimerThrottled(timeoutId);
+ } else if (iterationCount == 6) {
+ debug("5th iteration, timer should have been throttled.");
+ shouldBeTrue("wasThrottled");
+ debug("6th iteration, timer should still be throttled.");
+ shouldBeTrue("internals.isTimerThrottled(timeoutId)");
+ } else if (iterationCount >= 6) {
+ // Timer should be unthrottled due to the DOM tree mutation caused by shouldBeTrue() in
+ // the previous iteration.
+ debug("" + iterationCount + "th iteration, timer should no longer be throttled.");
+ shouldBeFalse("internals.isTimerThrottled(timeoutId)");
+ clearTimeout(timeoutId);
+ finishJSTest();
+ }
+}
+
+function timerCallback()
+{
+ ++iterationCount;
+ // Interact with the style of the element.
+ testElement.style["left"] = "" + iterationCount + "px";
+
+ // 5 iterations should be sufficient to throttle the timer.
+ if (iterationCount >= 5) {
+ setTimeout(checkTimerThrottleState, 0);
+ if (iterationCount == 7) {
+ // The call to debug() mutates the DOM tree.
+ debug("Timer mutated the DOM tree.");
+ }
+ }
+
+ timeoutId = setTimeout(timerCallback, 0);
+}
+
+timeoutId = setTimeout(timerCallback, 0);
+debug("The timer should initially not be throttled.");
+shouldBeFalse("internals.isTimerThrottled(timeoutId)");
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomnestedtimerinvisibleelementthrottlingexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/nested-timer-invisible-element-throttling-expected.txt (176332 => 176333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/nested-timer-invisible-element-throttling-expected.txt        2014-11-19 21:01:55 UTC (rev 176332)
+++ trunk/LayoutTests/fast/dom/nested-timer-invisible-element-throttling-expected.txt        2014-11-19 21:15:00 UTC (rev 176333)
</span><span class="lines">@@ -1,18 +0,0 @@
</span><del>-Tests that a nested timer changing the style of a non-visible element gets throttled.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-The timer should initially not be throttled.
-PASS internals.isTimerThrottled(timeoutId) is false
-5th iteration, timer should have been throttled.
-PASS wasThrottled is true
-6th iteration, timer should still be throttled.
-PASS internals.isTimerThrottled(timeoutId) is true
-Timer mutated the DOM tree.
-7th iteration, timer should no longer be throttled.
-PASS internals.isTimerThrottled(timeoutId) is false
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestsfastdomnestedtimerinvisibleelementthrottlinghtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/nested-timer-invisible-element-throttling.html (176332 => 176333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/nested-timer-invisible-element-throttling.html        2014-11-19 21:01:55 UTC (rev 176332)
+++ trunk/LayoutTests/fast/dom/nested-timer-invisible-element-throttling.html        2014-11-19 21:15:00 UTC (rev 176333)
</span><span class="lines">@@ -1,58 +0,0 @@
</span><del>-<!DOCTYPE html>
-<body>
-<script src="../../resources/js-test-pre.js"></script>
-<div id="testElement" style="display: none">Test</div>
-<script>
-description("Tests that a nested timer changing the style of a non-visible element gets throttled.");
-jsTestIsAsync = true;
-
-var iterationCount = 0;
-var timeoutId;
-var testElement = document.getElementById("testElement");
-var wasThrottled = false;
-
-function checkTimerThrottleState()
-{
- if (iterationCount == 5) {
- // Do not use shouldBeTrue() here because it would cause a DOM tree mutation and
- // unthrottle the DOM Timer.
- wasThrottled = internals.isTimerThrottled(timeoutId);
- } else if (iterationCount == 6) {
- debug("5th iteration, timer should have been throttled.");
- shouldBeTrue("wasThrottled");
- debug("6th iteration, timer should still be throttled.");
- shouldBeTrue("internals.isTimerThrottled(timeoutId)");
- } else if (iterationCount >= 6) {
- // Timer should be unthrottled due to the DOM tree mutation caused by shouldBeTrue() in
- // the previous iteration.
- debug("" + iterationCount + "th iteration, timer should no longer be throttled.");
- shouldBeFalse("internals.isTimerThrottled(timeoutId)");
- clearTimeout(timeoutId);
- finishJSTest();
- }
-}
-
-function timerCallback()
-{
- ++iterationCount;
- // Interact with the style of the element.
- testElement.style["left"] = "" + iterationCount + "px";
-
- // 5 iterations should be sufficient to throttle the timer.
- if (iterationCount >= 5) {
- setTimeout(checkTimerThrottleState, 0);
- if (iterationCount == 7) {
- // The call to debug() mutates the DOM tree.
- debug("Timer mutated the DOM tree.");
- }
- }
-
- timeoutId = setTimeout(timerCallback, 0);
-}
-
-timeoutId = setTimeout(timerCallback, 0);
-debug("The timer should initially not be throttled.");
-shouldBeFalse("internals.isTimerThrottled(timeoutId)");
-</script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
</del></span></pre></div>
<a id="trunkLayoutTestsfastdomrepeatingtimerdisplaynoneelementthrottlingexpectedtxtfromrev176331trunkLayoutTestsfastdomrepeatingtimerinvisibleelementthrottlingexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/fast/dom/repeating-timer-display-none-element-throttling-expected.txt (from rev 176331, trunk/LayoutTests/fast/dom/repeating-timer-invisible-element-throttling-expected.txt) (0 => 176333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/repeating-timer-display-none-element-throttling-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/dom/repeating-timer-display-none-element-throttling-expected.txt        2014-11-19 21:15:00 UTC (rev 176333)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+Tests that a repeating timer changing the style of a display:none element gets throttled.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+The timer should initially not be throttled.
+PASS internals.isTimerThrottled(timeoutId) is false
+5th iteration, timer should have been throttled.
+PASS wasThrottled is true
+6th iteration, timer should still be throttled.
+PASS internals.isTimerThrottled(timeoutId) is true
+Timer mutated the DOM tree.
+7th iteration, timer should no longer be throttled.
+PASS internals.isTimerThrottled(timeoutId) is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomrepeatingtimerdisplaynoneelementthrottlinghtmlfromrev176331trunkLayoutTestsfastdomrepeatingtimerinvisibleelementthrottlinghtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/fast/dom/repeating-timer-display-none-element-throttling.html (from rev 176331, trunk/LayoutTests/fast/dom/repeating-timer-invisible-element-throttling.html) (0 => 176333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/repeating-timer-display-none-element-throttling.html         (rev 0)
+++ trunk/LayoutTests/fast/dom/repeating-timer-display-none-element-throttling.html        2014-11-19 21:15:00 UTC (rev 176333)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+<!DOCTYPE html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<div id="testElement" style="display: none">Test</div>
+<script>
+description("Tests that a repeating timer changing the style of a display:none element gets throttled.");
+jsTestIsAsync = true;
+
+var iterationCount = 0;
+var timeoutId;
+var testElement = document.getElementById("testElement");
+var wasThrottled = false;
+
+function timerCallback()
+{
+ ++iterationCount;
+ // Interact with the style of the element.
+ testElement.style["left"] = "" + iterationCount + "px";
+
+ // 5 iterations should suffice to throttle the timer.
+ if (iterationCount == 5) {
+ // Do not use shouldBeTrue() here because it would cause a DOM tree mutation and
+ // unthrottle the DOM Timer.
+ wasThrottled = internals.isTimerThrottled(timeoutId);
+ } else if (iterationCount == 6) {
+ debug("5th iteration, timer should have been throttled.");
+ shouldBeTrue("wasThrottled");
+ debug("6th iteration, timer should still be throttled.");
+ shouldBeTrue("internals.isTimerThrottled(timeoutId)");
+ debug("Timer mutated the DOM tree.");
+ } else if (iterationCount >= 6) {
+ // Timer should be unthrottled due to the DOM tree mutation caused by shouldBeTrue() in
+ // the previous iteration.
+ debug("" + iterationCount + "th iteration, timer should no longer be throttled.");
+ shouldBeFalse("internals.isTimerThrottled(timeoutId)");
+ clearInterval(timeoutId);
+ finishJSTest();
+ }
+}
+
+timeoutId = setInterval(timerCallback, 0);
+debug("The timer should initially not be throttled.");
+shouldBeFalse("internals.isTimerThrottled(timeoutId)");
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomrepeatingtimerinvisibleelementthrottlingexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/repeating-timer-invisible-element-throttling-expected.txt (176332 => 176333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/repeating-timer-invisible-element-throttling-expected.txt        2014-11-19 21:01:55 UTC (rev 176332)
+++ trunk/LayoutTests/fast/dom/repeating-timer-invisible-element-throttling-expected.txt        2014-11-19 21:15:00 UTC (rev 176333)
</span><span class="lines">@@ -1,18 +0,0 @@
</span><del>-Tests that a repeating timer changing the style of a non-visible element gets throttled.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-The timer should initially not be throttled.
-PASS internals.isTimerThrottled(timeoutId) is false
-5th iteration, timer should have been throttled.
-PASS wasThrottled is true
-6th iteration, timer should still be throttled.
-PASS internals.isTimerThrottled(timeoutId) is true
-Timer mutated the DOM tree.
-7th iteration, timer should no longer be throttled.
-PASS internals.isTimerThrottled(timeoutId) is false
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestsfastdomrepeatingtimerinvisibleelementthrottlinghtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/repeating-timer-invisible-element-throttling.html (176332 => 176333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/repeating-timer-invisible-element-throttling.html        2014-11-19 21:01:55 UTC (rev 176332)
+++ trunk/LayoutTests/fast/dom/repeating-timer-invisible-element-throttling.html        2014-11-19 21:15:00 UTC (rev 176333)
</span><span class="lines">@@ -1,46 +0,0 @@
</span><del>-<!DOCTYPE html>
-<body>
-<script src="../../resources/js-test-pre.js"></script>
-<div id="testElement" style="display: none">Test</div>
-<script>
-description("Tests that a repeating timer changing the style of a non-visible element gets throttled.");
-jsTestIsAsync = true;
-
-var iterationCount = 0;
-var timeoutId;
-var testElement = document.getElementById("testElement");
-var wasThrottled = false;
-
-function timerCallback()
-{
- ++iterationCount;
- // Interact with the style of the element.
- testElement.style["left"] = "" + iterationCount + "px";
-
- // 5 iterations should suffice to throttle the timer.
- if (iterationCount == 5) {
- // Do not use shouldBeTrue() here because it would cause a DOM tree mutation and
- // unthrottle the DOM Timer.
- wasThrottled = internals.isTimerThrottled(timeoutId);
- } else if (iterationCount == 6) {
- debug("5th iteration, timer should have been throttled.");
- shouldBeTrue("wasThrottled");
- debug("6th iteration, timer should still be throttled.");
- shouldBeTrue("internals.isTimerThrottled(timeoutId)");
- debug("Timer mutated the DOM tree.");
- } else if (iterationCount >= 6) {
- // Timer should be unthrottled due to the DOM tree mutation caused by shouldBeTrue() in
- // the previous iteration.
- debug("" + iterationCount + "th iteration, timer should no longer be throttled.");
- shouldBeFalse("internals.isTimerThrottled(timeoutId)");
- clearInterval(timeoutId);
- finishJSTest();
- }
-}
-
-timeoutId = setInterval(timerCallback, 0);
-debug("The timer should initially not be throttled.");
-shouldBeFalse("internals.isTimerThrottled(timeoutId)");
-</script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
</del></span></pre></div>
<a id="trunkLayoutTestsfastdomrepeatingtimermixedvisibledisplaynoneelementsthrottlingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/repeating-timer-mixed-visible-display-none-elements-throttling-expected.txt (0 => 176333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/repeating-timer-mixed-visible-display-none-elements-throttling-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/dom/repeating-timer-mixed-visible-display-none-elements-throttling-expected.txt        2014-11-19 21:15:00 UTC (rev 176333)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+Tests that a repeating timer changing the style of both visible and display:none elements does not throttled.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+The timer should initially not be throttled.
+PASS internals.isTimerThrottled(timeoutId) is false
+PASS internals.isTimerThrottled(timeoutId) is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+Visible
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomrepeatingtimermixedvisibledisplaynoneelementsthrottlinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/repeating-timer-mixed-visible-display-none-elements-throttling.html (0 => 176333)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/repeating-timer-mixed-visible-display-none-elements-throttling.html         (rev 0)
+++ trunk/LayoutTests/fast/dom/repeating-timer-mixed-visible-display-none-elements-throttling.html        2014-11-19 21:15:00 UTC (rev 176333)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+<!DOCTYPE html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<div id="visibleElement">Visible</div>
+<div id="invisibleElement1" style="display: none">Invisible</div>
+<div id="invisibleElement2" style="display: none">Invisible</div>
+<script>
+description("Tests that a repeating timer changing the style of both visible and display:none elements does not throttled.");
+jsTestIsAsync = true;
+
+var iterationCount = 0;
+var timeoutId;
+var visibleElement = document.getElementById("visibleElement");
+var invisibleElement1 = document.getElementById("visibleElement");
+var invisibleElement2 = document.getElementById("invisibleElement2");
+var wasThrottled = false;
+
+function timerCallback()
+{
+ ++iterationCount;
+ // Interact with the style of the elements.
+ invisibleElement1.style["left"] = "" + iterationCount + "px";
+ visibleElement.style["left"] = "" + iterationCount + "px";
+ invisibleElement2.style["left"] = "" + iterationCount + "px";
+
+ // 5 iterations should suffice to throttle the timer.
+ if (iterationCount == 5) {
+ shouldBeFalse("internals.isTimerThrottled(timeoutId)");
+ clearInterval(timeoutId);
+ finishJSTest();
+ }
+}
+
+timeoutId = setInterval(timerCallback, 0);
+debug("The timer should initially not be throttled.");
+shouldBeFalse("internals.isTimerThrottled(timeoutId)");
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
</ins></span></pre>
</div>
</div>
</body>
</html>