blob: f1184fc4b174e3eba26a25d8953a500eef8d9906 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>Bug 85856</title>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body dir="ltr" style="-webkit-writing-mode: vertical-rl;">
<div dir="ltr" id="outer-ltr" style="width: 200px; height: 200px; overflow: scroll;">
<div id="inner-ltr" style="text-align: left; width: 300px; height: 300px;">ABC</div>
</div>
<div dir="rtl" id="outer-rtl" style="width: 200px; height: 200px; overflow: scroll;">
<div id="inner-rtl" style="text-align: left; width: 300px; height: 300px;">ABC</div>
</div>
<script type="text/javascript">
description('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 element and in the RTL element.');
var outerLTR = document.getElementById('outer-ltr');
var innerLTR = document.getElementById('inner-ltr');
var outerRTL = document.getElementById('outer-rtl');
var innerRTL = document.getElementById('inner-rtl');
outerLTR.scrollLeft = 0;
outerRTL.scrollLeft = 0;
debug('Verify the widths of the outer RTL elements are the same as the widths of the outer LTR elements.');
shouldBeTrue('outerLTR.offsetWidth == outerRTL.offsetWidth');
shouldBeTrue('outerLTR.clientWidth == outerRTL.clientWidth');
shouldBeTrue('outerLTR.scrollWidth == outerRTL.scrollWidth');
debug('Verify the widths of the inner RTL elements are the same as the widths of the inner LTR elements.');
shouldBeTrue('innerLTR.offsetWidth == innerRTL.offsetWidth');
shouldBeTrue('innerLTR.clientWidth == innerRTL.clientWidth');
shouldBeTrue('innerLTR.scrollWidth == innerRTL.scrollWidth');
debug('Verify the width of the vertical scrollbar of the outer RTL element is the same as the one of the outer LTR element regardless of their scrollbar positions.');
var scrollbarWidthLTR = outerLTR.offsetWidth - outerLTR.clientWidth;
var scrollbarWidthRTL = outerRTL.offsetWidth - outerRTL.clientWidth;
shouldBeTrue('scrollbarWidthLTR == scrollbarWidthRTL');
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>