###!!! ASSERTION: Newline improperly getting into single-line edit field!: '(singleLineNewlineBehavior == ePasteIntact)', file r:/mozilla/editor/libeditor/text/nsTextEditRules.cpp, line 689

RESOLVED FIXED in mozilla1.8beta2

Status

()

Core
Editor
RESOLVED FIXED
13 years ago
13 years ago

People

(Reporter: timeless, Assigned: masayuki)

Tracking

({assertion})

Trunk
mozilla1.8beta2
assertion
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

13 years ago
###!!! ASSERTION: Newline improperly getting into single-line edit field!:
'(singleLineNewlineBehavior == ePasteIntact)', file
r:/mozilla/editor/libeditor/text/nsTextEditRules.cpp, line 689
Break: at file r:/mozilla/editor/libeditor/text/nsTextEditRules.cpp, line 689

 	xpcom_core.dll!nsDebugImpl::Assertion(const char * aStr=0x07c05ee8, const char
* aExpr=0x07c05ebc, const char * aFile=0x07c05e84, int aLine=689)  Line 301	C++
 	xpcom_core.dll!nsDebug::Assertion(const char * aStr=0x07c05ee8, const char *
aExpr=0x07c05ebc, const char * aFile=0x07c05e84, int aLine=689)  Line 109	C++
 	editor.dll!nsTextEditRules::WillInsertText(int aAction=2000, nsISelection *
aSelection=0x091c6540, int * aCancel=0x0012e4bc, int * aHandled=0x0012e3dc,
const nsAString * inString=0x0012e53c, nsAString * outString=0x0012e3e0, int
aMaxLength=-1)  Line 689 + 0x20	C++
 	editor.dll!nsTextEditRules::WillDoAction(nsISelection * aSelection=0x091c6540,
nsRulesInfo * aInfo=0x0012e47c, int * aCancel=0x0012e4bc, int *
aHandled=0x0012e3dc)  Line 302 + 0x30	C++
 	editor.dll!nsPlaintextEditor::InsertText(const nsAString &
aStringToInsert={...})  Line 916 + 0x3e	C++
 	editor.dll!nsPlaintextEditor::InsertTextAt(const nsAString &
aStringToInsert={...}, nsIDOMNode * aDestinationNode=0x00000000, int
aDestOffset=0, int aDoDeleteSelection=1)  Line 109	C++
 	editor.dll!nsPlaintextEditor::InsertTextFromTransferable(nsITransferable *
aTransferable=0x08c08318, nsIDOMNode * aDestinationNode=0x00000000, int
aDestOffset=0, int aDoDeleteSelection=1)  Line 131 + 0x1b	C++
 	editor.dll!nsPlaintextEditor::Paste(int aSelectionType=1)  Line 442 + 0x1e	C++
 	editor.dll!nsPasteCommand::DoCommand(const char * aCommandName=0x0012e9e0,
nsISupports * aCommandRefCon=0x09930c08)  Line 418 + 0x1c	C++
 	embedcomponents.dll!nsControllerCommandTable::DoCommand(const char *
aCommandName=0x0012e9e0, nsISupports * aCommandRefCon=0x09930c08)  Line 191 +
0x1f	C++
 	embedcomponents.dll!nsBaseCommandController::DoCommand(const char *
aCommand=0x0012e9e0)  Line 132	C++
 	gklayout.dll!nsXBLPrototypeHandler::ExecuteHandler(nsIDOMEventReceiver *
aReceiver=0x091655f0, nsIDOMEvent * aEvent=0x07541208)  Line 353	C++
 	gklayout.dll!nsXBLKeyEventHandler::HandleEvent(nsIDOMEvent *
aEvent=0x07541208)  Line 144	C++
 	gklayout.dll!nsEventListenerManager::HandleEventSubType(nsListenerStruct *
aListenerStruct=0x098e90f0, nsIDOMEvent * aDOMEvent=0x07541208,
nsIDOMEventTarget * aCurrentTarget=0x091655f0, unsigned int aSubType=4, unsigned
int aPhaseFlags=519)  Line 1557 + 0x14	C++
 	gklayout.dll!nsEventListenerManager::HandleEvent(nsPresContext *
aPresContext=0x0b3bb088, nsEvent * aEvent=0x0012f70c, nsIDOMEvent * *
aDOMEvent=0x0012ef8c, nsIDOMEventTarget * aCurrentTarget=0x091655f0, unsigned
int aFlags=519, nsEventStatus * aEventStatus=0x0012f514)  Line 1656	C++
 	gklayout.dll!nsGenericElement::HandleDOMEvent(nsPresContext *
aPresContext=0x0b3bb088, nsEvent * aEvent=0x0012f70c, nsIDOMEvent * *
aDOMEvent=0x0012ef8c, unsigned int aFlags=519, nsEventStatus *
aEventStatus=0x0012f514)  Line 2041	C++
 	gklayout.dll!nsHTMLInputElement::HandleDOMEvent(nsPresContext *
aPresContext=0x0b3bb088, nsEvent * aEvent=0x0012f70c, nsIDOMEvent * *
aDOMEvent=0x00000000, unsigned int aFlags=513, nsEventStatus *
aEventStatus=0x0012f514)  Line 1363 + 0x1f	C++
 	gklayout.dll!PresShell::HandleEventInternal(nsEvent * aEvent=0x0012f70c,
nsIView * aView=0x0b190fe8, unsigned int aFlags=1, nsEventStatus *
aStatus=0x0012f514)  Line 6081 + 0x37	C++
 	gklayout.dll!PresShell::HandleEvent(nsIView * aView=0x0b190fe8, nsGUIEvent *
aEvent=0x0012f70c, nsEventStatus * aEventStatus=0x0012f514, int aForceHandle=1,
int & aHandled=1)  Line 5900 + 0x19	C++
 	gklayout.dll!nsViewManager::HandleEvent(nsView * aView=0x0b190fe8, nsGUIEvent
* aEvent=0x0012f70c, int aCaptured=0)  Line 2450	C++
 	gklayout.dll!nsViewManager::DispatchEvent(nsGUIEvent * aEvent=0x0012f70c,
nsEventStatus * aStatus=0x0012f654)  Line 2217 + 0x14	C++
 	gklayout.dll!HandleEvent(nsGUIEvent * aEvent=0x0012f70c)  Line 174	C++
 	gkwidget.dll!nsWindow::DispatchEvent(nsGUIEvent * event=0x0012f70c,
nsEventStatus & aStatus=nsEventStatus_eIgnore)  Line 1150 + 0xa	C++
 	gkwidget.dll!nsWindow::DispatchWindowEvent(nsGUIEvent * event=0x0012f70c) 
