OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | |
3 <head> | 2 <head> |
Srirama
2016/08/10 13:24:39
nit: remove head here and in all the tests.
MuVen
2016/08/11 07:05:16
Done.
| |
4 <title>Bug 91756</title> | 3 <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> |
5 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/testharness.js"></script> |
5 <script src="../../resources/testharnessreport.js"></script> | |
6 <style> | 6 <style> |
7 div.outer { overflow: auto; width: 100px; position: relative; height: 100px; bor der: solid; } | 7 div.outer { overflow: auto; width: 100px; position: relative; height: 100px; bor der: solid; } |
8 div.inner { position: absolute; top: 250px; } | 8 div.inner { position: absolute; top: 250px; } |
9 </style> | 9 </style> |
10 </head> | 10 </head> |
11 <body> | 11 <body> |
12 <div id="outerLTR" class="outer"><div id="innerLTR" class="inner" style="left: 2 00px;">foo</div></div> | 12 <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> | 13 <div id="outerRTL" class="outer" style="direction: rtl;"><div id="innerRTL" clas s="inner" style="right: 200px;">foo</div> |
14 </div> | 14 </div> |
15 <script type="text/javascript"> | 15 <script type="text/javascript"> |
Srirama
2016/08/10 13:24:39
"type" attribute not required, remove here and in
MuVen
2016/08/11 07:05:16
Done.
| |
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.'); | 16 test(function(){ |
Srirama
2016/08/10 13:24:39
nit: space between () and {, in other tests as wel
MuVen
2016/08/11 07:05:16
Done.
| |
17 /*Verify the widths of the outer RTL element are the same as the widths of | |
Srirama
2016/08/10 13:24:39
nit: use single line comments "//", they look bett
MuVen
2016/08/11 07:05:16
Done.
| |
18 the outer LTR element.*/ | |
19 var outerLTR = document.getElementById('outerLTR'); | |
20 var outerRTL = document.getElementById('outerRTL'); | |
21 assert_equals(outerLTR.offsetWidth, outerRTL.offsetWidth); | |
22 assert_equals(outerLTR.clientWidth, outerRTL.clientWidth); | |
23 assert_equals(outerLTR.scrollWidth, outerRTL.scrollWidth); | |
17 | 24 |
18 debug('Verify the widths of the outer RTL element are the same as the widths of the outer LTR element.'); | 25 /*Verify the widths of the inner RTL element are the same as the widths of |
Srirama
2016/08/10 13:24:39
ditto.
MuVen
2016/08/11 07:05:16
Done.
| |
19 var outerLTR = document.getElementById('outerLTR'); | 26 the inner LTR element.*/ |
20 var outerRTL = document.getElementById('outerRTL'); | 27 var innerLTR = document.getElementById('innerLTR'); |
21 shouldBeTrue('outerLTR.offsetWidth == outerRTL.offsetWidth'); | 28 var innerRTL = document.getElementById('innerRTL'); |
22 shouldBeTrue('outerLTR.clientWidth == outerRTL.clientWidth'); | 29 assert_equals(innerLTR.offsetWidth, innerRTL.offsetWidth); |
23 shouldBeTrue('outerLTR.scrollWidth == outerRTL.scrollWidth'); | 30 assert_equals(innerLTR.clientWidth, innerRTL.clientWidth); |
24 | 31 assert_equals(innerLTR.scrollWidth, innerRTL.scrollWidth); |
25 debug('Verify the widths of the inner RTL element are the same as the widths of the inner LTR element.'); | 32 }); |
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> | 33 </script> |
32 </body> | 34 </body> |
33 </html> | |
OLD | NEW |