Title: [176323] trunk/LayoutTests
Revision
176323
Author
[email protected]
Date
2014-11-19 10:27:33 -0800 (Wed, 19 Nov 2014)

Log Message

Add layout test for DOM timers throttling and 0 height element with visible overflowing content
https://bugs.webkit.org/show_bug.cgi?id=138873

Reviewed by Simon Fraser.

Add a layout test for verify that a DOM timer changing the style of a 0
height element with visible overflowing content does not get throttled.
If the implementation did not properly use the overflow rect to
determine if the element is visible, this test would fail.

This covers the case of the top scrolling banner on huffingtonpost.com.

* fast/dom/repeating-timer-element-overflow-throttling-expected.txt: Added.
* fast/dom/repeating-timer-element-overflow-throttling.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (176322 => 176323)


--- trunk/LayoutTests/ChangeLog	2014-11-19 17:52:58 UTC (rev 176322)
+++ trunk/LayoutTests/ChangeLog	2014-11-19 18:27:33 UTC (rev 176323)
@@ -1,3 +1,20 @@
+2014-11-19  Chris Dumez  <[email protected]>
+
+        Add layout test for DOM timers throttling and 0 height element with visible overflowing content
+        https://bugs.webkit.org/show_bug.cgi?id=138873
+
+        Reviewed by Simon Fraser.
+
+        Add a layout test for verify that a DOM timer changing the style of a 0
+        height element with visible overflowing content does not get throttled.
+        If the implementation did not properly use the overflow rect to
+        determine if the element is visible, this test would fail.
+
+        This covers the case of the top scrolling banner on huffingtonpost.com.
+
+        * fast/dom/repeating-timer-element-overflow-throttling-expected.txt: Added.
+        * fast/dom/repeating-timer-element-overflow-throttling.html: Added.
+
 2014-11-19  Chris Fleizach  <[email protected]>
 
         AX: Safari fails to load a web page with VoiceOver

Added: trunk/LayoutTests/fast/dom/repeating-timer-element-overflow-throttling-expected.txt (0 => 176323)


--- trunk/LayoutTests/fast/dom/repeating-timer-element-overflow-throttling-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/repeating-timer-element-overflow-throttling-expected.txt	2014-11-19 18:27:33 UTC (rev 176323)
@@ -0,0 +1,17 @@
+Tests that a repeating timer changing the style of an element with 0 height and visible overflowing content does not get throttled.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS testElement.offsetHeight is 0
+The timer should initially not be throttled.
+PASS internals.isTimerThrottled(timeoutId) is false
+5th iteration, timer should not have been throttled.
+PASS wasThrottled is false
+6th iteration, timer should still be unthrottled.
+PASS internals.isTimerThrottled(timeoutId) is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+test1
+test2

Added: trunk/LayoutTests/fast/dom/repeating-timer-element-overflow-throttling.html (0 => 176323)


--- trunk/LayoutTests/fast/dom/repeating-timer-element-overflow-throttling.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/repeating-timer-element-overflow-throttling.html	2014-11-19 18:27:33 UTC (rev 176323)
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<body>
+<script src=""
+<ul id="testElement" style="height: 0;">
+<li>test1</li>
+<li>test2</li>
+</ul>
+<script>
+description("Tests that a repeating timer changing the style of an element with 0 height and visible overflowing content does not get 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 not have been throttled.");
+    shouldBeFalse("wasThrottled");
+    debug("6th iteration, timer should still be unthrottled.");
+    shouldBeFalse("internals.isTimerThrottled(timeoutId)");
+    clearInterval(timeoutId);
+    finishJSTest();
+  }
+}
+
+shouldBe("testElement.offsetHeight", "0");
+
+timeoutId = setInterval(timerCallback, 0);
+debug("The timer should initially not be throttled.");
+shouldBeFalse("internals.isTimerThrottled(timeoutId)");
+</script>
+<script src=""
+</body>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to