Line 1171	C++
 	gkwidget.dll!nsWindow::DispatchKeyEvent(unsigned int aEventType=131, unsigned
short aCharCode=118, unsigned int aVirtualCharCode=0, long aKeyData=0, unsigned
int aFlags=0)  Line 3358 + 0xf	C++
 	gkwidget.dll!nsWindow::OnChar(unsigned int charCode=0, unsigned int aFlags=0)
 Line 3592 + 0x1f	C++
 	gkwidget.dll!nsWindow::OnKeyDown(unsigned int aVirtualKeyCode=86, unsigned int
aScanCode=47, long aKeyData=3080193)  Line 3445 + 0x22	C++
 	gkwidget.dll!nsWindow::ProcessMessage(unsigned int msg=256, unsigned int
wParam=86, long lParam=3080193, long * aRetValue=0x0012fc7c)  Line 4342 + 0x1d	C++
 	gkwidget.dll!nsWindow::WindowProc(HWND__ * hWnd=0x000523c0, unsigned int
msg=256, unsigned int wParam=86, long lParam=3080193)  Line 1442 + 0x1b	C++
 	user32.dll!_InternalCallWinProc@20()  + 0x28	
 	user32.dll!_UserCallWinProcCheckWow@32()  + 0xb7	
 	user32.dll!_DispatchMessageWorker@8()  + 0xdc	
 	user32.dll!_DispatchMessageW@4()  + 0xf	
 	gkwidget.dll!nsAppShell::Run()  Line 135	C++
 	appcomps.dll!nsAppStartup::Run()  Line 208	C++
 	mozilla.exe!main1(int argc=1, char * * argv=0x00348260, nsISupports *
nativeApp=0x00c16838)  Line 1325 + 0x20	C++
 	mozilla.exe!main(int argc=1, char * * argv=0x00348260)  Line 1831 + 0x25	C++
 	mozilla.exe!mainCRTStartup()  Line 398 + 0x11	C
 	kernel32.dll!_BaseProcessStart@4()  + 0x23	

