mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
7b68e9930e
--HG-- extra : rebase_source : f9c86be2647c942ad807cc9d31a10650ce68b58f
51 lines
1.8 KiB
HTML
51 lines
1.8 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<!--
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=654352
|
|
-->
|
|
<head>
|
|
<title>Test for Bug 654352</title>
|
|
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
</head>
|
|
<body>
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=654352">Mozilla Bug 654352</a>
|
|
<p id="display"></p>
|
|
<div id="content" style="display: none">
|
|
|
|
</div>
|
|
<pre id="test">
|
|
<script type="application/javascript">
|
|
/** Test for Bug 654352 **/
|
|
SimpleTest.waitForExplicitFinish();
|
|
function afterLoad() {
|
|
var testpre = document.getElementById("testpre");
|
|
var rect1 = testpre.getBoundingClientRect();
|
|
dump(rect1 + "\n");
|
|
var caret1 = document.caretPositionFromPoint(rect1.right - 5, rect1.top + 10);
|
|
ok(caret1.offsetNode == testpre.firstChild, "node in CaretPosition not correct (" + caret1.offsetNode + " == " + testpre.firstChild + ")")
|
|
ok(caret1.offset == 9, "offset in CaretPosition not correct (" + caret1.offset + "== 9)")
|
|
|
|
var testinput = document.getElementById("testinput");
|
|
var rect2 = testinput.getBoundingClientRect();
|
|
dump(rect2.top +", " + rect2.left + "\n");
|
|
var caret2 = document.caretPositionFromPoint( rect2.right - 5, rect2.top + 10);
|
|
ok(caret2.offsetNode == testinput, "node in CaretPosition not correct (" + caret2.offsetNode + " == " + testinput + ")")
|
|
ok(caret2.offset == 9, "offset in CaretPosition not correct (" + caret2.offset + "== 9)")
|
|
SimpleTest.finish();
|
|
};
|
|
addLoadEvent(afterLoad);
|
|
</script>
|
|
</pre>
|
|
<span id="testdiv">
|
|
<pre id="testpre">test text</pre>
|
|
</span>
|
|
<br>
|
|
<br>
|
|
</div>
|
|
<input id="testinput" type="text" value="test text"></input>
|
|
</div>
|
|
</body>
|
|
</html>
|