test_nsITableEditor_getCellDataAt.html (47630B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Test for nsITableEditor.getCellDataAt()</title> 5 <script src="/tests/SimpleTest/SimpleTest.js"></script> 6 <link rel="stylesheet" href="/tests/SimpleTest/test.css"> 7 </head> 8 <body> 9 <div id="display"> 10 </div> 11 <div id="content" contenteditable>out of table<table><tr><td>default content</td></tr></table></div> 12 <pre id="test"> 13 </pre> 14 15 <script class="testbody" type="application/javascript"> 16 17 SimpleTest.waitForExplicitFinish(); 18 SimpleTest.waitForFocus(function() { 19 let editor = document.getElementById("content"); 20 let selection = document.getSelection(); 21 22 let cellElementWrapper; 23 let startRowIndexWrapper, startColumnIndexWrapper; 24 let rowspanWrapper, colspanWrapper; 25 let effectiveRowspanWrapper, effectiveColspanWrapper; 26 let isSelectedWrapper; 27 28 function reset() { 29 cellElementWrapper = {}; 30 startRowIndexWrapper = {}; 31 startColumnIndexWrapper = {}; 32 rowspanWrapper = {}; 33 colspanWrapper = {}; 34 effectiveRowspanWrapper = {}; 35 effectiveColspanWrapper = {}; 36 isSelectedWrapper = {}; 37 } 38 39 editor.focus(); 40 selection.collapse(editor.firstChild, 0); 41 try { 42 getTableEditor().getCellDataAt(null, 0, 0, 43 cellElementWrapper, 44 startRowIndexWrapper, startColumnIndexWrapper, 45 rowspanWrapper, colspanWrapper, 46 effectiveRowspanWrapper, effectiveColspanWrapper, 47 isSelectedWrapper); 48 ok(false, "getTableEditor().getCellDataAt(null, 0, 0) should throw exception when selection is outside of any <table>s"); 49 } catch (e) { 50 ok(true, "getTableEditor().getCellDataAt(null, 0, 0) should throw exception when selection is outside of any <table>s"); 51 } 52 53 selection.removeAllRanges(); 54 try { 55 getTableEditor().getCellDataAt(null, 0, 0, 56 cellElementWrapper, 57 startRowIndexWrapper, startColumnIndexWrapper, 58 rowspanWrapper, colspanWrapper, 59 effectiveRowspanWrapper, effectiveColspanWrapper, 60 isSelectedWrapper); 61 ok(false, "getTableEditor().getCellDataAt(null, 0, 0) should throw exception when selection has no ranges"); 62 } catch (e) { 63 ok(true, "getTableEditor().getCellDataAt(null, 0, 0) should throw exception when selection has no ranges"); 64 } 65 66 // Collapse in text node in the cell element. 67 selection.collapse(editor.firstChild.nextSibling.firstChild.firstChild.firstChild.firstChild, 0); 68 reset(); 69 getTableEditor().getCellDataAt(null, 0, 0, 70 cellElementWrapper, 71 startRowIndexWrapper, startColumnIndexWrapper, 72 rowspanWrapper, colspanWrapper, 73 effectiveRowspanWrapper, effectiveColspanWrapper, 74 isSelectedWrapper); 75 is(cellElementWrapper.value, editor.firstChild.nextSibling.firstChild.firstChild.firstChild, 76 "getTableEditor().getCellDataAt(null, 0, 0) should return the <td> element when selection is in it"); 77 is(startRowIndexWrapper.value, 0, 78 "getTableEditor().getCellDataAt(null, 0, 0) should return 0 for startRowIndex when selection is in the cell"); 79 is(startColumnIndexWrapper.value, 0, 80 "getTableEditor().getCellDataAt(null, 0, 0) should return 0 for startColumnIndex when selection is in the cell"); 81 is(rowspanWrapper.value, 1, 82 "getTableEditor().getCellDataAt(null, 0, 0) should return 1 for rowspan when selection is in the cell"); 83 is(colspanWrapper.value, 1, 84 "getTableEditor().getCellDataAt(null, 0, 0) should return 1 for colspan when selection is in the cell"); 85 is(effectiveRowspanWrapper.value, 1, 86 "getTableEditor().getCellDataAt(null, 0, 0) should return 1 for effectiveRowspan when selection is in the cell"); 87 is(effectiveColspanWrapper.value, 1, 88 "getTableEditor().getCellDataAt(null, 0, 0) should return 1 for effectiveColspan when selection is in the cell"); 89 is(isSelectedWrapper.value, false, 90 "getTableEditor().getCellDataAt(null, 0, 0) should return false for isSelected when selection is in the cell"); 91 92 // Select the cell 93 selection.setBaseAndExtent(editor.firstChild.nextSibling.firstChild.firstChild, 0, 94 editor.firstChild.nextSibling.firstChild.firstChild, 1); 95 reset(); 96 getTableEditor().getCellDataAt(null, 0, 0, 97 cellElementWrapper, 98 startRowIndexWrapper, startColumnIndexWrapper, 99 rowspanWrapper, colspanWrapper, 100 effectiveRowspanWrapper, effectiveColspanWrapper, 101 isSelectedWrapper); 102 is(cellElementWrapper.value, editor.firstChild.nextSibling.firstChild.firstChild.firstChild, 103 "getTableEditor().getCellDataAt(null, 0, 0) should return the <td> element when it's selected"); 104 is(startRowIndexWrapper.value, 0, 105 "getTableEditor().getCellDataAt(null, 0, 0) should return 0 for startRowIndex when the cell is selected"); 106 is(startColumnIndexWrapper.value, 0, 107 "getTableEditor().getCellDataAt(null, 0, 0) should return 0 for startColumnIndex when the cell is selected"); 108 is(rowspanWrapper.value, 1, 109 "getTableEditor().getCellDataAt(null, 0, 0) should return 1 for rowspan when the cell is selected"); 110 is(colspanWrapper.value, 1, 111 "getTableEditor().getCellDataAt(null, 0, 0) should return 1 for colspan when the cell is selected"); 112 is(effectiveRowspanWrapper.value, 1, 113 "getTableEditor().getCellDataAt(null, 0, 0) should return 1 for effectiveRowspan when the cell is selected"); 114 is(effectiveColspanWrapper.value, 1, 115 "getTableEditor().getCellDataAt(null, 0, 0) should return 1 for effectiveColspan when the cell is selected"); 116 is(isSelectedWrapper.value, true, 117 "getTableEditor().getCellDataAt(null, 0, 0) should return true for isSelected when the cell is selected"); 118 119 // Select the <tr> 120 selection.setBaseAndExtent(editor.firstChild.nextSibling.firstChild, 0, 121 editor.firstChild.nextSibling.firstChild, 1); 122 reset(); 123 getTableEditor().getCellDataAt(null, 0, 0, 124 cellElementWrapper, 125 startRowIndexWrapper, startColumnIndexWrapper, 126 rowspanWrapper, colspanWrapper, 127 effectiveRowspanWrapper, effectiveColspanWrapper, 128 isSelectedWrapper); 129 is(cellElementWrapper.value, editor.firstChild.nextSibling.firstChild.firstChild.firstChild, 130 "getTableEditor().getCellDataAt(null, 0, 0) should return the <td> element when the <tr> is selected"); 131 is(startRowIndexWrapper.value, 0, 132 "getTableEditor().getCellDataAt(null, 0, 0) should return 0 for startRowIndex when the <tr> is selected"); 133 is(startColumnIndexWrapper.value, 0, 134 "getTableEditor().getCellDataAt(null, 0, 0) should return 0 for startColumnIndex when the <tr> is selected"); 135 is(rowspanWrapper.value, 1, 136 "getTableEditor().getCellDataAt(null, 0, 0) should return 1 for rowspan when the <tr> is selected"); 137 is(colspanWrapper.value, 1, 138 "getTableEditor().getCellDataAt(null, 0, 0) should return 1 for colspan when the <tr> is selected"); 139 is(effectiveRowspanWrapper.value, 1, 140 "getTableEditor().getCellDataAt(null, 0, 0) should return 1 for effectiveRowspan when the <tr> is selected"); 141 is(effectiveColspanWrapper.value, 1, 142 "getTableEditor().getCellDataAt(null, 0, 0) should return 1 for effectiveColspan when the <tr> is selected"); 143 is(isSelectedWrapper.value, true, 144 "getTableEditor().getCellDataAt(null, 0, 0) should return true for isSelected when the <tr> is selected"); 145 146 // Select the <table> 147 selection.setBaseAndExtent(editor, 1, editor, 2); 148 reset(); 149 getTableEditor().getCellDataAt(null, 0, 0, 150 cellElementWrapper, 151 startRowIndexWrapper, startColumnIndexWrapper, 152 rowspanWrapper, colspanWrapper, 153 effectiveRowspanWrapper, effectiveColspanWrapper, 154 isSelectedWrapper); 155 is(cellElementWrapper.value, editor.firstChild.nextSibling.firstChild.firstChild.firstChild, 156 "getTableEditor().getCellDataAt(null, 0, 0) should return the <td> element when the <table> is selected"); 157 is(startRowIndexWrapper.value, 0, 158 "getTableEditor().getCellDataAt(null, 0, 0) should return 0 for startRowIndex when the <table> is selected"); 159 is(startColumnIndexWrapper.value, 0, 160 "getTableEditor().getCellDataAt(null, 0, 0) should return 0 for startColumnIndex when the <table> is selected"); 161 is(rowspanWrapper.value, 1, 162 "getTableEditor().getCellDataAt(null, 0, 0) should return 1 for rowspan when the <table> is selected"); 163 is(colspanWrapper.value, 1, 164 "getTableEditor().getCellDataAt(null, 0, 0) should return 1 for colspan when the <table> is selected"); 165 is(effectiveRowspanWrapper.value, 1, 166 "getTableEditor().getCellDataAt(null, 0, 0) should return 1 for effectiveRowspan when the <table> is selected"); 167 is(effectiveColspanWrapper.value, 1, 168 "getTableEditor().getCellDataAt(null, 0, 0) should return 1 for effectiveColspan when the <table> is selected"); 169 is(isSelectedWrapper.value, true, 170 "getTableEditor().getCellDataAt(null, 0, 0) should return true for isSelected when the <table> is selected"); 171 172 selection.removeAllRanges(); 173 editor.innerHTML = "<table>" + 174 "<tr><td>cell1-1</td><td>cell1-2</td></tr>" + 175 "<tr><td>cell2-1</td><td>cell2-2</td></tr>" + 176 "<tr><td>cell3-1</td><td>cell3-2</td></tr>" + 177 "</table>"; 178 editor.focus(); 179 reset(); 180 getTableEditor().getCellDataAt(editor.firstChild, 0, 0, 181 cellElementWrapper, 182 startRowIndexWrapper, startColumnIndexWrapper, 183 rowspanWrapper, colspanWrapper, 184 effectiveRowspanWrapper, effectiveColspanWrapper, 185 isSelectedWrapper); 186 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.firstChild, 187 "getTableEditor().getCellDataAt(<table>, 0, 0) should return the first <td> element"); 188 is(startRowIndexWrapper.value, 0, 189 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 0 for startRowIndex"); 190 is(startColumnIndexWrapper.value, 0, 191 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 0 for startColumnIndex"); 192 is(rowspanWrapper.value, 1, 193 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 1 for rowspan"); 194 is(colspanWrapper.value, 1, 195 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 1 for colspan"); 196 is(effectiveRowspanWrapper.value, 1, 197 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 1 for effectiveRowspan"); 198 is(effectiveColspanWrapper.value, 1, 199 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 1 for effectiveColspan"); 200 is(isSelectedWrapper.value, false, 201 "getTableEditor().getCellDataAt(<table>, 0, 0) should return false for isSelected"); 202 203 reset(); 204 getTableEditor().getCellDataAt(editor.firstChild, 0, 1, 205 cellElementWrapper, 206 startRowIndexWrapper, startColumnIndexWrapper, 207 rowspanWrapper, colspanWrapper, 208 effectiveRowspanWrapper, effectiveColspanWrapper, 209 isSelectedWrapper); 210 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.firstChild.nextSibling, 211 "getTableEditor().getCellDataAt(<table>, 0, 1) should return the second <td> element"); 212 is(startRowIndexWrapper.value, 0, 213 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 0 for startRowIndex"); 214 is(startColumnIndexWrapper.value, 1, 215 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 1 for startColumnIndex"); 216 is(rowspanWrapper.value, 1, 217 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 1 for rowspan"); 218 is(colspanWrapper.value, 1, 219 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 1 for colspan"); 220 is(effectiveRowspanWrapper.value, 1, 221 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 1 for effectiveRowspan"); 222 is(effectiveColspanWrapper.value, 1, 223 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 1 for effectiveColspan"); 224 is(isSelectedWrapper.value, false, 225 "getTableEditor().getCellDataAt(<table>, 0, 1) should return false for isSelected"); 226 227 try { 228 getTableEditor().getCellDataAt(editor.firstChild, 0, 2, 229 cellElementWrapper, 230 startRowIndexWrapper, startColumnIndexWrapper, 231 rowspanWrapper, colspanWrapper, 232 effectiveRowspanWrapper, effectiveColspanWrapper, 233 isSelectedWrapper); 234 ok(false, "getTableEditor().getCellDataAt(<table>, 0, 2) should throw exception since column index is out of bounds"); 235 } catch (e) { 236 ok(true, "getTableEditor().getCellDataAt(<table>, 0, 2) should throw exception since column index is out of bounds"); 237 } 238 239 reset(); 240 getTableEditor().getCellDataAt(editor.firstChild, 1, 0, 241 cellElementWrapper, 242 startRowIndexWrapper, startColumnIndexWrapper, 243 rowspanWrapper, colspanWrapper, 244 effectiveRowspanWrapper, effectiveColspanWrapper, 245 isSelectedWrapper); 246 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.nextSibling.firstChild, 247 "getTableEditor().getCellDataAt(<table>, 1, 0) should return the first <td> element in the second row"); 248 is(startRowIndexWrapper.value, 1, 249 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 1 for startRowIndex"); 250 is(startColumnIndexWrapper.value, 0, 251 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 0 for startColumnIndex"); 252 is(rowspanWrapper.value, 1, 253 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 1 for rowspan"); 254 is(colspanWrapper.value, 1, 255 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 1 for colspan"); 256 is(effectiveRowspanWrapper.value, 1, 257 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 1 for effectiveRowspan"); 258 is(effectiveColspanWrapper.value, 1, 259 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 1 for effectiveColspan"); 260 is(isSelectedWrapper.value, false, 261 "getTableEditor().getCellDataAt(<table>, 1, 0) should return false for isSelected"); 262 263 reset(); 264 getTableEditor().getCellDataAt(editor.firstChild, 2, 1, 265 cellElementWrapper, 266 startRowIndexWrapper, startColumnIndexWrapper, 267 rowspanWrapper, colspanWrapper, 268 effectiveRowspanWrapper, effectiveColspanWrapper, 269 isSelectedWrapper); 270 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.nextSibling.nextSibling.firstChild.nextSibling, 271 "getTableEditor().getCellDataAt(<table>, 2, 1) should return the second <td> element in the last row"); 272 is(startRowIndexWrapper.value, 2, 273 "getTableEditor().getCellDataAt(<table>, 2, 1) should return 1 for startRowIndex"); 274 is(startColumnIndexWrapper.value, 1, 275 "getTableEditor().getCellDataAt(<table>, 2, 1) should return 1 for startColumnIndex"); 276 is(rowspanWrapper.value, 1, 277 "getTableEditor().getCellDataAt(<table>, 2, 1) should return 1 for rowspan"); 278 is(colspanWrapper.value, 1, 279 "getTableEditor().getCellDataAt(<table>, 2, 1) should return 1 for colspan"); 280 is(effectiveRowspanWrapper.value, 1, 281 "getTableEditor().getCellDataAt(<table>, 2, 1) should return 1 for effectiveRowspan"); 282 is(effectiveColspanWrapper.value, 1, 283 "getTableEditor().getCellDataAt(<table>, 2, 1) should return 1 for effectiveColspan"); 284 is(isSelectedWrapper.value, false, 285 "getTableEditor().getCellDataAt(<table>, 2, 1) should return false for isSelected"); 286 287 try { 288 getTableEditor().getCellDataAt(editor.firstChild, 2, 2, 289 cellElementWrapper, 290 startRowIndexWrapper, startColumnIndexWrapper, 291 rowspanWrapper, colspanWrapper, 292 effectiveRowspanWrapper, effectiveColspanWrapper, 293 isSelectedWrapper); 294 ok(false, "getTableEditor().getCellDataAt(<table>, 2, 2) should throw exception since column index is out of bounds"); 295 } catch (e) { 296 ok(true, "getTableEditor().getCellDataAt(<table>, 2, 2) should throw exception since column index is out of bounds"); 297 } 298 299 try { 300 getTableEditor().getCellDataAt(editor.firstChild, 3, 0, 301 cellElementWrapper, 302 startRowIndexWrapper, startColumnIndexWrapper, 303 rowspanWrapper, colspanWrapper, 304 effectiveRowspanWrapper, effectiveColspanWrapper, 305 isSelectedWrapper); 306 ok(false, "getTableEditor().getCellDataAt(<table>, 3, 0) should throw exception since row index is out of bounds"); 307 } catch (e) { 308 ok(true, "getTableEditor().getCellDataAt(<table>, 3, 0) should throw exception since row index is out of bounds"); 309 } 310 311 selection.removeAllRanges(); 312 editor.innerHTML = "<table>" + 313 '<tr><td rowspan="3">cell1-1</td><td>cell1-2</td><td>cell1-3</td><td>cell1-4</td></tr>' + 314 "<tr><td>cell2-2</td></tr>" + 315 "<tr><td>cell3-2</td><td>cell3-3</td></tr>" + 316 '<tr><td colspan="3">cell4-1</td><td>cell4-4</td></tr>' + 317 "</table>"; 318 editor.focus(); 319 reset(); 320 getTableEditor().getCellDataAt(editor.firstChild, 0, 0, 321 cellElementWrapper, 322 startRowIndexWrapper, startColumnIndexWrapper, 323 rowspanWrapper, colspanWrapper, 324 effectiveRowspanWrapper, effectiveColspanWrapper, 325 isSelectedWrapper); 326 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.firstChild, 327 "getTableEditor().getCellDataAt(<table>, 0, 0) should return the first <td> element whose rowspan is 3"); 328 is(startRowIndexWrapper.value, 0, 329 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 0 for startRowIndex (the cell's rowspan is 3)"); 330 is(startColumnIndexWrapper.value, 0, 331 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 0 for startColumnIndex (the cell's rowspan is 3)"); 332 is(rowspanWrapper.value, 3, 333 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 3 for rowspan (the cell's rowspan is 3)"); 334 is(colspanWrapper.value, 1, 335 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 1 for colspan (the cell's rowspan is 3)"); 336 is(effectiveRowspanWrapper.value, 3, 337 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 3 for effectiveRowspan (the cell's rowspan is 3)"); 338 is(effectiveColspanWrapper.value, 1, 339 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 1 for effectiveColspan (the cell's rowspan is 3)"); 340 is(isSelectedWrapper.value, false, 341 "getTableEditor().getCellDataAt(<table>, 0, 0) should return false for isSelected (the cell's rowspan is 3)"); 342 343 reset(); 344 getTableEditor().getCellDataAt(editor.firstChild, 1, 0, 345 cellElementWrapper, 346 startRowIndexWrapper, startColumnIndexWrapper, 347 rowspanWrapper, colspanWrapper, 348 effectiveRowspanWrapper, effectiveColspanWrapper, 349 isSelectedWrapper); 350 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.firstChild, 351 "getTableEditor().getCellDataAt(<table>, 1, 0) should return the first <td> element whose rowspan is 3"); 352 is(startRowIndexWrapper.value, 0, 353 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 0 for startRowIndex (the cell's rowspan is 3)"); 354 is(startColumnIndexWrapper.value, 0, 355 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 0 for startColumnIndex (the cell's rowspan is 3)"); 356 is(rowspanWrapper.value, 3, 357 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 3 for rowspan (the cell's rowspan is 3)"); 358 is(colspanWrapper.value, 1, 359 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 1 for colspan (the cell's rowspan is 3)"); 360 is(effectiveRowspanWrapper.value, 2, 361 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 2 for effectiveRowspan (the cell's rowspan is 3)"); 362 is(effectiveColspanWrapper.value, 1, 363 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 1 for effectiveColspan (the cell's rowspan is 3)"); 364 is(isSelectedWrapper.value, false, 365 "getTableEditor().getCellDataAt(<table>, 1, 0) should return false for isSelected (the cell's rowspan is 3)"); 366 367 reset(); 368 getTableEditor().getCellDataAt(editor.firstChild, 2, 0, 369 cellElementWrapper, 370 startRowIndexWrapper, startColumnIndexWrapper, 371 rowspanWrapper, colspanWrapper, 372 effectiveRowspanWrapper, effectiveColspanWrapper, 373 isSelectedWrapper); 374 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.firstChild, 375 "getTableEditor().getCellDataAt(<table>, 2, 0) should return the first <td> element whose rowspan is 3"); 376 is(startRowIndexWrapper.value, 0, 377 "getTableEditor().getCellDataAt(<table>, 2, 0) should return 0 for startRowIndex (the cell's rowspan is 3)"); 378 is(startColumnIndexWrapper.value, 0, 379 "getTableEditor().getCellDataAt(<table>, 2, 0) should return 0 for startColumnIndex (the cell's rowspan is 3)"); 380 is(rowspanWrapper.value, 3, 381 "getTableEditor().getCellDataAt(<table>, 2, 0) should return 3 for rowspan (the cell's rowspan is 3)"); 382 is(colspanWrapper.value, 1, 383 "getTableEditor().getCellDataAt(<table>, 2, 0) should return 1 for colspan (the cell's rowspan is 3)"); 384 is(effectiveRowspanWrapper.value, 1, 385 "getTableEditor().getCellDataAt(<table>, 2, 0) should return 1 for effectiveRowspan (the cell's rowspan is 3)"); 386 is(effectiveColspanWrapper.value, 1, 387 "getTableEditor().getCellDataAt(<table>, 2, 0) should return 1 for effectiveColspan (the cell's rowspan is 3)"); 388 is(isSelectedWrapper.value, false, 389 "getTableEditor().getCellDataAt(<table>, 2, 0) should return false for isSelected (the cell's rowspan is 3)"); 390 391 reset(); 392 getTableEditor().getCellDataAt(editor.firstChild, 3, 0, 393 cellElementWrapper, 394 startRowIndexWrapper, startColumnIndexWrapper, 395 rowspanWrapper, colspanWrapper, 396 effectiveRowspanWrapper, effectiveColspanWrapper, 397 isSelectedWrapper); 398 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.nextSibling.nextSibling.nextSibling.firstChild, 399 "getTableEditor().getCellDataAt(<table>, 3, 0) should return the first <td> element in the last row whose colspan is 3"); 400 is(startRowIndexWrapper.value, 3, 401 "getTableEditor().getCellDataAt(<table>, 3, 0) should return 3 for startRowIndex (the cell's colspan is 3)"); 402 is(startColumnIndexWrapper.value, 0, 403 "getTableEditor().getCellDataAt(<table>, 3, 0) should return 0 for startColumnIndex (the cell's colspan is 3)"); 404 is(rowspanWrapper.value, 1, 405 "getTableEditor().getCellDataAt(<table>, 3, 0) should return 1 for rowspan (the cell's colspan is 3)"); 406 is(colspanWrapper.value, 3, 407 "getTableEditor().getCellDataAt(<table>, 3, 0) should return 3 for colspan (the cell's colspan is 3)"); 408 is(effectiveRowspanWrapper.value, 1, 409 "getTableEditor().getCellDataAt(<table>, 3, 0) should return 1 for effectiveRowspan (the cell's colspan is 3)"); 410 is(effectiveColspanWrapper.value, 3, 411 "getTableEditor().getCellDataAt(<table>, 3, 0) should return 3 for effectiveColspan (the cell's colspan is 3)"); 412 is(isSelectedWrapper.value, false, 413 "getTableEditor().getCellDataAt(<table>, 3, 0) should return false for isSelected (the cell's colspan is 3)"); 414 415 reset(); 416 getTableEditor().getCellDataAt(editor.firstChild, 3, 1, 417 cellElementWrapper, 418 startRowIndexWrapper, startColumnIndexWrapper, 419 rowspanWrapper, colspanWrapper, 420 effectiveRowspanWrapper, effectiveColspanWrapper, 421 isSelectedWrapper); 422 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.nextSibling.nextSibling.nextSibling.firstChild, 423 "getTableEditor().getCellDataAt(<table>, 3, 1) should return the first <td> element in the last row whose colspan is 3"); 424 is(startRowIndexWrapper.value, 3, 425 "getTableEditor().getCellDataAt(<table>, 3, 1) should return 3 for startRowIndex (the cell's colspan is 3)"); 426 is(startColumnIndexWrapper.value, 0, 427 "getTableEditor().getCellDataAt(<table>, 3, 1) should return 0 for startColumnIndex (the cell's colspan is 3)"); 428 is(rowspanWrapper.value, 1, 429 "getTableEditor().getCellDataAt(<table>, 3, 1) should return 1 for rowspan (the cell's colspan is 3)"); 430 is(colspanWrapper.value, 3, 431 "getTableEditor().getCellDataAt(<table>, 3, 1) should return 3 for colspan (the cell's colspan is 3)"); 432 is(effectiveRowspanWrapper.value, 1, 433 "getTableEditor().getCellDataAt(<table>, 3, 1) should return 1 for effectiveRowspan (the cell's colspan is 3)"); 434 is(effectiveColspanWrapper.value, 2, 435 "getTableEditor().getCellDataAt(<table>, 3, 1) should return 2 for effectiveColspan (the cell's colspan is 3)"); 436 is(isSelectedWrapper.value, false, 437 "getTableEditor().getCellDataAt(<table>, 3, 1) should return false for isSelected (the cell's colspan is 3)"); 438 439 reset(); 440 getTableEditor().getCellDataAt(editor.firstChild, 3, 2, 441 cellElementWrapper, 442 startRowIndexWrapper, startColumnIndexWrapper, 443 rowspanWrapper, colspanWrapper, 444 effectiveRowspanWrapper, effectiveColspanWrapper, 445 isSelectedWrapper); 446 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.nextSibling.nextSibling.nextSibling.firstChild, 447 "getTableEditor().getCellDataAt(<table>, 3, 2) should return the first <td> element in the last row whose colspan is 3"); 448 is(startRowIndexWrapper.value, 3, 449 "getTableEditor().getCellDataAt(<table>, 3, 2) should return 3 for startRowIndex (the cell's colspan is 3)"); 450 is(startColumnIndexWrapper.value, 0, 451 "getTableEditor().getCellDataAt(<table>, 3, 2) should return 0 for startColumnIndex (the cell's colspan is 3)"); 452 is(rowspanWrapper.value, 1, 453 "getTableEditor().getCellDataAt(<table>, 3, 2) should return 1 for rowspan (the cell's colspan is 3)"); 454 is(colspanWrapper.value, 3, 455 "getTableEditor().getCellDataAt(<table>, 3, 2) should return 3 for colspan (the cell's colspan is 3)"); 456 is(effectiveRowspanWrapper.value, 1, 457 "getTableEditor().getCellDataAt(<table>, 3, 2) should return 1 for effectiveRowspan (the cell's colspan is 3)"); 458 is(effectiveColspanWrapper.value, 1, 459 "getTableEditor().getCellDataAt(<table>, 3, 2) should return 1 for effectiveColspan (the cell's colspan is 3)"); 460 is(isSelectedWrapper.value, false, 461 "getTableEditor().getCellDataAt(<table>, 3, 2) should return false for isSelected (the cell's colspan is 3)"); 462 463 reset(); 464 getTableEditor().getCellDataAt(editor.firstChild, 3, 3, 465 cellElementWrapper, 466 startRowIndexWrapper, startColumnIndexWrapper, 467 rowspanWrapper, colspanWrapper, 468 effectiveRowspanWrapper, effectiveColspanWrapper, 469 isSelectedWrapper); 470 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.nextSibling.nextSibling.nextSibling.firstChild.nextSibling, 471 "getTableEditor().getCellDataAt(<table>, 3, 3) should return the second <td> element in the last row"); 472 is(startRowIndexWrapper.value, 3, 473 "getTableEditor().getCellDataAt(<table>, 3, 3) should return 3 for startRowIndex (right cell of the cell whose colspan is 3)"); 474 is(startColumnIndexWrapper.value, 3, 475 "getTableEditor().getCellDataAt(<table>, 3, 3) should return 3 for startColumnIndex (right cell of the cell whose colspan is 3)"); 476 is(rowspanWrapper.value, 1, 477 "getTableEditor().getCellDataAt(<table>, 3, 3) should return 1 for rowspan (right cell of the cell whose colspan is 3)"); 478 is(colspanWrapper.value, 1, 479 "getTableEditor().getCellDataAt(<table>, 3, 3) should return 1 for colspan (right cell of the cell whose colspan is 3)"); 480 is(effectiveRowspanWrapper.value, 1, 481 "getTableEditor().getCellDataAt(<table>, 3, 3) should return 1 for effectiveRowspan (right cell of the cell whose colspan is 3)"); 482 is(effectiveColspanWrapper.value, 1, 483 "getTableEditor().getCellDataAt(<table>, 3, 3) should return 1 for effectiveColspan (right cell of the cell whose colspan is 3)"); 484 is(isSelectedWrapper.value, false, 485 "getTableEditor().getCellDataAt(<table>, 3, 3) should return false for isSelected (right cell of the cell whose colspan is 3)"); 486 487 try { 488 getTableEditor().getCellDataAt(editor.firstChild, 3, 4, 489 cellElementWrapper, 490 startRowIndexWrapper, startColumnIndexWrapper, 491 rowspanWrapper, colspanWrapper, 492 effectiveRowspanWrapper, effectiveColspanWrapper, 493 isSelectedWrapper); 494 ok(false, "getTableEditor().getCellDataAt(<table>, 3, 4) should throw exception since column index is out of bounds"); 495 } catch (e) { 496 ok(true, "getTableEditor().getCellDataAt(<table>, 3, 4) should throw exception since column index is out of bounds"); 497 } 498 499 reset(); 500 getTableEditor().getCellDataAt(editor.firstChild, 0, 1, 501 cellElementWrapper, 502 startRowIndexWrapper, startColumnIndexWrapper, 503 rowspanWrapper, colspanWrapper, 504 effectiveRowspanWrapper, effectiveColspanWrapper, 505 isSelectedWrapper); 506 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.firstChild.nextSibling, 507 "getTableEditor().getCellDataAt(<table>, 0, 1) should return the second <td> element in the first row"); 508 is(startRowIndexWrapper.value, 0, 509 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 0 for startRowIndex (right cell of the cell whose rowspan is 3)"); 510 is(startColumnIndexWrapper.value, 1, 511 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 1 for startColumnIndex (right cell of the cell whose rowspan is 3)"); 512 is(rowspanWrapper.value, 1, 513 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 1 for rowspan (right cell of the cell whose rowspan is 3)"); 514 is(colspanWrapper.value, 1, 515 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 1 for colspan (right cell of the cell whose rowspan is 3)"); 516 is(effectiveRowspanWrapper.value, 1, 517 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 1 for effectiveRowspan (right cell of the cell whose rowspan is 3)"); 518 is(effectiveColspanWrapper.value, 1, 519 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 1 for effectiveColspan (right cell of the cell whose rowspan is 3)"); 520 is(isSelectedWrapper.value, false, 521 "getTableEditor().getCellDataAt(<table>, 0, 1) should return false for isSelected (right cell of the cell whose rowspan is 3)"); 522 523 reset(); 524 getTableEditor().getCellDataAt(editor.firstChild, 1, 1, 525 cellElementWrapper, 526 startRowIndexWrapper, startColumnIndexWrapper, 527 rowspanWrapper, colspanWrapper, 528 effectiveRowspanWrapper, effectiveColspanWrapper, 529 isSelectedWrapper); 530 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.nextSibling.firstChild, 531 "getTableEditor().getCellDataAt(<table>, 1, 1) should return the first <td> element in the second row"); 532 is(startRowIndexWrapper.value, 1, 533 "getTableEditor().getCellDataAt(<table>, 1, 1) should return 1 for startRowIndex (right cell of the cell whose rowspan is 3)"); 534 is(startColumnIndexWrapper.value, 1, 535 "getTableEditor().getCellDataAt(<table>, 1, 1) should return 1 for startColumnIndex (right cell of the cell whose rowspan is 3)"); 536 is(rowspanWrapper.value, 1, 537 "getTableEditor().getCellDataAt(<table>, 1, 1) should return 1 for rowspan (right cell of the cell whose rowspan is 3)"); 538 is(colspanWrapper.value, 1, 539 "getTableEditor().getCellDataAt(<table>, 1, 1) should return 1 for colspan (right cell of the cell whose rowspan is 3)"); 540 is(effectiveRowspanWrapper.value, 1, 541 "getTableEditor().getCellDataAt(<table>, 1, 1) should return 1 for effectiveRowspan (right cell of the cell whose rowspan is 3)"); 542 is(effectiveColspanWrapper.value, 1, 543 "getTableEditor().getCellDataAt(<table>, 1, 1) should return 1 for effectiveColspan (right cell of the cell whose rowspan is 3)"); 544 is(isSelectedWrapper.value, false, 545 "getTableEditor().getCellDataAt(<table>, 1, 1) should return false for isSelected (right cell of the cell whose rowspan is 3)"); 546 547 try { 548 getTableEditor().getCellDataAt(editor.firstChild, 1, 2, 549 cellElementWrapper, 550 startRowIndexWrapper, startColumnIndexWrapper, 551 rowspanWrapper, colspanWrapper, 552 effectiveRowspanWrapper, effectiveColspanWrapper, 553 isSelectedWrapper); 554 ok(false, "getTableEditor().getCellDataAt(<table>, 1, 2) should throw exception since there is no cell due to non-rectangular table"); 555 } catch (e) { 556 ok(true, "getTableEditor().getCellDataAt(<table>, 1, 2) should throw exception since there is no cell due to non-rectangular table"); 557 } 558 559 selection.removeAllRanges(); 560 editor.innerHTML = "<table>" + 561 '<tr><td rowspan="3" colspan="2">cell1-1</td></tr>' + 562 "</table>"; 563 editor.focus(); 564 reset(); 565 getTableEditor().getCellDataAt(editor.firstChild, 0, 0, 566 cellElementWrapper, 567 startRowIndexWrapper, startColumnIndexWrapper, 568 rowspanWrapper, colspanWrapper, 569 effectiveRowspanWrapper, effectiveColspanWrapper, 570 isSelectedWrapper); 571 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.firstChild, 572 "getTableEditor().getCellDataAt(<table>, 0, 0) should return the first <td> element whose rowspan is 3 and colspan is 2"); 573 is(startRowIndexWrapper.value, 0, 574 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 0 for startRowIndex (the cell's rowspan is 3 and colspan is 2)"); 575 is(startColumnIndexWrapper.value, 0, 576 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 0 for startColumnIndex (the cell's rowspan is 3 and colspan is 2)"); 577 is(rowspanWrapper.value, 3, 578 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 3 for rowspan (the cell's rowspan is 3 and colspan is 2)"); 579 is(colspanWrapper.value, 2, 580 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 2 for colspan (the cell's rowspan is 3 and colspan is 2)"); 581 // XXX Not sure whether expected behavior or not. 582 todo_is(effectiveRowspanWrapper.value, 3, 583 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 3 for effectiveRowspan (the cell's rowspan is 3 and colspan is 2)"); 584 is(effectiveColspanWrapper.value, 2, 585 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 2 for effectiveColspan (the cell's rowspan is 3 and colspan is 2)"); 586 is(isSelectedWrapper.value, false, 587 "getTableEditor().getCellDataAt(<table>, 0, 0) should return false for isSelected (the cell's rowspan is 3 and colspan is 2)"); 588 589 reset(); 590 getTableEditor().getCellDataAt(editor.firstChild, 0, 1, 591 cellElementWrapper, 592 startRowIndexWrapper, startColumnIndexWrapper, 593 rowspanWrapper, colspanWrapper, 594 effectiveRowspanWrapper, effectiveColspanWrapper, 595 isSelectedWrapper); 596 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.firstChild, 597 "getTableEditor().getCellDataAt(<table>, 0, 1) should return the first <td> element whose rowspan is 3 and colspan is 2"); 598 is(startRowIndexWrapper.value, 0, 599 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 0 for startRowIndex (the cell's rowspan is 3 and colspan is 2)"); 600 is(startColumnIndexWrapper.value, 0, 601 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 0 for startColumnIndex (the cell's rowspan is 3 and colspan is 2)"); 602 is(rowspanWrapper.value, 3, 603 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 3 for rowspan (the cell's rowspan is 3 and colspan is 2)"); 604 is(colspanWrapper.value, 2, 605 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 2 for colspan (the cell's rowspan is 3 and colspan is 2)"); 606 // XXX Not sure whether expected behavior or not. 607 todo_is(effectiveRowspanWrapper.value, 3, 608 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 3 for effectiveRowspan (the cell's rowspan is 3 and colspan is 2)"); 609 is(effectiveColspanWrapper.value, 1, 610 "getTableEditor().getCellDataAt(<table>, 0, 1) should return 1 for effectiveColspan (the cell's rowspan is 3 and colspan is 2)"); 611 is(isSelectedWrapper.value, false, 612 "getTableEditor().getCellDataAt(<table>, 0, 1) should return false for isSelected (the cell's rowspan is 3 and colspan is 2)"); 613 614 try { 615 getTableEditor().getCellDataAt(editor.firstChild, 1, 0, 616 cellElementWrapper, 617 startRowIndexWrapper, startColumnIndexWrapper, 618 rowspanWrapper, colspanWrapper, 619 effectiveRowspanWrapper, effectiveColspanWrapper, 620 isSelectedWrapper); 621 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.firstChild, 622 "getTableEditor().getCellDataAt(<table>, 1, 0) should return the first <td> element whose rowspan is 3 and colspan is 2"); 623 is(startRowIndexWrapper.value, 0, 624 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 0 for startRowIndex (the cell's rowspan is 3 and colspan is 2)"); 625 is(startColumnIndexWrapper.value, 0, 626 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 0 for startColumnIndex (the cell's rowspan is 3 and colspan is 2)"); 627 is(rowspanWrapper.value, 3, 628 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 3 for rowspan (the cell's rowspan is 3 and colspan is 2)"); 629 is(colspanWrapper.value, 2, 630 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 2 for colspan (the cell's rowspan is 3 and colspan is 2)"); 631 // XXX Not sure whether expected behavior or not. 632 todo_is(effectiveRowspanWrapper.value, 2, 633 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 2 for effectiveRowspan (the cell's rowspan is 3 and colspan is 2)"); 634 is(effectiveColspanWrapper.value, 1, 635 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 1 for effectiveColspan (the cell's rowspan is 3 and colspan is 2)"); 636 is(isSelectedWrapper.value, false, 637 "getTableEditor().getCellDataAt(<table>, 1, 0) should return false for isSelected (the cell's rowspan is 3 and colspan is 2)"); 638 } catch (e) { 639 todo(false, "getTableEditor().getCellDataAt(<table>, 1, 0) shouldn't throw exception since rowspan expands the table"); 640 } 641 642 selection.removeAllRanges(); 643 editor.innerHTML = "<table>" + 644 '<tr><td rowspan="0">cell1-1</td><td>cell1-2</td></tr>' + 645 "<tr><td>cell2-2</td></tr>" + 646 "<tr><td>cell3-2</td></tr>" + 647 "</table>"; 648 editor.focus(); 649 reset(); 650 getTableEditor().getCellDataAt(editor.firstChild, 0, 0, 651 cellElementWrapper, 652 startRowIndexWrapper, startColumnIndexWrapper, 653 rowspanWrapper, colspanWrapper, 654 effectiveRowspanWrapper, effectiveColspanWrapper, 655 isSelectedWrapper); 656 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.firstChild, 657 "getTableEditor().getCellDataAt(<table>, 0, 0) should return the first <td> element whose rowspan is 0"); 658 is(startRowIndexWrapper.value, 0, 659 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 0 for startRowIndex (the cell's rowspan is 0)"); 660 is(startColumnIndexWrapper.value, 0, 661 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 0 for startColumnIndex (the cell's rowspan is 0)"); 662 is(rowspanWrapper.value, 0, 663 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 0 for rowspan (the cell's rowspan is 0)"); 664 is(colspanWrapper.value, 1, 665 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 1 for colspan (the cell's rowspan is 0)"); 666 is(effectiveRowspanWrapper.value, 3, 667 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 3 for effectiveRowspan (the cell's rowspan is 0)"); 668 is(effectiveColspanWrapper.value, 1, 669 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 1 for effectiveColspan (the cell's rowspan is 0)"); 670 is(isSelectedWrapper.value, false, 671 "getTableEditor().getCellDataAt(<table>, 0, 0) should return false for isSelected (the cell's rowspan is 0)"); 672 673 reset(); 674 getTableEditor().getCellDataAt(editor.firstChild, 1, 0, 675 cellElementWrapper, 676 startRowIndexWrapper, startColumnIndexWrapper, 677 rowspanWrapper, colspanWrapper, 678 effectiveRowspanWrapper, effectiveColspanWrapper, 679 isSelectedWrapper); 680 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.firstChild, 681 "getTableEditor().getCellDataAt(<table>, 1, 0) should return the first <td> element whose rowspan is 0"); 682 is(startRowIndexWrapper.value, 0, 683 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 0 for startRowIndex (the cell's rowspan is 0)"); 684 is(startColumnIndexWrapper.value, 0, 685 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 0 for startColumnIndex (the cell's rowspan is 0)"); 686 is(rowspanWrapper.value, 0, 687 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 0 for rowspan (the cell's rowspan is 0)"); 688 is(colspanWrapper.value, 1, 689 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 1 for colspan (the cell's rowspan is 0)"); 690 is(effectiveRowspanWrapper.value, 2, 691 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 3 for effectiveRowspan (the cell's rowspan is 0)"); 692 is(effectiveColspanWrapper.value, 1, 693 "getTableEditor().getCellDataAt(<table>, 1, 0) should return 1 for effectiveColspan (the cell's rowspan is 0)"); 694 is(isSelectedWrapper.value, false, 695 "getTableEditor().getCellDataAt(<table>, 1, 0) should return false for isSelected (the cell's rowspan is 0)"); 696 697 // FYI: colspan must be 1 - 1000, 0 is invalid. 698 selection.removeAllRanges(); 699 editor.innerHTML = "<table>" + 700 '<tr><td colspan="0">cell1-1</td></tr>' + 701 "<tr><td>cell2-1</td><td>cell2-2</td><td>cell2-3</td></tr>" + 702 "</table>"; 703 editor.focus(); 704 reset(); 705 getTableEditor().getCellDataAt(editor.firstChild, 0, 0, 706 cellElementWrapper, 707 startRowIndexWrapper, startColumnIndexWrapper, 708 rowspanWrapper, colspanWrapper, 709 effectiveRowspanWrapper, effectiveColspanWrapper, 710 isSelectedWrapper); 711 is(cellElementWrapper.value, editor.firstChild.firstChild.firstChild.firstChild, 712 "getTableEditor().getCellDataAt(<table>, 0, 0) should return the first <td> element whose colspan is 0"); 713 is(startRowIndexWrapper.value, 0, 714 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 0 for startRowIndex (the cell's colspan is 0)"); 715 is(startColumnIndexWrapper.value, 0, 716 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 0 for startColumnIndex (the cell's colspan is 0)"); 717 is(rowspanWrapper.value, 1, 718 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 1 for rowspan (the cell's colspan is 0)"); 719 is(colspanWrapper.value, 1, 720 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 1 for colspan (the cell's colspan is 0)"); 721 is(effectiveRowspanWrapper.value, 1, 722 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 3 for effectiveRowspan (the cell's colspan is 0)"); 723 is(effectiveColspanWrapper.value, 1, 724 "getTableEditor().getCellDataAt(<table>, 0, 0) should return 1 for effectiveColspan (the cell's colspan is 0)"); 725 is(isSelectedWrapper.value, false, 726 "getTableEditor().getCellDataAt(<table>, 0, 0) should return false for isSelected (the cell's colspan is 0)"); 727 728 try { 729 getTableEditor().getCellDataAt(editor.firstChild, 0, 1, 730 cellElementWrapper, 731 startRowIndexWrapper, startColumnIndexWrapper, 732 rowspanWrapper, colspanWrapper, 733 effectiveRowspanWrapper, effectiveColspanWrapper, 734 isSelectedWrapper); 735 ok(false, "getTableEditor().getCellDataAt(<table>, 0, 1) should throw exception since there is no cell due to right side of a cell whose colspan is 0"); 736 } catch (e) { 737 ok(true, "getTableEditor().getCellDataAt(<table>, 0, 1) should throw exception since there is no cell due to right side of a cell whose colspan is 0"); 738 } 739 740 SimpleTest.finish(); 741 }); 742 743 function getTableEditor() { 744 var editingSession = SpecialPowers.wrap(window).docShell.editingSession; 745 return editingSession.getEditorForWindow(window).QueryInterface(SpecialPowers.Ci.nsITableEditor); 746 } 747 748 </script> 749 </body> 750 751 </html>