1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500
|
<!DOCTYPE HTML>
<title>Reftests with caret drawing</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script src="/tests/SimpleTest/WindowSnapshot.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css" />
<style>
iframe {
border: none;
width: 600px;
height: 400px;
}
</style>
<script>
SimpleTest.waitForExplicitFinish();
SimpleTest.requestLongerTimeout(3);
const { AppConstants } = SpecialPowers.ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
var iframes = [];
function callbackTestIframe(iframe)
{
iframes.push(iframe);
if (iframes.length != 2)
return;
var result = iframes[0];
var reference = iframes[1];
const shouldBeEqual = true;
// Using assertSnapshots is important to get the data-URIs of failing tests
// dumped into the log in a format that reftest-analyzer.xhtml can process.
var passed = assertSnapshots(result.snapshot, reference.snapshot,
shouldBeEqual, null /*no fuzz*/, result.src,
reference.src);
// Remove the iframes if the test was successful
if (passed) {
result.remove();
reference.remove();
}
iframes = [];
SimpleTest.waitForFocus(nextTest);
}
function doSnapShot(iframe) {
iframe.snapshot = snapshotWindow(iframe.contentWindow, true);
callbackTestIframe(iframe);
};
function remotePageLoaded(callback) {
var iframe = this;
setTimeout(function(){
doSnapShot(iframe);
callback();
}, 0);
};
const MAX_ITERATIONS = 1000;
function createIframe(url,next) {
var iframe = document.createElement("iframe");
iframe.remotePageLoaded = remotePageLoaded;
var me = this;
var currentIteration = 0;
function iframeLoadCompleted() {
let loc = iframe.contentWindow.location;
if (loc && loc.href == "about:blank") {
return;
}
var docEl = iframe.contentDocument.documentElement;
if (docEl.className.includes("reftest-wait")) {
if (currentIteration++ > MAX_ITERATIONS) {
ok(false, "iframe load for " + url + " timed out");
endTest();
} else {
setTimeout(iframeLoadCompleted, 0);
}
return;
}
iframe.remotePageLoaded(function() {
if (next) {
setTimeout(function(){createIframe(next,null);}, 0)
}
});
}
iframe.addEventListener("load", iframeLoadCompleted);
window.document.body.appendChild(iframe);
iframe.clientHeight; // flush layout.
iframe.src = url;
iframe.focus();
};
function refTest(test, ref) {
createIframe(test, ref);
};
var caretBlinkTime = null;
async function endTest() {
await SpecialPowers.spawn(window.parent, [], () => {
content.document.styleSheets[content.document.styleSheets.length-1].deleteRule(0);
});
// finish(), yet let the test actually end first, to be safe.
SimpleTest.executeSoon(SimpleTest.finish);
}
var tests = [
[ 'bug106855-1.html' , 'bug106855-1-ref.html' ] ,
[ 'bug106855-2.html' , 'bug106855-1-ref.html' ] ,
[ 'bug389321-2.html' , 'bug389321-2-ref.html' ] ,
[ 'bug613807-1.html' , 'bug613807-1-ref.html' ] ,
[ 'bug1082486-1.html', 'bug1082486-1-ref.html'] ,
[ 'bug1082486-2.html', 'bug1082486-2-ref.html'] ,
[ 'bug1893673.html' , 'bug1893673-ref.html' ] ,
[ 'bug1896051.html', 'bug1896051-ref.html'],
// The following test cases uses mouse events. We need to make
// AccessibleCaret unhide for them.
function() {SpecialPowers.pushPrefEnv({'set': [['layout.accessiblecaret.hide_carets_for_mouse_input', false]]}, nextTest);} ,
[ 'bug1516963-1.html', 'bug1516963-1-ref.html'] ,
[ 'bug1516963-2.html', 'bug1516963-2-ref.html'] ,
[ 'bug1516963-3.html', 'bug1516963-3-ref.html'] ,
[ 'bug1516963-4.html', 'bug1516963-4-ref.html'] ,
[ 'bug1516963-5.html', 'bug1516963-5-ref.html'] ,
[ 'bug1516963-6.html', 'bug1516963-6-ref.html'] ,
[ 'bug1550869-1a.html', 'bug1550869-1-ref.html'] ,
[ 'bug1550869-1b.html', 'bug1550869-1-ref.html'] ,
[ 'bug1550869-2a.html', 'bug1550869-2-ref.html'] ,
[ 'bug1550869-2b.html', 'bug1550869-2-ref.html'] ,
[ 'bug1550869-2c.html', 'bug1550869-2-ref.html'] ,
[ 'bug1550869-2d.html', 'bug1550869-2-ref.html'] ,
function() {SpecialPowers.pushPrefEnv({'clear': [['layout.accessiblecaret.hide_carets_for_mouse_input']]}, nextTest);} ,
// The following test cases are all involving with one sending
// synthesizeKey(), the other without. They fail when accessiblecaret
// is enabled. Test them with the preference off.
function() {SpecialPowers.pushPrefEnv({'set': [['layout.accessiblecaret.enabled_on_touch', false]]}, nextTest);} ,
[ 'bug240933-1.html' , 'bug240933-1-ref.html' ] ,
[ 'bug240933-2.html' , 'bug240933-1-ref.html' ] ,
[ 'bug389321-1.html' , 'bug389321-1-ref.html' ] ,
[ 'bug389321-3.html' , 'bug389321-3-ref.html' ] ,
[ 'bug482484.html' , 'bug482484-ref.html' ] ,
[ 'bug503399.html' , 'bug503399-ref.html' ] ,
[ 'bug585922.html' , 'bug585922-ref.html' ] ,
[ 'bug597519-1.html' , 'bug597519-1-ref.html' ] ,
[ 'bug602141-1.html' , 'bug602141-1-ref.html' ] ,
[ 'bug602141-2.html' , 'bug602141-2-ref.html' ] ,
[ 'bug602141-3.html' , 'bug602141-3-ref.html' ] ,
[ 'bug602141-4.html' , 'bug602141-4-ref.html' ] ,
[ 'bug612271-1.html' , 'bug612271-ref.html' ] ,
[ 'bug612271-2.html' , 'bug612271-ref.html' ] ,
[ 'bug612271-3.html' , 'bug612271-ref.html' ] ,
[ 'bug613433-1.html' , 'bug613433-ref.html' ] ,
[ 'bug613433-2.html' , 'bug613433-ref.html' ] ,
[ 'bug613433-3.html' , 'bug613433-ref.html' ] ,
[ 'bug632215-1.html' , 'bug632215-ref.html' ] ,
[ 'bug632215-2.html' , 'bug632215-ref.html' ] ,
[ 'bug633044-1.html' , 'bug633044-1-ref.html' ] ,
[ 'bug634406-1.html' , 'bug634406-1-ref.html' ] ,
[ 'bug644428-1.html' , 'bug644428-1-ref.html' ] ,
[ 'input-maxlength-valid-before-change.html', 'input-valid-ref.html'] ,
[ 'input-maxlength-valid-change.html', 'input-valid-ref.html'] ,
[ 'input-maxlength-invalid-change.html', 'input-invalid-ref.html'] ,
[ 'input-minlength-valid-before-change.html', 'input-valid-ref.html'] ,
[ 'input-minlength-valid-change.html', 'input-valid-ref.html'] ,
[ 'input-minlength-invalid-change.html', 'input-invalid-ref.html'] ,
[ 'input-maxlength-ui-valid-change.html', 'input-valid-ref.html'] ,
[ 'input-maxlength-ui-invalid-change.html', 'input-invalid-ref.html'] ,
[ 'input-minlength-ui-valid-change.html', 'input-valid-ref.html'] ,
[ 'input-minlength-ui-invalid-change.html', 'input-invalid-ref.html'] ,
function() {SpecialPowers.pushPrefEnv({'set': [['layout.forms.reveal-password-button.enabled', false]]}, nextTest);} ,
[ 'input-password-remask.html', 'input-password-remask-ref.html' ],
// The following hash means language.
function() {SpecialPowers.pushPrefEnv({'set': [['editor.password.mask_delay', 0]]}, nextTest);} ,
[ 'input-password-RTL-input.html#arabic', 'input-password-RTL-input-ref.html'],
[ 'input-password-RTL-input.html#hebrew', 'input-password-RTL-input-ref.html'],
function() {SpecialPowers.pushPrefEnv({'clear': [['editor.password.mask_delay']]}, nextTest);} ,
// The following hash means "text ('_' is a space)" - unmarsk start - unmask end - selection start - selection end[ - text-transform].
[ 'input-password-unmask.html#abc_def-0-7-7-7', 'input-password-unmask-ref.html#abc_def-0-7-7-7'],
[ 'input-password-unmask.html#abc_def-0-7-7-7-capitalize', 'input-password-unmask-ref.html#Abc_Def-0-7-7-7'],
[ 'input-password-unmask.html#abc_def-0-7-7-7-uppercase', 'input-password-unmask-ref.html#ABC_DEF-0-7-7-7'],
[ 'input-password-unmask.html#ABC_DEF-0-7-7-7-lowercase', 'input-password-unmask-ref.html#abc_def-0-7-7-7'],
[ 'input-password-unmask.html#abc_def-0-1-1-1', 'input-password-unmask-ref.html#abc_def-0-1-1-1'],
[ 'input-password-unmask.html#abc_def-2-4-1-5', 'input-password-unmask-ref.html#abc_def-2-4-1-5'],
[ 'input-password-unmask.html#abc_def-6-7-7-7', 'input-password-unmask-ref.html#abc_def-6-7-7-7'],
// The following hash means unmarsk start - unmask end - selection start - selection end.
// The value is "a🤔b" so that the range is 0-4.
[ 'input-password-unmask-around-emoji.html#0-4-4-4', 'input-password-unmask-around-emoji-ref.html#0-4-4-4'],
[ 'input-password-unmask-around-emoji.html#0-3-3-3', 'input-password-unmask-around-emoji-ref.html#0-3-3-3'],
[ 'input-password-unmask-around-emoji.html#0-1-3-3', 'input-password-unmask-around-emoji-ref.html#0-1-3-3'],
[ 'input-password-unmask-around-emoji.html#1-2-3-3', 'input-password-unmask-around-emoji-ref.html#1-2-3-3'],
[ 'input-password-unmask-around-emoji.html#1-3-3-3', 'input-password-unmask-around-emoji-ref.html#1-3-3-3'],
[ 'input-password-unmask-around-emoji.html#2-3-3-3', 'input-password-unmask-around-emoji-ref.html#2-3-3-3'],
[ 'input-password-unmask-around-emoji.html#3-4-4-4', 'input-password-unmask-around-emoji-ref.html#3-4-4-4'],
[ 'input-password-unmask-around-emoji.html#1-4-4-4', 'input-password-unmask-around-emoji-ref.html#1-4-4-4'],
function() {SpecialPowers.pushPrefEnv({'clear': [['layout.forms.reveal-password-button.enabled']]}, nextTest);} ,
// The following tests something in editable elements so that we need to disable zoom to focused editor.
function() {SpecialPowers.pushPrefEnv({'set': [['apz.zoom-to-focused-input.enabled', false]]}, nextTest);} ,
[ 'bug956530-1.html' , 'bug956530-1-ref.html' ] , // Clicks an <input> element
[ 'bug1097242-1.html', 'bug1097242-1-ref.html'] , // Clicks non-editable and non-selectable element in an editing host
[ 'bug1423331-1.html' , 'bug1423331-1-ref.html' ] , // Clicks in an editing host
[ 'bug1423331-2.html' , 'bug1423331-2-ref.html' ] , // Clicks in an editing host
[ 'bug1506547-4.html' , 'bug1506547-4-ref.html' ] , // Clicks in an editing host
[ 'bug1506547-5.html' , 'bug1506547-5-ref.html' ] , // Clicks in an editing host
[ 'bug1506547-6.html' , 'bug1506547-5-ref.html' ] , // Clicks in an editing host (reference)
[ 'bug1518339-1.html' , 'bug1518339-1-ref.html' ] , // Clicks in an editing host
[ 'bug1518339-2.html' , 'bug1518339-2-ref.html' ] , // Clicks in an editing host
function() {SpecialPowers.pushPrefEnv({'clear': [['apz.zoom-to-focused-input.enabled']]}, nextTest);} ,
[ 'input-stoppropagation.html', 'input-stoppropagation-ref.html'] ,
[ 'textarea-maxlength-valid-before-change.html', 'textarea-valid-ref.html'] ,
[ 'textarea-maxlength-valid-change.html', 'textarea-valid-ref.html'] ,
[ 'textarea-maxlength-invalid-change.html', 'textarea-invalid-ref.html'] ,
[ 'textarea-minlength-valid-before-change.html', 'textarea-valid-ref.html'] ,
[ 'textarea-minlength-valid-change.html', 'textarea-valid-ref.html'] ,
[ 'textarea-minlength-invalid-change.html', 'textarea-invalid-ref.html'] ,
[ 'textarea-maxlength-ui-valid-change.html', 'textarea-valid-ref.html'] ,
[ 'textarea-maxlength-ui-invalid-change.html', 'textarea-invalid-ref.html'] ,
[ 'textarea-minlength-ui-valid-change.html', 'textarea-valid-ref.html'] ,
[ 'textarea-minlength-ui-invalid-change.html', 'textarea-invalid-ref.html'] ,
function() {SpecialPowers.pushPrefEnv({'set': [['bidi.browser.ui', true]]}, nextTest);} ,
[ 'bug646382-1.html' , 'bug646382-1-ref.html' ] ,
[ 'bug646382-2.html' , 'bug646382-2-ref.html' ] ,
[ 'bug664087-1.html' , 'bug664087-1-ref.html' ] ,
[ 'bug664087-2.html' , 'bug664087-2-ref.html' ] ,
[ 'bug682712-1.html' , 'bug682712-1-ref.html' ] ,
function() {SpecialPowers.pushPrefEnv({'clear': [['bidi.browser.ui']]}, nextTest);} ,
[ 'bug746993-1.html' , 'bug746993-1-ref.html' ] ,
function() {SpecialPowers.pushPrefEnv({'set': [['layout.css.overflow-clip-box.enabled', true]]}, nextTest);} ,
[ 'bug966992-1.html' , 'bug966992-1-ref.html' ] ,
[ 'bug966992-2.html' , 'bug966992-2-ref.html' ] ,
function() {SpecialPowers.pushPrefEnv({'clear': [['layout.css.overflow-clip-box.enabled']]}, nextTest);} ,
[ 'bug989012-1.html' , 'bug989012-1-ref.html' ] ,
[ 'bug989012-2.html' , 'bug989012-2-ref.html' ] ,
[ 'bug989012-3.html' , 'bug989012-3-ref.html' ] ,
[ 'bug1007065-1.html' , 'bug1007065-1-ref.html' ] ,
[ 'bug1007067-1.html' , 'bug1007067-1-ref.html' ] ,
[ 'bug1061468.html' , 'bug1061468-ref.html' ] ,
[ 'bug1109968-1.html', 'bug1109968-1-ref.html'] ,
[ 'bug1109968-2.html', 'bug1109968-2-ref.html'] ,
// [ 'bug1123067-1.html' , 'bug1123067-ref.html' ] , TODO: bug 1129205
[ 'bug1123067-2.html' , 'bug1123067-ref.html' ] ,
[ 'bug1123067-3.html' , 'bug1123067-ref.html' ] ,
[ 'bug1132768-1.html' , 'bug1132768-1-ref.html'] ,
[ 'bug1237236-1.html' , 'bug1237236-1-ref.html' ] ,
[ 'bug1237236-2.html' , 'bug1237236-2-ref.html' ] ,
[ 'bug1258308-1.html' , 'bug1258308-1-ref.html' ] ,
[ 'bug1258308-2.html' , 'bug1258308-2-ref.html' ] ,
[ 'bug1259949-1.html' , 'bug1259949-1-ref.html'] ,
[ 'bug1259949-2.html' , 'bug1259949-2-ref.html'] ,
[ 'bug1263288.html' , 'bug1263288-ref.html'] ,
[ 'bug1263357-1.html' , 'bug1263357-1-ref.html'] ,
[ 'bug1263357-2.html' , 'bug1263357-2-ref.html'] ,
[ 'bug1263357-3.html' , 'bug1263357-3-ref.html'] ,
[ 'bug1263357-4.html' , 'bug1263357-4-ref.html'] ,
[ 'bug1263357-5.html' , 'bug1263357-5-ref.html'] ,
[ 'bug1354478-1.html' , 'bug1354478-1-ref.html'] ,
[ 'bug1354478-2.html' , 'bug1354478-2-ref.html'] ,
[ 'bug1354478-3.html' , 'bug1354478-3-ref.html'] ,
[ 'bug1354478-4.html' , 'bug1354478-4-ref.html'] ,
[ 'bug1354478-5.html' , 'bug1354478-5-ref.html'] ,
[ 'bug1354478-6.html' , 'bug1354478-6-ref.html'] ,
[ 'bug1359411.html' , 'bug1359411-ref.html' ] ,
[ 'bug1415416.html' , 'bug1415416-ref.html' ] ,
// FIXME(bug 1434949): These two fail in some platforms.
// [ 'bug1423331-3.html' , 'bug1423331-1-ref.html' ] ,
// [ 'bug1423331-4.html' , 'bug1423331-2-ref.html' ] ,
[ 'bug1484094-1.html' , 'bug1484094-1-ref.html' ] ,
[ 'bug1484094-2.html' , 'bug1484094-2-ref.html' ] ,
[ 'bug1506547-1.html' , 'bug1506547-2.html' ] ,
[ 'bug1506547-2.html' , 'bug1506547-3.html' ] ,
[ 'bug1510942-1.html' , 'bug1510942-1-ref.html' ] ,
[ 'bug1510942-2.html' , 'bug1510942-2-ref.html' ] ,
[ 'bug1524266-1.html' , 'bug1524266-1-ref.html' ] ,
// Checks that the caret isn't occluded by children background content.
[ 'bug1591282-1.html' , 'bug1591282-1-ref.html' ] ,
// Caret on contenteditable with abspos and / or empty content.
[ 'bug1634543-1.html' , 'bug1634543-1-ref.html' ] ,
[ 'bug1634543-2.html' , 'bug1634543-1-ref.html' ] ,
// TODO(emilio): This fails because nsInlineFrame::GetCaretBaseline doesn't
// return one line-height for an empty inline, and it probably should..
// [ 'bug1634543-3.html' , 'bug1634543-1-ref.html' ] ,
[ 'bug1634543-4.html' , 'bug1634543-1-ref.html' ] ,
// Caret + line-height + pseudo-element only.
[ 'bug1634743-1.html' , 'bug1634743-1-ref.html' ] ,
[ 'bug1637476-1.html' , 'bug1637476-1-ref.html' ] ,
[ 'bug1637476-2.html' , 'bug1637476-2-ref.html' ] ,
[ 'bug1637476-3.html' , 'bug1637476-3-ref.html' ] ,
[ 'bug1663475-1.html' , 'bug1663475-1-ref.html' ] ,
[ 'bug1663475-2.html' , 'bug1663475-2-ref.html' ] ,
// shift+arrow key should select non-editable only
[ 'bug1670531-1.html' , 'bug1670531-2.html' ] ,
[ 'bug1670531-3.html' , 'bug1670531-3-ref.html' ] ,
[ 'bug1670531-4.html' , 'bug1670531-3-ref.html' ] ,
function() {SpecialPowers.pushPrefEnv({'clear': [['layout.accessiblecaret.enabled_on_touch']]}, nextTest);} ,
function() {SpecialPowers.pushPrefEnv({'set': [['accessibility.browsewithcaret', true]]}, nextTest);} ,
[ 'bug1529492-1.html' , 'bug1529492-1-ref.html' ] ,
function() {SpecialPowers.pushPrefEnv({'clear': [['accessibility.browsewithcaret']]}, nextTest);} ,
[ 'interlinePosition-after-Selection-addRange.html', 'interlinePosition-after-Selection-addRange-ref.html' ] ,
[ 'collapse-selection-into-editing-host-during-blur-of-input.html', 'collapse-selection-into-editing-host-during-blur-of-input-ref.html' ] ,
[ 'caret-empty-contenteditable-overflow-click.html', 'caret-empty-contenteditable-overflow-click-ref.html' ],
];
if (AppConstants.platform != "android") {
tests.push([ 'bug512295-1.html' , 'bug512295-1-ref.html' ]); // Tests spellchecker
tests.push([ 'bug512295-2.html' , 'bug512295-2-ref.html' ]); // Tests spellchecker
tests.push([ 'bug923376.html' , 'bug923376-ref.html' ]); // Tests spellchecker
tests.push([ 'bug1496118.html' , 'bug1496118-ref.html' ]); // Tests DnD
} else {
is(SpecialPowers.getIntPref("layout.spellcheckDefault"), 0, "Spellcheck should be turned off for this platform or this if..else check removed");
}
if (AppConstants.platform == "linux") {
tests = tests.concat([
// Turn off accessiblecaret to prevent it from interfering with the
// multi-range selection.
function() {SpecialPowers.pushPrefEnv({'set': [['layout.accessiblecaret.enabled_on_touch', false]]}, nextTest);} ,
// eDirPrevious, Shift+click
[ 'multi-range-user-select.html#prev1S_' , 'multi-range-user-select-ref.html#prev1S_' ] ,
[ 'multi-range-user-select.html#prev2S_' , 'multi-range-user-select-ref.html#prev2S_' ] ,
[ 'multi-range-user-select.html#prev3S_' , 'multi-range-user-select-ref.html#prev3S_' ] ,
[ 'multi-range-user-select.html#prev4S_' , 'multi-range-user-select-ref.html#prev4S_' ] ,
[ 'multi-range-user-select.html#prev5S_' , 'multi-range-user-select-ref.html#prev5S_' ] ,
[ 'multi-range-user-select.html#prev6S_' , 'multi-range-user-select-ref.html#prev6S_' ] ,
[ 'multi-range-user-select.html#prev7S_' , 'multi-range-user-select-ref.html#prev7S_' ] ,
// eDirPrevious, Shift+Accel+click
[ 'multi-range-user-select.html#prev1SA' , 'multi-range-user-select-ref.html#prev1SA' ] ,
[ 'multi-range-user-select.html#prev2SA' , 'multi-range-user-select-ref.html#prev2SA' ] ,
[ 'multi-range-user-select.html#prev3SA' , 'multi-range-user-select-ref.html#prev3SA' ] ,
[ 'multi-range-user-select.html#prev4SA' , 'multi-range-user-select-ref.html#prev4SA' ] ,
[ 'multi-range-user-select.html#prev5SA' , 'multi-range-user-select-ref.html#prev5SA' ] ,
[ 'multi-range-user-select.html#prev6SA' , 'multi-range-user-select-ref.html#prev6SA' ] ,
[ 'multi-range-user-select.html#prev7SA' , 'multi-range-user-select-ref.html#prev7SA' ] ,
// eDirPrevious, Accel+drag-select (adding an additional range)
[ 'multi-range-user-select.html#prev1AD' , 'multi-range-user-select-ref.html#prev1AD' ] ,
[ 'multi-range-user-select.html#prev7AD' , 'multi-range-user-select-ref.html#prev7AD' ] ,
// eDirPrevious, Accel+drag-select (bug 1128722)
[ 'multi-range-user-select.html#prev8AD' , 'multi-range-user-select-ref.html#prev8AD' ] ,
// eDirPrevious, VK_RIGHT / LEFT
[ 'multi-range-user-select.html#prev1SR' , 'multi-range-user-select-ref.html#prev1SR' ] ,
[ 'multi-range-user-select.html#prev1SL' , 'multi-range-user-select-ref.html#prev1SL' ] ,
// eDirNext, Shift+click
[ 'multi-range-user-select.html#next1S_' , 'multi-range-user-select-ref.html#next1S_' ] ,
[ 'multi-range-user-select.html#next2S_' , 'multi-range-user-select-ref.html#next2S_' ] ,
[ 'multi-range-user-select.html#next3S_' , 'multi-range-user-select-ref.html#next3S_' ] ,
[ 'multi-range-user-select.html#next4S_' , 'multi-range-user-select-ref.html#next4S_' ] ,
[ 'multi-range-user-select.html#next5S_' , 'multi-range-user-select-ref.html#next5S_' ] ,
[ 'multi-range-user-select.html#next6S_' , 'multi-range-user-select-ref.html#next6S_' ] ,
[ 'multi-range-user-select.html#next7S_' , 'multi-range-user-select-ref.html#next7S_' ] ,
// eDirNext, Shift+Accel+click
[ 'multi-range-user-select.html#next1SA' , 'multi-range-user-select-ref.html#next1SA' ] ,
[ 'multi-range-user-select.html#next2SA' , 'multi-range-user-select-ref.html#next2SA' ] ,
[ 'multi-range-user-select.html#next3SA' , 'multi-range-user-select-ref.html#next3SA' ] ,
[ 'multi-range-user-select.html#next4SA' , 'multi-range-user-select-ref.html#next4SA' ] ,
[ 'multi-range-user-select.html#next5SA' , 'multi-range-user-select-ref.html#next5SA' ] ,
[ 'multi-range-user-select.html#next6SA' , 'multi-range-user-select-ref.html#next6SA' ] ,
[ 'multi-range-user-select.html#next7SA' , 'multi-range-user-select-ref.html#next7SA' ] ,
// eDirNext, Accel+drag-select (adding an additional range)
[ 'multi-range-user-select.html#next1AD' , 'multi-range-user-select-ref.html#next1AD' ] ,
[ 'multi-range-user-select.html#next7AD' , 'multi-range-user-select-ref.html#next7AD' ] ,
// eDirNext, Accel+drag-select (bug 1128722)
[ 'multi-range-user-select.html#next8AD' , 'multi-range-user-select-ref.html#next8AD' ] ,
// eDirNext, VK_RIGHT / LEFT
[ 'multi-range-user-select.html#next1SR' , 'multi-range-user-select-ref.html#next1SR' ] ,
[ 'multi-range-user-select.html#next1SL' , 'multi-range-user-select-ref.html#next1SL' ] ,
// eDirPrevious, Shift+click
[ 'multi-range-script-select.html#prev1S_' , 'multi-range-script-select-ref.html#prev1S_' ] ,
[ 'multi-range-script-select.html#prev2S_' , 'multi-range-script-select-ref.html#prev2S_' ] ,
[ 'multi-range-script-select.html#prev3S_' , 'multi-range-script-select-ref.html#prev3S_' ] ,
[ 'multi-range-script-select.html#prev4S_' , 'multi-range-script-select-ref.html#prev4S_' ] ,
[ 'multi-range-script-select.html#prev5S_' , 'multi-range-script-select-ref.html#prev5S_' ] ,
[ 'multi-range-script-select.html#prev6S_' , 'multi-range-script-select-ref.html#prev6S_' ] ,
[ 'multi-range-script-select.html#prev7S_' , 'multi-range-script-select-ref.html#prev7S_' ] ,
// eDirPrevious, Shift+Accel+click
[ 'multi-range-script-select.html#prev1SA' , 'multi-range-script-select-ref.html#prev1SA' ] ,
[ 'multi-range-script-select.html#prev2SA' , 'multi-range-script-select-ref.html#prev2SA' ] ,
[ 'multi-range-script-select.html#prev3SA' , 'multi-range-script-select-ref.html#prev3SA' ] ,
[ 'multi-range-script-select.html#prev4SA' , 'multi-range-script-select-ref.html#prev4SA' ] ,
[ 'multi-range-script-select.html#prev5SA' , 'multi-range-script-select-ref.html#prev5SA' ] ,
[ 'multi-range-script-select.html#prev6SA' , 'multi-range-script-select-ref.html#prev6SA' ] ,
[ 'multi-range-script-select.html#prev7SA' , 'multi-range-script-select-ref.html#prev7SA' ] ,
// eDirPrevious, Accel+drag-select (adding an additional range)
[ 'multi-range-script-select.html#prev1AD' , 'multi-range-script-select-ref.html#prev1AD' ] ,
[ 'multi-range-script-select.html#prev7AD' , 'multi-range-script-select-ref.html#prev7AD' ] ,
// eDirPrevious, VK_RIGHT / LEFT
[ 'multi-range-script-select.html#prev1SR' , 'multi-range-script-select-ref.html#prev1SR' ] ,
[ 'multi-range-script-select.html#prev1SL' , 'multi-range-script-select-ref.html#prev1SL' ] ,
// eDirNext, Shift+click
[ 'multi-range-script-select.html#next1S_' , 'multi-range-script-select-ref.html#next1S_' ] ,
[ 'multi-range-script-select.html#next2S_' , 'multi-range-script-select-ref.html#next2S_' ] ,
[ 'multi-range-script-select.html#next3S_' , 'multi-range-script-select-ref.html#next3S_' ] ,
[ 'multi-range-script-select.html#next4S_' , 'multi-range-script-select-ref.html#next4S_' ] ,
[ 'multi-range-script-select.html#next5S_' , 'multi-range-script-select-ref.html#next5S_' ] ,
[ 'multi-range-script-select.html#next6S_' , 'multi-range-script-select-ref.html#next6S_' ] ,
[ 'multi-range-script-select.html#next7S_' , 'multi-range-script-select-ref.html#next7S_' ] ,
// eDirNext, Shift+Accel+click
[ 'multi-range-script-select.html#next1SA' , 'multi-range-script-select-ref.html#next1SA' ] ,
[ 'multi-range-script-select.html#next2SA' , 'multi-range-script-select-ref.html#next2SA' ] ,
[ 'multi-range-script-select.html#next3SA' , 'multi-range-script-select-ref.html#next3SA' ] ,
[ 'multi-range-script-select.html#next4SA' , 'multi-range-script-select-ref.html#next4SA' ] ,
[ 'multi-range-script-select.html#next5SA' , 'multi-range-script-select-ref.html#next5SA' ] ,
[ 'multi-range-script-select.html#next6SA' , 'multi-range-script-select-ref.html#next6SA' ] ,
[ 'multi-range-script-select.html#next7SA' , 'multi-range-script-select-ref.html#next7SA' ] ,
// eDirNext, Accel+drag-select (adding an additional range)
[ 'multi-range-script-select.html#next1AD' , 'multi-range-script-select-ref.html#next1AD' ] ,
[ 'multi-range-script-select.html#next7AD' , 'multi-range-script-select-ref.html#next7AD' ] ,
// eDirNext, VK_RIGHT / LEFT
[ 'multi-range-script-select.html#next1SR' , 'multi-range-script-select-ref.html#next1SR' ] ,
[ 'multi-range-script-select.html#next1SL' , 'multi-range-script-select-ref.html#next1SL' ] ,
// Tries to select and delete non-selectable content in a user-select subtree.
[ 'bug1524266-2.html' , 'bug1524266-2-ref.html' ] ,
[ 'bug1524266-3.html' , 'bug1524266-2-ref.html' ] ,
// Tries to select and delete non-editable content in a user-select subtree.
[ 'bug1524266-4.html' , 'bug1524266-2-ref.html' ] ,
// Tries to edit an <input type="number"> with arrows inside a user-select: none element.
[ 'bug1611661.html' , 'bug1611661-ref.html' ] ,
function() {SpecialPowers.pushPrefEnv({'clear': [['layout.accessiblecaret.enabled_on_touch']]}, nextTest);} ,
]);
}
var testIndex = 0;
// Change it to something like /bug1524266/ to skip all other tests and make
// debugging easier...
const DEBUG_TEST_FILTER = null;
function isTestSkipped(test) {
if (DEBUG_TEST_FILTER) {
return !DEBUG_TEST_FILTER.test(test[0]);
}
// Tests disabled for frequent failures (bug 1777050).
if (AppConstants.platform == "android") {
return [
"bug1516963-4.html",
"bug1258308-1.html",
"bug1591282-1.html",
"bug1670531-1.html",
].includes(test[0]);
}
if (AppConstants.platform == "win" || AppConstants.platform == "macosx") {
return [
"bug1516963-3.html",
"bug1516963-4.html",
"bug1516963-6.html",
"bug956530-1.html",
].includes(test[0]);
}
return false;
}
function nextTest() {
// Move the mouse out of the way so that :hover doesn't interact with tests.
synthesizeMouse(document.body, 1, 1, { type: "mousemove" });
if (testIndex < tests.length) {
let test = tests[testIndex];
if (typeof(test) == 'function') {
test();
} else if (!isTestSkipped(test)) {
refTest(test[0], test[1]);
} else {
info("Skipping " + test[0]);
setTimeout(nextTest, 0);
}
++testIndex;
} else {
endTest();
}
}
async function runTests() {
try {
if (window.parent) {
await SpecialPowers.spawn(window.parent, [], () => {
content.document.styleSheets[content.document.styleSheets.length-1]
.insertRule("iframe#testframe{width:600px;height:400px}",0);
});
}
try {
caretBlinkTime = SpecialPowers.getIntPref("ui.caretBlinkTime");
} catch (e) {}
SpecialPowers.pushPrefEnv({'set': [['ui.caretBlinkTime', -1]]}, nextTest);
} catch(e) {
endTest();
}
}
SimpleTest.waitForFocus(runTests);
</script>
<body>
</body>
|