mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Force the test to complete after 1 sec to avoid hang if the window isn't focused. b=564413
This commit is contained in:
parent
6b28186055
commit
73489238b0
@ -15,17 +15,21 @@
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
var done = false;
|
||||
function runTest(p) {
|
||||
if (done)
|
||||
return;
|
||||
try {
|
||||
var r = window.getSelection().getRangeAt(0);
|
||||
r.setStart(p.childNodes[1],1);
|
||||
r.setEnd(p.childNodes[1],1);
|
||||
} catch (e) {}
|
||||
document.documentElement.removeAttribute('class');
|
||||
done = true;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="setTimeout(function(){window.focus();document.getElementsByTagName('p')[0].focus()},400)">
|
||||
<body onload="var p = document.getElementsByTagName('p')[0]; p.focus(); setTimeout(function(){runTest(p)},1000)">
|
||||
|
||||
<p onfocus="runTest(this)" contentEditable="true"
|
||||
style="text-align:justify"><span> </span> </p>
|
||||
|
@ -15,17 +15,21 @@
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
var done = false;
|
||||
function runTest(p) {
|
||||
if (done)
|
||||
return;
|
||||
try {
|
||||
var r = window.getSelection().getRangeAt(0);
|
||||
r.setStart(p.childNodes[0],14);
|
||||
r.setEnd(p.childNodes[0],14);
|
||||
} catch (e) {}
|
||||
document.documentElement.removeAttribute('class');
|
||||
done = true;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="setTimeout(function(){window.focus();document.getElementsByTagName('p')[0].focus()},400)">
|
||||
<body onload="var p = document.getElementsByTagName('p')[0]; p.focus(); setTimeout(function(){runTest(p)},1000)">
|
||||
|
||||
<p onfocus="runTest(this)" contentEditable="true"
|
||||
style="text-align:justify"> </p>
|
||||
|
Loading…
Reference in New Issue
Block a user