Closed
Bug 320006
Opened 19 years ago
Closed 16 years ago
When Undo should make a textbox empty, it makes the textbox contain an (invisible) line break instead
Categories
(Core :: DOM: Editor, defect)
Core
DOM: Editor
Tracking
()
RESOLVED
DUPLICATE
of bug 318065
People
(Reporter: bugzilla.x.jsd, Unassigned)
References
Details
Attachments
(1 file)
(deleted),
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7
If you paste a string into an html text input field, and then do an undo, the field will be left with a single newline character.
Reproducible: Always
Steps to Reproduce:
Copy this word *HELLO* to the clipboard.<br>
Then right click on the left field and select Paste.<br>
Then right click again on the left field and select Undo.<br>
<form name='f'>
<input type="text" name="input">
<input type="text" name="output">
</form>
<script>
document.f.input.addEventListener("input", oninput, true);
function oninput()
{
document.f.output.value = escape(document.f.input.value);
}
</script>
Copy this word *HELLO* to the clipboard.<br>
Then right click on the left field and select Paste.<br>
Then right click again on the left field and select Undo.<br>
<form name='f'>
<input type="text" name="input">
<input type="text" name="output">
</form>
<script>
document.f.input.addEventListener("input", oninput, true);
function oninput()
{
document.f.output.value = escape(document.f.input.value);
}
</script>
Updated•19 years ago
|
Assignee: nobody → mozeditor
Component: Form Manager → Editor
Product: Firefox → Core
QA Contact: form.manager
Version: unspecified → 1.7 Branch
Comment 1•19 years ago
|
||
Confirmed using Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8) Gecko/20051108 Firefox/1.5.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Comment 2•19 years ago
|
||
Comment 3•19 years ago
|
||
This might be what's causing bug 318355.
Summary: Undoing an input text box inserts newline (%0A) → When Undo should make a textbox empty, it makes the textbox contain an (invisible) line break instead
Updated•19 years ago
|
Version: 1.7 Branch → 1.8 Branch
Updated•18 years ago
|
QA Contact: editor
Updated•18 years ago
|
Assignee: mozeditor → nobody
Comment 4•16 years ago
|
||
So, when an input element is empty, the editor code places a placeholder <br> element in there. When you input text, the <br> is deleted, and a text node containing the text inserted. On undo, the opposite happens.
there's some magic in nsTextEditRules::DidUndo to flag the <br> as bogus, so that it isn't converted into a linefeed when the value property of the input element is read.
However, the input event handler is invoked before this takes place, causing this behaviour.
Updated•16 years ago
|
Version: 1.8 Branch → Trunk
Comment 5•16 years ago
|
||
Someone
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•