test_list.html (2983B)
1 <html> 2 3 <head> 4 <title>nsIAccessible::name calculation for HTML li</title> 5 <link rel="stylesheet" type="text/css" 6 href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 7 8 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 9 10 <script type="application/javascript" 11 src="../common.js"></script> 12 <script type="application/javascript" 13 src="../name.js"></script> 14 <script type="application/javascript" 15 src="../events.js"></script> 16 17 <script type="application/javascript"> 18 /** 19 * Alter list item numbering and change list style type. 20 */ 21 function bulletUpdate() { 22 this.eventSeq = [ 23 new invokerChecker(EVENT_REORDER, getNode("list")), 24 ]; 25 26 this.invoke = function bulletUpdate_invoke() { 27 testName("li_end", "1. list end"); 28 29 var li = document.createElement("li"); 30 li.setAttribute("id", "li_start"); 31 li.textContent = "list start"; 32 getNode("list").insertBefore(li, getNode("li_end")); 33 }; 34 35 this.finalCheck = function bulletUpdate_finalCheck() { 36 testName("li_start", "1. list start"); 37 testName("li_end", "2. list end"); 38 }; 39 40 this.getID = function bulletUpdate_getID() { 41 return "insertBefore new list item"; 42 }; 43 } 44 function bulletUpdate2() { 45 this.eventSeq = [ 46 new invokerChecker(EVENT_REORDER, getNode("li_end")), 47 ]; 48 49 this.invoke = function bulletUpdate2_invoke() { 50 // change list style type 51 var list = getNode("list"); 52 list.setAttribute("style", "list-style-type: disc;"); 53 54 // Flush both the style change and the resulting layout change. 55 // Flushing style on its own is not sufficient, because that can 56 // leave frames marked with NS_FRAME_IS_DIRTY, which will cause 57 // nsTextFrame::GetRenderedText to report the text of a text 58 // frame is empty. 59 list.offsetWidth; // flush layout (which also flushes style) 60 }; 61 62 this.finalCheck = function bulletUpdate2_finalCheck() { 63 testName("li_start", kDiscBulletText + "list start"); 64 testName("li_end", kDiscBulletText + "list end"); 65 }; 66 67 this.getID = function bulletUpdate2_getID() { 68 return "Update list item style"; 69 }; 70 } 71 72 var gQueue = null; 73 function doTest() { 74 gQueue = new eventQueue(); 75 gQueue.push(new bulletUpdate()); 76 gQueue.push(new bulletUpdate2()); 77 gQueue.invoke(); // SimpleTest.finish(); 78 } 79 80 SimpleTest.waitForExplicitFinish(); 81 addA11yLoadEvent(doTest); 82 </script> 83 84 </head> 85 86 <body> 87 88 <a target="_blank" 89 href="https://bugzilla.mozilla.org/show_bug.cgi?id=634200" 90 title="crash [@ nsIFrame::StyleVisibility() ]"> 91 Mozilla Bug 634200 92 </a> 93 <p id="display"></p> 94 <div id="content" style="display: none"></div> 95 <pre id="test"> 96 </pre> 97 98 <ol id="list"> 99 <li id="li_end">list end</li> 100 </ol> 101 102 </body> 103 </html>