| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
| 4 | 4 |
| 5 <p id="paragraph"> | 5 <p id="paragraph"> |
| 6 The <b id="quick">quick</b> brown fox | 6 The <b id="quick">quick</b> brown fox |
| 7 <br> | 7 <br> |
| 8 jumps over the lazy <b id="dog">dog</b>. | 8 jumps over the lazy <b id="dog">dog</b>. |
| 9 </p> | 9 </p> |
| 10 | 10 |
| 11 <div contentEditable="true" id="contentEditable"> | 11 <div contentEditable="true" id="contentEditable"> |
| 12 <div> | 12 <div> |
| 13 <span>Line </span><span>one has one trailing space.</span><span> </span> | 13 <span>Line </span><span>one has one trailing space.</span><span> </span> |
| 14 </div> | 14 </div> |
| 15 <div> | 15 <div> |
| 16 <span>		</span><span>Line</span><span> two has two leading tabs.</
span> | 16 <span>		</span><span>Line</span><span> two has two leading tabs.</
span> |
| 17 </div> | 17 </div> |
| 18 </div> | 18 </div> |
| 19 | 19 |
| 20 <p id="paragraphWithLink"> |
| 21 Paragraph with <a href="#">link</a> |
| 22 </p> |
| 23 |
| 20 <script> | 24 <script> |
| 21 test(function(t) | 25 test(function(t) |
| 22 { | 26 { |
| 23 var axObj = accessibilityController.accessibleElementById('paragraph'); | 27 var axObj = accessibilityController.accessibleElementById('paragraph'); |
| 24 // Find the first inline text box. | 28 // Find the first inline text box. |
| 25 while (axObj.childrenCount > 0) | 29 while (axObj.childrenCount > 0) |
| 26 axObj = axObj.childAtIndex(0); | 30 axObj = axObj.childAtIndex(0); |
| 27 assert_equals(axObj.role, 'AXRole: AXInlineTextBox'); | 31 assert_equals(axObj.role, 'AXRole: AXInlineTextBox'); |
| 28 | 32 |
| 29 var lineText = []; | 33 var lineText = []; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 86 |
| 83 // |next/previousOnLine| APIs jump directly to the inline text boxes | 87 // |next/previousOnLine| APIs jump directly to the inline text boxes |
| 84 // skipping the parent span element. | 88 // skipping the parent span element. |
| 85 assert_equals(span1.nextOnLine(), inlineText2, 'span1 -> inlineText2'); | 89 assert_equals(span1.nextOnLine(), inlineText2, 'span1 -> inlineText2'); |
| 86 assert_equals(inlineText1.nextOnLine(), inlineText2, 'inlineText1 -> inl
ineText2'); | 90 assert_equals(inlineText1.nextOnLine(), inlineText2, 'inlineText1 -> inl
ineText2'); |
| 87 assert_equals(span2.previousOnLine(), inlineText1, 'span2 -> inlineText1
'); | 91 assert_equals(span2.previousOnLine(), inlineText1, 'span2 -> inlineText1
'); |
| 88 assert_equals(inlineText2.previousOnLine(), inlineText1, 'inlineText2 ->
inlineText1'); | 92 assert_equals(inlineText2.previousOnLine(), inlineText1, 'inlineText2 ->
inlineText1'); |
| 89 } | 93 } |
| 90 }, 'Test |nextOnLine| and |previousOnLine| for |AXLayoutObject|.'); | 94 }, 'Test |nextOnLine| and |previousOnLine| for |AXLayoutObject|.'); |
| 91 | 95 |
| 96 test(function(t) |
| 97 { |
| 98 var axObj = accessibilityController.accessibleElementById('paragraphWithLink
'); |
| 99 // There should be one static text child and a link in this paragraph. |
| 100 assert_equals(axObj.childrenCount, 2); |
| 101 axObj = axObj.childAtIndex(0); |
| 102 assert_equals(axObj.role, 'AXRole: AXStaticText'); |
| 103 |
| 104 var lineText = []; |
| 105 lineText.push(axObj.name); |
| 106 axObj = axObj.nextOnLine(); |
| 107 assert_equals(axObj.role, 'AXRole: AXInlineTextBox'); |
| 108 lineText.push(axObj.name); |
| 109 axObj = axObj.previousOnLine(); |
| 110 assert_equals(axObj.role, 'AXRole: AXInlineTextBox'); |
| 111 lineText.push(axObj.name); |
| 112 assert_array_equals(lineText, ['Paragraph with ', 'link', 'Paragraph with ']
); |
| 113 }, 'Test |nextOnLine| and |previousOnLine| for paragraphs with links.'); |
| 114 |
| 92 if (window.testRunner) { | 115 if (window.testRunner) { |
| 93 document.getElementById('paragraph').style.display = 'none'; | 116 document.getElementById('paragraph').style.display = 'none'; |
| 94 document.getElementById('contentEditable').style.display = 'none'; | 117 document.getElementById('contentEditable').style.display = 'none'; |
| 118 document.getElementById('paragraphWithLink').style.display = 'none'; |
| 95 } | 119 } |
| 96 </script> | 120 </script> |
| OLD | NEW |