OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../resources/js-test.js"></script> | 4 <title>Test that horizontal scrollbar should appear as the content width encroac hes upon the vertical scrollbar and also test if WebKit can show the left side o f the inner elements regardless of the position of its scrollbars. To test manua lly, open this document and verify we can see "ABC" both in the LTR element and in the RTL element.</title> |
5 <script src="../../resources/testharness.js"></script> | |
6 <script src="../../resources/testharnessreport.js"></script> | |
5 </head> | 7 </head> |
6 <body dir="ltr"> | 8 <body dir="ltr"> |
7 <div dir="ltr" id="outer-ltr" style="width: 200px; height: 200px; overflow: auto ;"> | 9 <div dir="ltr" id="outer-ltr" style="width: 200px; height: 200px; overflow: auto ;"> |
8 <div id="inner-ltr" style="text-align: left; width: 195px; height: 300px;">ABC</ div> | 10 <div id="inner-ltr" style="text-align: left; width: 195px; height: 300px;">ABC</ div> |
9 </div> | 11 </div> |
10 <div dir="rtl" id="outer-rtl" style="width: 200px; height: 200px; overflow: auto ;"> | 12 <div dir="rtl" id="outer-rtl" style="width: 200px; height: 200px; overflow: auto ;"> |
11 <div id="inner-rtl" style="text-align: left; width: 195px; height: 300px;">ABC</ div> | 13 <div id="inner-rtl" style="text-align: left; width: 195px; height: 300px;">ABC</ div> |
12 </div> | 14 </div> |
13 <script type="text/javascript"> | 15 <script type="text/javascript"> |
14 description('Test that horizontal scrollbar should appear as the content width e ncroaches upon the vertical scrollbar and also test if WebKit can show the left side of the inner elements regardless of the position of its scrollbars. To test manually, open this document and verify we can see "ABC" both in the LTR elemen t and in the RTL element.'); | 16 test(function(){ |
Srirama
2016/08/10 13:24:39
nit: add space between () and {
| |
17 var outerLTR = document.getElementById('outer-ltr'); | |
18 var innerLTR = document.getElementById('inner-ltr'); | |
19 var outerRTL = document.getElementById('outer-rtl'); | |
20 var innerRTL = document.getElementById('inner-rtl'); | |
21 outerLTR.scrollLeft = 0; | |
22 outerRTL.scrollLeft = 0; | |
23 /*Verify the widths of the outer RTL elements are the same as the widths of | |
Srirama
2016/08/10 13:24:39
use single line comments "//"
| |
24 the outer LTR elements.*/ | |
25 assert_equals(outerLTR.offsetWidth, outerRTL.offsetWidth); | |
26 assert_equals(outerLTR.clientWidth, outerRTL.clientWidth); | |
27 assert_equals(outerLTR.scrollWidth, outerRTL.scrollWidth); | |
15 | 28 |
16 var outerLTR = document.getElementById('outer-ltr'); | 29 /*Verify the widths of the inner RTL elements are the same as the widths of |
17 var innerLTR = document.getElementById('inner-ltr'); | 30 the inner LTR elements.*/ |
18 var outerRTL = document.getElementById('outer-rtl'); | 31 assert_equals(innerLTR.offsetWidth, innerRTL.offsetWidth); |
19 var innerRTL = document.getElementById('inner-rtl'); | 32 assert_equals(innerLTR.clientWidth, innerRTL.clientWidth); |
20 outerLTR.scrollLeft = 0; | 33 assert_equals(innerLTR.scrollWidth, innerRTL.scrollWidth); |
21 outerRTL.scrollLeft = 0; | |
22 | 34 |
23 debug('Verify the widths of the outer RTL elements are the same as the widths of the outer LTR elements.'); | 35 /*Verify the width of the vertical scrollbar of the outer RTL element is th |
24 shouldBeTrue('outerLTR.offsetWidth == outerRTL.offsetWidth'); | 36 e same as the one of the outer LTR element regardless of their scrollbar pos itio |
25 shouldBeTrue('outerLTR.clientWidth == outerRTL.clientWidth'); | 37 ns.*/ |
26 shouldBeTrue('outerLTR.scrollWidth == outerRTL.scrollWidth'); | 38 var scrollbarWidthLTR = outerLTR.offsetWidth - outerLTR.clientWidth; |
27 | 39 var scrollbarWidthRTL = outerRTL.offsetWidth - outerRTL.clientWidth; |
28 debug('Verify the widths of the inner RTL elements are the same as the widths of the inner LTR elements.'); | 40 assert_equals(scrollbarWidthLTR, scrollbarWidthRTL); |
29 shouldBeTrue('innerLTR.offsetWidth == innerRTL.offsetWidth'); | 41 assert_equals(outerRTL.clientLeft, scrollbarWidthRTL); |
30 shouldBeTrue('innerLTR.clientWidth == innerRTL.clientWidth'); | 42 }); |
31 shouldBeTrue('innerLTR.scrollWidth == innerRTL.scrollWidth'); | |
32 | |
33 debug('Verify the width of the vertical scrollbar of the outer RTL element is th e same as the one of the outer LTR element regardless of their scrollbar positio ns.'); | |
34 var scrollbarWidthLTR = outerLTR.offsetWidth - outerLTR.clientWidth; | |
35 var scrollbarWidthRTL = outerRTL.offsetWidth - outerRTL.clientWidth; | |
36 shouldBeTrue('scrollbarWidthLTR == scrollbarWidthRTL'); | |
37 shouldBeTrue('outerRTL.clientLeft == scrollbarWidthRTL'); | |
38 </script> | 43 </script> |
39 </body> | 44 </body> |
40 </html> | 45 </html> |
OLD | NEW |