OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>Bug 91756: Test if the widths of RTL elements are the same as the widths
of the LTR elements when they include absolutely-positioned children.</title> |
3 <head> | 3 <script src="../../resources/testharness.js"></script> |
4 <title>Bug 91756</title> | 4 <script src="../../resources/testharnessreport.js"></script> |
5 <script src="../../resources/js-test.js"></script> | |
6 <style> | 5 <style> |
7 div.outer { overflow: auto; width: 100px; position: relative; height: 100px; bor
der: solid; } | 6 div.outer { overflow: auto; width: 100px; position: relative; height: 100px; bor
der: solid; } |
8 div.inner { position: absolute; top: 250px; } | 7 div.inner { position: absolute; top: 250px; } |
9 </style> | 8 </style> |
10 </head> | |
11 <body> | 9 <body> |
12 <div id="outerLTR" class="outer"><div id="innerLTR" class="inner" style="left: 2
00px;">foo</div></div> | 10 <div id="outerLTR" class="outer"><div id="innerLTR" class="inner" style="left: 2
00px;">foo</div></div> |
13 <div id="outerRTL" class="outer" style="direction: rtl;"><div id="innerRTL" clas
s="inner" style="right: 200px;">foo</div> | 11 <div id="outerRTL" class="outer" style="direction: rtl;"><div id="innerRTL" clas
s="inner" style="right: 200px;">foo</div> |
14 </div> | 12 </div> |
15 <script type="text/javascript"> | 13 <script> |
16 description('Test if the widths of RTL elements are the same as the widths of th
e LTR elements when they include absolutely-positioned children.'); | 14 test(function() { |
| 15 // Verify the widths of the outer RTL element are the same as the widths of
the outer LTR element. |
| 16 var outerLTR = document.getElementById("outerLTR"); |
| 17 var outerRTL = document.getElementById("outerRTL"); |
| 18 assert_equals(outerLTR.offsetWidth, outerRTL.offsetWidth); |
| 19 assert_equals(outerLTR.clientWidth, outerRTL.clientWidth); |
| 20 assert_equals(outerLTR.scrollWidth, outerRTL.scrollWidth); |
17 | 21 |
18 debug('Verify the widths of the outer RTL element are the same as the widths of
the outer LTR element.'); | 22 // Verify the widths of the inner RTL element are the same as the widths of
the inner LTR element. |
19 var outerLTR = document.getElementById('outerLTR'); | 23 var innerLTR = document.getElementById("innerLTR"); |
20 var outerRTL = document.getElementById('outerRTL'); | 24 var innerRTL = document.getElementById("innerRTL"); |
21 shouldBeTrue('outerLTR.offsetWidth == outerRTL.offsetWidth'); | 25 assert_equals(innerLTR.offsetWidth, innerRTL.offsetWidth); |
22 shouldBeTrue('outerLTR.clientWidth == outerRTL.clientWidth'); | 26 assert_equals(innerLTR.clientWidth, innerRTL.clientWidth); |
23 shouldBeTrue('outerLTR.scrollWidth == outerRTL.scrollWidth'); | 27 assert_equals(innerLTR.scrollWidth, innerRTL.scrollWidth); |
24 | 28 }); |
25 debug('Verify the widths of the inner RTL element are the same as the widths of
the inner LTR element.'); | |
26 var innerLTR = document.getElementById('innerLTR'); | |
27 var innerRTL = document.getElementById('innerRTL'); | |
28 shouldBeTrue('innerLTR.offsetWidth == innerRTL.offsetWidth'); | |
29 shouldBeTrue('innerLTR.clientWidth == innerRTL.clientWidth'); | |
30 shouldBeTrue('innerLTR.scrollWidth == innerRTL.scrollWidth'); | |
31 </script> | 29 </script> |
32 </body> | 30 </body> |
33 </html> | |
OLD | NEW |