mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-06 04:35:04 +00:00
Bug 592592 - Part 3: Add a test for the back-space behavior to make sure that back-space will not delete multiple consecutive space characters; r=roc
This commit is contained in:
parent
8aad63cc4e
commit
97ae025e91
@ -15,6 +15,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=592592
|
||||
<p id="display"></p>
|
||||
<div id="content">
|
||||
<div id="editor" contenteditable="true" style="white-space:pre-wrap">a b</div>
|
||||
<div id="editor2" contenteditable="true" style="white-space:pre-wrap">a b</div>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
@ -51,6 +52,18 @@ SimpleTest.waitForFocus(function() {
|
||||
// Make sure that we have added an nbsp
|
||||
is(ed.innerHTML, "a b", "We should add an for non-preformatted text");
|
||||
|
||||
ed = document.getElementById("editor2");
|
||||
|
||||
// Put the selection after the second space in the second editable field
|
||||
ed.focus();
|
||||
window.getSelection().collapse(ed.firstChild, 3);
|
||||
|
||||
// Press the back-space key
|
||||
synthesizeKey("VK_BACK_SPACE", {});
|
||||
|
||||
// Make sure that we've only deleted a single space
|
||||
is(ed.innerHTML, "a b", "We should only be deleting a single space");
|
||||
|
||||
SimpleTest.finish();
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user