OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>Bug 9223: Test that an RTL element renders a resizer to its bottom-left c
orner and dragging this resizer to the left changes its width. To test manually,
dragging the resizer of the below element to left, and see this element increas
es its width.</title> |
3 <head> | 3 <script src="../resources/testharness.js"></script> |
4 <title>Bug 9223</title> | 4 <script src="../resources/testharnessreport.js"></script> |
5 <script src="../resources/js-test.js"></script> | 5 <body dir="rtl" style="margin: 0px"> |
6 </head> | 6 <div id="overflow" dir="rtl" style="border: 2px solid black; overflow: auto; wid
th: 400px; height: 400px; resize: both;"> |
7 <body dir="rtl" style="margin:0px"> | 7 <div style="background-color: red; height: 720px"></div> |
8 <div id="overflow" dir="rtl" style="border:2px solid black; overflow:auto; width
: 400px; height: 400px; resize:both;"> | 8 <div style="background-color: green; height: 1600px"></div> |
9 <div style="background-color:red;height:720px"></div> | |
10 <div style="background-color:green;height:1600px"></div> | |
11 </div> | 9 </div> |
12 <script> | 10 <script> |
13 description('Test that an RTL element renders a resizer to its bottom-left corne
r and ' + | 11 async_test(function(t) { |
14 'dragging this resizer to the left changes its width. ' + | 12 // This test must be async because it needs to wait for WebKit to finish |
15 'To test manually, dragging the resizer of the below element to left
, and ' + | 13 // re-layouting elements after sending mouse events. |
16 'see this element increases its width.'); | |
17 | |
18 // This test must be async because it needs to wait for WebKit to finish re-layo
uting elements | |
19 // after sending mouse events. | |
20 jsTestIsAsync = true; | |
21 | |
22 function finished() | |
23 { | |
24 shouldBeTrue('document.getElementById(\'overflow\').offsetWidth > offsetWidt
h'); | |
25 finishJSTest(); | |
26 } | |
27 | |
28 var offsetWidth = document.getElementById('overflow').offsetWidth; | |
29 | |
30 if (window.eventSender) { | |
31 var node = document.getElementById('overflow'); | 14 var node = document.getElementById('overflow'); |
| 15 var offsetWidth = node.offsetWidth; |
32 var offsetLeft = node.offsetLeft + 5; | 16 var offsetLeft = node.offsetLeft + 5; |
33 var offsetTop = node.offsetTop + node.offsetHeight - 5; | 17 var offsetTop = node.offsetTop + node.offsetHeight - 5; |
34 eventSender.mouseMoveTo(offsetLeft, offsetTop); | 18 eventSender.mouseMoveTo(offsetLeft, offsetTop); |
35 eventSender.mouseDown(); | 19 eventSender.mouseDown(); |
36 eventSender.mouseMoveTo(offsetLeft - 30, offsetTop); | 20 eventSender.mouseMoveTo(offsetLeft - 30, offsetTop); |
37 eventSender.mouseUp(); | 21 eventSender.mouseUp(); |
38 setTimeout(finished, 0); | 22 setTimeout(t.step_func_done(function() { |
39 } | 23 assert_greater_than(node.offsetWidth, offsetWidth); |
| 24 }), 0); |
| 25 }); |
40 </script> | 26 </script> |
41 </body> | 27 </body> |
42 </html> | |
OLD | NEW |