Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1080)

Side by Side Diff: LayoutTests/fast/events/overflow-events.html

Issue 959643002: Remove the overflowchanged event with a runtime flag (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tests Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script>
4 function setupTest() {
5 var horizontalOverflow = testResults[currentTest][1];
6 if (horizontalOverflow) {
7 document.getElementById('child').style.width = '200px';
8 } else {
9 document.getElementById('child').style.width = '50px';
10 }
11
12 var verticalOverflow = testResults[currentTest][2];
13 if (verticalOverflow) {
14 document.getElementById('child').style.height = '200px';
15 } else {
16 document.getElementById('child').style.height = '50px';
17 }
18 }
19
20 function finished(result)
21 {
22 document.getElementById('result').innerHTML = result;
23
24 if (window.testRunner)
25 testRunner.notifyDone();
26 }
27
28 function nextTest() {
29 if (currentTest == testResults.length) {
30 finished("SUCCESS");
31 return;
32 }
33
34 forceLayout();
35 setupTest();
36 forceLayout();
37 }
38
39 function overflowChanged(event) {
40 var result = [event.orient, event.horizontalOverflow, event.verticalOver flow];
41
42 if ('' + result == testResults[currentTest]) {
43 currentTest++;
44 nextTest();
45 } else
46 finished("FAILURE: expected " + testResults[currentTest] + " got " + result);
47 }
48
49 function forceLayout() {
50 document.body.offsetTop;
51 }
52
53 function runTest() {
54 if (window.testRunner) {
55 testRunner.dumpAsText();
56 testRunner.waitUntilDone();
57 }
58
59 testResults = [[OverflowEvent.HORIZONTAL, true, false],
60 [OverflowEvent.HORIZONTAL, false, false],
61 [OverflowEvent.VERTICAL, false, true],
62 [OverflowEvent.VERTICAL, false, false],
63 [OverflowEvent.BOTH, true, true],
64 [OverflowEvent.BOTH, false, false],
65 [OverflowEvent.VERTICAL, false, true],
66 [OverflowEvent.BOTH, true, false],
67 [OverflowEvent.BOTH, false, true]];
68
69 currentTest = 0;
70
71 var c = document.getElementById('container');
72 c.addEventListener('overflowchanged', overflowChanged, false);
73 nextTest();
74 }
75 </script>
76 </head>
77 <body onload="runTest()">
78 <div id="container" style="width:100; height:100px; border: solid red 2px; o verflow: hidden">
79 <div id="child" style="margin-top: 30px; margin-left: 30px; width:50px; height:50px; border: solid blue 2px;"></div>
80 </div>
81 This tests that overflowchanged events are fired correctly. If the test is s uccessful, the text "SUCCESS" should be shown below.
82 <div id="result">FAILURE</div>
83 </body>
84 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/events/event-creation-expected.txt ('k') | LayoutTests/fast/events/overflow-events-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698