mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 18:04:46 +00:00
Bug 1259949 - Caret reftests.
This commit is contained in:
parent
709991c29d
commit
de075da893
30
layout/base/tests/bug1259949-1-ref.html
Normal file
30
layout/base/tests/bug1259949-1-ref.html
Normal file
@ -0,0 +1,30 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<meta charset="utf-8">
|
||||
<title>Testcase #1 for bug 1259949</title>
|
||||
<script>
|
||||
function test1() {
|
||||
synthesizeKey("VK_DOWN", {});
|
||||
// caret should now be at the start of the second line
|
||||
document.body.offsetHeight;
|
||||
setTimeout(function(){ document.documentElement.removeAttribute("class"); },0);
|
||||
}
|
||||
function runTests() {
|
||||
document.querySelector('textarea').focus();
|
||||
document.body.offsetHeight;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<textarea onfocus="test1()" spellcheck="false" style="-moz-appearance:none">abcdef
|
||||
</textarea>
|
||||
|
||||
<script>
|
||||
SimpleTest.waitForFocus(runTests);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
34
layout/base/tests/bug1259949-1.html
Normal file
34
layout/base/tests/bug1259949-1.html
Normal file
@ -0,0 +1,34 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<meta charset="utf-8">
|
||||
<title>Testcase #1 for bug 1259949</title>
|
||||
<script>
|
||||
function test1() {
|
||||
synthesizeKey("VK_RIGHT", {});
|
||||
synthesizeKey("VK_RIGHT", {});
|
||||
synthesizeKey("VK_RIGHT", {}); // caret is now between "c" and "d"
|
||||
synthesizeKey("VK_DOWN", {shiftKey: true}); // select "def\n"
|
||||
synthesizeKey("VK_RIGHT", {}); // collapse to the end of the selection
|
||||
// caret should now be at the start of the second line
|
||||
document.body.offsetHeight;
|
||||
setTimeout(function(){ document.documentElement.removeAttribute("class"); },0);
|
||||
}
|
||||
function runTests() {
|
||||
document.querySelector('textarea').focus();
|
||||
document.body.offsetHeight;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<textarea onfocus="test1()" spellcheck="false" style="-moz-appearance:none">abcdef
|
||||
</textarea>
|
||||
|
||||
<script>
|
||||
SimpleTest.waitForFocus(runTests);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
36
layout/base/tests/bug1259949-2-ref.html
Normal file
36
layout/base/tests/bug1259949-2-ref.html
Normal file
@ -0,0 +1,36 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<meta charset="utf-8">
|
||||
<title>Testcase #2 for bug 1259949</title>
|
||||
<script>
|
||||
function test1() {
|
||||
synthesizeKey("VK_RIGHT", { });
|
||||
synthesizeKey("VK_RIGHT", { });
|
||||
synthesizeKey("VK_RIGHT", { });
|
||||
synthesizeKey("VK_RIGHT", { });
|
||||
synthesizeKey("VK_RIGHT", { });
|
||||
synthesizeKey("VK_RIGHT", { });
|
||||
synthesizeKey("VK_RIGHT", { });
|
||||
document.body.offsetHeight;
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
function runTests() {
|
||||
document.querySelector('pre').focus();
|
||||
document.body.offsetHeight;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<pre contenteditable tabindex=1 onfocus="test1()" spellcheck="false">abcdef
|
||||
|
||||
</pre>
|
||||
|
||||
<script>
|
||||
SimpleTest.waitForFocus(runTests);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
30
layout/base/tests/bug1259949-2.html
Normal file
30
layout/base/tests/bug1259949-2.html
Normal file
@ -0,0 +1,30 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<meta charset="utf-8">
|
||||
<title>Testcase #2 for bug 1259949</title>
|
||||
<script>
|
||||
function test1() {
|
||||
document.body.offsetHeight;
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
function runTests() {
|
||||
var pre = document.querySelector('pre');
|
||||
window.getSelection().collapse(pre, 1/*after the text*/)
|
||||
pre.focus();
|
||||
document.body.offsetHeight;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="runTests()">
|
||||
|
||||
<pre contenteditable tabindex=1 onfocus="test1()" spellcheck="false">abcdef
|
||||
<br></pre>
|
||||
|
||||
<script>
|
||||
SimpleTest.waitForFocus(runTests);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -43,6 +43,10 @@ support-files =
|
||||
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
|
||||
selection-utils.js
|
||||
multi-range-user-select.html
|
||||
multi-range-user-select-ref.html
|
||||
|
@ -158,6 +158,8 @@ var tests = [
|
||||
[ 'bug1237236-1.html' , 'bug1237236-1-ref.html' ] ,
|
||||
[ 'bug1237236-2.html' , 'bug1237236-2-ref.html' ] ,
|
||||
[ 'bug1258308-2.html' , 'bug1258308-2-ref.html' ] ,
|
||||
[ 'bug1259949-1.html' , 'bug1259949-1-ref.html'] ,
|
||||
[ 'bug1259949-2.html' , 'bug1259949-2-ref.html'] ,
|
||||
function() {SpecialPowers.pushPrefEnv({'clear': [['layout.accessiblecaret.enabled']]}, nextTest);} ,
|
||||
];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user