blob: 19533e1319255a3f6e429b03b04d4600fdc79abb [file] [log] [blame]
<html>
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body id="body">
text
<div id="text-ellipsis" tabindex="0" style="width:50px; text-overflow:ellipsis; overflow:hidden; white-space: nowrap;" class="name">My Writing Nook for iPad. More text, more text, more text.</div>
<div id="text-noellipsis" tabindex="0" style="width:50px; white-space: nowrap;" class="name">My Writing Nook for iPad. More text, more text, more text.</div>
text
<p id="description"></p>
<div id="console"></div>
<script>
if (window.accessibilityController) {
description("This test makes sure that the bounds of text that overflows with ellipsis is correct (shortened to the ellipsis that is).");
// The width of the ellipsis text should be short.
var textContainer = accessibilityController.accessibleElementById("text-ellipsis");
var textNode = textContainer.childrenCount ? textContainer.childAtIndex(0) : textContainer;
var clippedWidth = textNode.width;
// The width of non-ellipsis'd text should be longer.
textContainer = accessibilityController.accessibleElementById("text-noellipsis");
textNode = textContainer.childrenCount ? textContainer.childAtIndex(0) : textContainer;
var fullWidth = textNode.width;
shouldBeTrue("clippedWidth < fullWidth");
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>