4 var longInlineBlockDirectionText = "longlonglonglonglongtext<br>longlonglonglonglongtext<br>longlonglonglonglongtext<br>longlonglonglonglongtext<br>longlonglonglonglongtext<br>longlonglonglonglongtext<br>";
5 var longInlineBaseDirectionText = "longlonglonglonglongtext";
6 var longBlockFlowDirectionText="long<br>long<br>long<br>long<br>long<br>long<br>long<br>";
9 // horizontal overflow.
10 var horizontalOverflow = testResults[currentTest][1];
11 var verticalOverflow = testResults[currentTest][2];
13 if (horizontalOverflow && verticalOverflow) {
14 document.getElementById('child').innerHTML = longInlineBlockDirectionText;
15 } else if (horizontalOverflow) {
16 document.getElementById('child').innerHTML = longBlockFlowDirectionText;
17 } else if (verticalOverflow) {
18 document.getElementById('child').innerHTML = longInlineBaseDirectionText;
20 document.getElementById('child').innerHTML = shortText;
24 function finished(result)
26 document.getElementById('result').innerHTML = result;
27 document.getElementById('child').innerHTML = "";
29 if (window.layoutTestController)
30 layoutTestController.notifyDone();
34 if (currentTest == testResults.length) {
45 function overflowChanged(event) {
46 var result = [event.orient, event.horizontalOverflow, event.verticalOverflow];
48 if ('' + result == testResults[currentTest]) {
52 finished("FAILURE: expected " + testResults[currentTest] + " got " + result);
55 function forceLayout() {
56 document.body.offsetTop;
60 if (window.layoutTestController) {
61 layoutTestController.dumpAsText();
62 layoutTestController.waitUntilDone();
65 testResults = [[OverflowEvent.HORIZONTAL, true, false],
66 [OverflowEvent.HORIZONTAL, false, false],
67 [OverflowEvent.VERTICAL, false, true],
68 [OverflowEvent.VERTICAL, false, false],
69 [OverflowEvent.BOTH, true, true],
70 [OverflowEvent.BOTH, false, false],
71 [OverflowEvent.VERTICAL, false, true],
72 [OverflowEvent.BOTH, true, false],
73 [OverflowEvent.BOTH, false, true]];
77 var c = document.getElementById('container');
78 c.addEventListener('overflowchanged', overflowChanged, false);
83 <body onload="runTest()">
84 <div id="container" style="width:100; height:100px; border: solid red 2px; overflow: hidden">
85 <div id="child" style="margin-top: 30px; margin-left: 30px; font-family: Ahem; border: solid blue 2px; -webkit-writing-mode: vertical-lr;"></div>
87 This tests that overflowchanged events are fired correctly on nodes with writing-mode: vertical-lr. If the test is successful, the text "SUCCESS" should be shown below.
88 <div id="result">FAILURE</div>