i'm just trying to paste random text into the urlbar on windows... :)
I think that this problem is serious.
On input element, e.g., this page's "Status Whiteboard", we can paste multiple
lines and can submit too.

I can reporduced only the clipboard text begins \n.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Created attachment 178241 [details] [diff] [review]
Patch rv1.0(Normal)

I created basic patch. It fix this bug.
But I will propose advanced way soon.
Assignee: mozeditor → masayuki
Status: NEW → ASSIGNED
Created attachment 178242 [details] [diff] [review]
Patch rv1.0(Advanced)

This patch is advanced way.
It is using first non-empty line.
Attachment #178242 - Flags: review?(timeless)
Comment on attachment 178241 [details] [diff] [review]
Patch rv1.0(Normal)

timeless:

Choose better patch.
Attachment #178241 - Flags: review?(timeless)
(Assignee)

Updated

13 years ago
OS: Windows XP → All
Hardware: PC → All

Comment 5

13 years ago
This should be marked as a duplicate of bug #283813

https://bugzilla.mozilla.org/show_bug.cgi?id=283813

My bug report predates this one by seven days and they are basically the same thing.
(Reporter)

Comment 6

13 years ago
*** Bug 283813 has been marked as a duplicate of this bug. ***
(Assignee)

Updated

13 years ago
Target Milestone: --- → mozilla1.8beta2
(Assignee)

Updated

13 years ago
Flags: blocking1.8b2?
(Reporter)

Comment 7

13 years ago
Comment on attachment 178242 [details] [diff] [review]
Patch rv1.0(Advanced)

sorry for the delay, i like this style better, but i really don't like the
iterative Cut's. i was working on a counter patch yesterday but got distracted.
(Assignee)

Updated

13 years ago
Attachment #178241 - Attachment is obsolete: true
Attachment #178241 - Flags: review?(timeless)
(Assignee)

Updated

13 years ago
Attachment #178242 - Flags: review?(timeless)
Created attachment 178465 [details] [diff] [review]
Patch rv1.1
Attachment #178242 - Attachment is obsolete: true
Attachment #178465 - Flags: review?(timeless)
(Reporter)

Comment 9

13 years ago
Comment on attachment 178465 [details] [diff] [review]
Patch rv1.1

thanks :)
Attachment #178465 - Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #178465 - Flags: review?(timeless)
Attachment #178465 - Flags: review+

Comment 10

13 years ago
Comment on attachment 178465 [details] [diff] [review]
Patch rv1.1

>+
>+      // we get first *non-empty* line.
>+      PRInt32 offset = 0;
>+      while (firstCRLF == offset)
>+      {
>+        offset++;
>+        firstCRLF = tString.FindCharInSet(CRLF, offset);
>+      }
>+      if (offset > 0)
>+      {
>+        tString.Cut(0, offset);
>+        firstCRLF -= offset;
>+      }
>       if (firstCRLF > 0)
>         tString.Truncate(firstCRLF);
I'd prefer if you Truncated the string before Cutting it.
if (firstCRLF > 0)
  tString.Truncate(firstCRLF);
if (offset > 0)
  tString.Cut(0, offset);
sr=me with this change.
Attachment #178465 - Flags: superreview?(neil.parkwaycc.co.uk) → superreview+
checked-in.

-> fixed
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED

Updated

13 years ago
Flags: blocking1.8b2?
You need to log in before you can comment on or make changes to this bug.