Closed Bug 96604 Opened 25 years ago Closed 25 years ago

Deleting characters from some form input controls will allow altering page content - Trunk [@ 0x00000000 - nsTypedSelection::EndBatchChanges]

Categories

(Core :: Layout: Form Controls, defect, P1)

x86
All
defect

Tracking

()

VERIFIED FIXED
mozilla0.9.4

People

(Reporter: caillon, Assigned: kinmoz)

References

Details

(4 keywords, Whiteboard: want for 0.9.4)

Crash Data

Attachments

(5 files)

Linux 2001082221. 1. In Bugzilla, click on "create a new attachment" 2. Type something in the description input box. Anything is fine. 3. Move the cursor to the beginning of the input box and start hitting backspace a couple times. 4. The input control moves! (screenshot to follow) I'm not sure why it does it only on that control. I've tried it on the form controls on this page and nothing has happened.
Hmm, I can get it to happen on the depends on blocks input controls on this bug report page also.... Also, when you do get it to change, pressing CTRL + Z (undo) while inside the input control will undo the move.
confirmed, Linux 2001082221
Confirming this with current (10 minutes old) trunk on Red Hat 7.1 Linux.
Doesn't appear to be a resizing issue - reassigning
Assignee: rods → beppe
>-- brade
Assignee: beppe → brade
Ender lite strikes again.
trying to reproduce this bug on win2000 -build ID: 2001-08-24-06 trunk, caused a browser crash. I'll provide the incident ID as soon as i am able to connect to Talkback. Currently I am having some problem doing so. I am going to open a new bug for this issue since it is different from the original bug.
Here is the stack trace: ======================================================== Incident ID: 34476125 Stack Signature: 0x00000000 d8df30cd Bug ID Trigger Time: 2001-08-24 11:26:11 Email Address: madhur@netscape.com User Comments: Build ID: 2001082406 Product ID: MozillaTrunk Platform ID: Win32 Trigger Reason: Access violation Stack Trace =========================================================== 0x00000000 nsTypedSelection::EndBatchChanges [d:\builds\seamonkey\mozilla\content\base\src\nsSelection.cpp, line 7500] nsEditor::Do [d:\builds\seamonkey\mozilla\editor\base\nsEditor.cpp, line 503] nsEditor::DeleteSelectionImpl [d:\builds\seamonkey\mozilla\editor\base\nsEditor.cpp, line 4413] nsPlaintextEditor::DeleteSelection [d:\builds\seamonkey\mozilla\editor\base\nsPlaintextEditor.cpp, line 935] nsTextEditorKeyListener::KeyPress [d:\builds\seamonkey\mozilla\editor\base\nsEditorEventListeners.cpp, line 244] nsEventListenerManager::HandleEvent [d:\builds\seamonkey\mozilla\content\events\src\nsEventListenerManager.cpp, line 1633] nsGenericElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\base\src\nsGenericElement.cpp, line 1687] nsHTMLInputElement::HandleDOMEvent [d:\builds\seamonkey\mozilla\content\html\content\src\nsHTMLInputElement.cpp, line 1099] PresShell::HandleEventInternal [d:\builds\seamonkey\mozilla\layout\html\base\src\nsPresShell.cpp, line 5653] PresShell::HandleEvent [d:\builds\seamonkey\mozilla\layout\html\base\src\nsPresShell.cpp, line 5578] nsView::HandleEvent [d:\builds\seamonkey\mozilla\view\src\nsView.cpp, line 377] nsView::HandleEvent [d:\builds\seamonkey\mozilla\view\src\nsView.cpp, line 350] nsView::HandleEvent [d:\builds\seamonkey\mozilla\view\src\nsView.cpp, line 350] nsViewManager::DispatchEvent [d:\builds\seamonkey\mozilla\view\src\nsViewManager.cpp, line 2056] HandleEvent [d:\builds\seamonkey\mozilla\view\src\nsView.cpp, line 68] nsWindow::DispatchEvent [d:\builds\seamonkey\mozilla\widget\src\windows\nsWindow.cpp, line 732] nsWindow::DispatchWindowEvent [d:\builds\seamonkey\mozilla\widget\src\windows\nsWindow.cpp, line 749] nsWindow::DispatchKeyEvent [d:\builds\seamonkey\mozilla\widget\src\windows\nsWindow.cpp, line 2405] nsWindow::OnKeyDown [d:\builds\seamonkey\mozilla\widget\src\windows\nsWindow.cpp, line 2473] nsWindow::ProcessMessage [d:\builds\seamonkey\mozilla\widget\src\windows\nsWindow.cpp, line 3170]
I was able to reproduce the original bug "Deleting characters from beginning of some form input controls will delete page content" on win2000 also. To reproduce the crash: 1. enter something in the text box. 2. go to the beginning of the text 3. press "backspace' key ---- the page content will start deleting as mentioned in the previous comments by the reporter. 4. now, press the 'del' key ---- the browser will crash
Bug 96841 has already been written for the crash problem.
changing OS to all
OS: Linux → All
Attached file Minimal test case. —
Taking, I have a fix for this.
Assignee: brade → kin
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → mozilla0.9.5
Adding some keywords. I think this will be a fairly big catfood issue. Input forms are all over the web and a lot of people just press and hold backspace to erase what they've typed. This bug will certainly alarm quite a few users. If there is a fix, kin, it might be worth trying to get this into 0.9.4. Otherwise I think this will become a mostfreq bug during the upcoming weeks. Also, I wonder if the blocker/crasher bug 96841 is caused in part by this?
*** Bug 97024 has been marked as a duplicate of this bug. ***
There's more to it but see for yourself... : http://bugzilla.mozilla.org/showattachment.cgi?attach_id=47144 (from Bug 97024) A) you can also delete characters from the end of some input controls B) you can add text to the html-page Detailed how-to in Bug 97024, too - changing Summary.
Summary: Deleting characters from beginning of some form input controls will delete page content → Deleting characters from some form input controls will allow altering page content
Interesting : One of the affected input controls is ... the URL-Bar =)
Moving to mozilla.0.9.4. I just attatched a patch that fixes the problem. jfrancis, can I get an r= from you?
Target Milestone: mozilla0.9.5 → mozilla0.9.4
r=jfrancis, with one caveat. We have a bunch of places in editor/base where we get the root element and qi it to a root node, and then compare it to another node. Should we change all those to call IsRootElement? Seems cleaner...
Yeah, I'd like to see us use this method when we can. I don't see any reason not to unless we're going to be continuously comapring in a time critical piece of code. In any case that can be done in a separate sweep, since we want to keep changes minimal especially if we want this to go into 0.9.4. sfraser, can I get an sr= from you?
This looks hokey: +PRBool +nsEditor::IsRootNode(nsIDOMNode *inNode) +{ + if (!inNode) + return PR_FALSE; + + nsCOMPtr<nsIDOMElement> rootElement; + + nsresult result = GetRootElement(getter_AddRefs(rootElement)); + + if (NS_FAILED(result) || !rootElement) + return PR_FALSE; + + nsCOMPtr<nsIDOMNode> rootNode = do_QueryInterface(mBodyElement); + + if (inNode == rootNode.get()) + return PR_TRUE; + + return PR_FALSE; } Why get rootElement and ignore it?
Yeah, my bad, changed: + nsCOMPtr<nsIDOMNode> rootNode = do_QueryInterface(mBodyElement); to: + nsCOMPtr<nsIDOMNode> rootNode = do_QueryInterface(rootElement);
Attached patch Patch (Rev 1.1) — — Splinter Review
I just attatched the latest diff I have in my tree. Can I get an sr=?
sr=sfraser
is bug 97196 a dup?
*** Bug 97196 has been marked as a duplicate of this bug. ***
high profile. high reward. a=asa
Checked fix into the TRUNK: mozilla/editor/base/nsEditor.cpp revision 1.334 mozilla/editor/base/nsEditor.h revision 1.132
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Good, haven't had a chance to test this, but I crashed after using 'Delete' in the Additional Comments field and finding the rest of the page being pulled up by one line each time, then hitting 'Submit'. Commenting here in case it has any bearing on anything.
Keywords: regression
James Green: the crash you saw is probably bug 96841
Nope this was after form submission. Editing had been completed. I hit Submit, saw the network get busy, then returned from another screen a minute later and mozilla had segfaulted.
*** Bug 97336 has been marked as a duplicate of this bug. ***
*** Bug 96718 has been marked as a duplicate of this bug. ***
*** Bug 97501 has been marked as a duplicate of this bug. ***
*** Bug 97236 has been marked as a duplicate of this bug. ***
verified fixed on win2000 - buildID: 2001-08-29-11trunk and linux 7.1 - buildID: 2001-08-28-08trunk. No crash, too.
Status: RESOLVED → VERIFIED
*** Bug 97718 has been marked as a duplicate of this bug. ***
*** Bug 98018 has been marked as a duplicate of this bug. ***
*** Bug 98172 has been marked as a duplicate of this bug. ***
Adding crash, topcrash keywords and Trunk [@ 0x00000000 - nsTypedSelection::EndBatchChanges] to summary for future reference.
Keywords: crash, topcrash
Summary: Deleting characters from some form input controls will allow altering page content → Deleting characters from some form input controls will allow altering page content - Trunk [@ 0x00000000 - nsTypedSelection::EndBatchChanges]
Crash Signature: [@ 0x00000000 - nsTypedSelection::EndBatchChanges]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: