blob: 4464fd743114ccc65dbd78ae5f7daf0b7b8d853a [file] [log] [blame]
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<p id="p" style="width: 10em;">
This paragraph contains two lines of text.
<p id="description"></p>
<pre id="tree"></pre>
<div id="console"></div>
async_test((t) => {
var axParagraph = accessibilityController.accessibleElementById('p');
var axStaticText = axParagraph.childAtIndex(0);
assert_equals(axStaticText.childrenCount, 2);
var axInlineBefore0 = axStaticText.childAtIndex(0);
assert_equals(, 'This paragraph contains ');
var axInlineBefore1 = axStaticText.childAtIndex(1);
assert_equals(, 'two lines of text.');
// Modify the text.
document.getElementById("p").style.width = "100em";
// Wait for a notification on the element before checking the new state.
axStaticText.addNotificationListener(t.step_func((notification) => {
// Make sure the inline text boxes changed.
assert_equals(axStaticText.childrenCount, 1);
var axInlineAfter0 = axStaticText.childAtIndex(0);
assert_equals(, 'This paragraph contains two lines of text.');
}, "Tests that accessible inline text boxes update when the static text style changes.");