can drag and drop into readonly input text field

VERIFIED FIXED in mozilla0.8

Status

()

Core
Layout: Form Controls
VERIFIED FIXED
17 years ago
17 years ago

People

(Reporter: TWISTI, Assigned: Kathleen Brade)

Tracking

Trunk
mozilla0.8
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: FIX IN HAND)

Attachments

(2 attachments)

(Reporter)

Description

17 years ago
select a text somewhere and drag it into a readonly input text field. if there
are any spaces in the field, the selected text is inserted as long as there is
space for it.

Comment 1

17 years ago
Created attachment 21048 [details]
Testcase - you can drag from address into read only input (but not w/in page)
Looks like text can be dragged from chrome or from other windows but not from
within the content area....  Setting status to new
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 3

17 years ago
I think this is an editor bug
Assignee: rods → beppe
the reason it rejects from the content area is the code in the content area that
rejects the drop if the src and dest documents are the same. if you let the
mouse drift outside of the window then back in before you dropped, it would
probably work (another bug, but demonstrates the problem).

Comment 5

17 years ago
Mike -- if the text area is read-only, then nothing should be allowed to be 
dropped into it, so the problem is that the external drag is permitted to be 
dropped into it -- but it shouldn't.
it is the logic in the text field that determines its read-onlyness. nothing
about the toolkit makes this policy.

Comment 7

17 years ago
assigning to brade, the easist way to repro this one kathy is to drag from the 
url bar -- it happens on linux, win98 and mac.
Assignee: beppe → brade
(Assignee)

Updated

17 years ago
Status: NEW → ASSIGNED
OS: Linux → All
Hardware: PC → All
Target Milestone: --- → mozilla0.8

Comment 8

17 years ago
Something in JS is calling nsBaseDragService::SetCanDrop() with a PR_TRUE after 
the editor has set it to false. My guess is the dragOver method in 
nsDragAndDrop.js.

Here's the stack trace where SetCanDrop() is called with a PR_TRUE, after the 
editor has already set it to PR_FALSE:

nsBaseDragService::SetCanDrop(nsBaseDragService * const 0x0363aa64, int 1) line 
75
XPTC_InvokeByIndex(nsISupports * 0x0363aa64, unsigned int 4, unsigned int 1, 
nsXPTCVariant * 0x0012bacc) line 139
nsXPCWrappedNativeClass::CallWrappedMethod(JSContext * 0x03672d00, 
nsXPCWrappedNative * 0x047654f0, const XPCNativeMemberDescriptor * 0x04763f04, 
nsXPCWrappedNativeClass::CallMode CALL_SETTER, unsigned int 1, long * 
0x0012c734, long * 0x00000000) line 920 + 42 bytes
nsXPCWrappedNativeClass::SetAttributeFromJSVal(JSContext * 0x03672d00, 
nsXPCWrappedNative * 0x047654f0, const XPCNativeMemberDescriptor * 0x04763f04, 
long * 0x0012c734) line 944
WrappedNative_SetProperty(JSContext * 0x03672d00, JSObject * 0x01234960, long 
47292800, long * 0x0012c734) line 365 + 24 bytes
js_Interpret(JSContext * 0x03672d00, long * 0x0012c8ec) line 2473 + 1897 bytes
js_Invoke(JSContext * 0x03672d00, unsigned int 1, unsigned int 2) line 801 + 13 
bytes
js_InternalInvoke(JSContext * 0x03672d00, JSObject * 0x00dc3a20, long 19091704, 
unsigned int 0, unsigned int 1, long * 0x0012ca84, long * 0x0012ca14) line 873 + 
20 bytes
JS_CallFunctionValue(JSContext * 0x03672d00, JSObject * 0x00dc3a20, long 
19091704, unsigned int 1, long * 0x0012ca84, long * 0x0012ca14) line 3268 + 31 
bytes
nsJSContext::CallEventHandler(nsJSContext * const 0x03674050, void * 0x00dc3a20, 
void * 0x012350f8, unsigned int 1, void * 0x0012ca84, int * 0x0012ca80, int 0) 
line 931 + 33 bytes
nsJSEventListener::HandleEvent(nsIDOMEvent * 0x04791574) line 154 + 64 bytes
nsEventListenerManager::HandleEventSubType(nsListenerStruct * 0x02e1e4f0, 
nsIDOMEvent * 0x04791574, nsIDOMEventTarget * 0x02e1e648, unsigned int 2, 
unsigned int 2) line 839 + 19 bytes
nsEventListenerManager::HandleEvent(nsIPresContext * 0x0574a090, nsEvent * 
0x0012e5a0, nsIDOMEvent * * 0x0012e100, nsIDOMEventTarget * 0x02e1e648, unsigned 
int 2, nsEventStatus * 0x0012e51c) line 1562 + 39 bytes
nsXULElement::HandleDOMEvent(nsXULElement * const 0x02e1e640, nsIPresContext * 
0x0574a090, nsEvent * 0x0012e5a0, nsIDOMEvent * * 0x0012e100, unsigned int 2, 
nsEventStatus * 0x0012e51c) line 3455
nsXULElement::HandleDOMEvent(nsXULElement * const 0x02e1e390, nsIPresContext * 
0x0574a090, nsEvent * 0x0012e5a0, nsIDOMEvent * * 0x0012e100, unsigned int 2, 
nsEventStatus * 0x0012e51c) line 3472 + 39 bytes
nsXULElement::HandleDOMEvent(nsXULElement * const 0x02e1e240, nsIPresContext * 
0x0574a090, nsEvent * 0x0012e5a0, nsIDOMEvent * * 0x0012e100, unsigned int 2, 
nsEventStatus * 0x0012e51c) line 3472 + 39 bytes
nsXULElement::HandleChromeEvent(nsXULElement * const 0x02e1e254, nsIPresContext 
* 0x0574a090, nsEvent * 0x0012e5a0, nsIDOMEvent * * 0x0012e100, unsigned int 2, 
nsEventStatus * 0x0012e51c) line 4377 + 39 bytes
GlobalWindowImpl::HandleDOMEvent(GlobalWindowImpl * const 0x0475be70, 
nsIPresContext * 0x0574a090, nsEvent * 0x0012e5a0, nsIDOMEvent * * 0x0012e100, 
unsigned int 2, nsEventStatus * 0x0012e51c) line 584
nsDocument::HandleDOMEvent(nsDocument * const 0x0572e7a0, nsIPresContext * 
0x0574a090, nsEvent * 0x0012e5a0, nsIDOMEvent * * 0x0012e100, unsigned int 2, 
nsEventStatus * 0x0012e51c) line 3108
nsGenericElement::HandleDOMEvent(nsGenericElement * const 0x05731040, 
nsIPresContext * 0x0574a090, nsEvent * 0x0012e5a0, nsIDOMEvent * * 0x0012e100, 
unsigned int 2, nsEventStatus * 0x0012e51c) line 1452 + 39 bytes
nsGenericElement::HandleDOMEvent(nsGenericElement * const 0x057c65d0, 
nsIPresContext * 0x0574a090, nsEvent * 0x0012e5a0, nsIDOMEvent * * 0x0012e100, 
unsigned int 2, nsEventStatus * 0x0012e51c) line 1445 + 39 bytes
nsGenericElement::HandleDOMEvent(nsGenericElement * const 0x0580b680, 
nsIPresContext * 0x0574a090, nsEvent * 0x0012e5a0, nsIDOMEvent * * 0x0012e100, 
unsigned int 2, nsEventStatus * 0x0012e51c) line 1445 + 39 bytes
nsHTMLFormElement::HandleDOMEvent(nsHTMLFormElement * const 0x0580b680, 
nsIPresContext * 0x0574a090, nsEvent * 0x0012e5a0, nsIDOMEvent * * 0x0012e100, 
unsigned int 2, nsEventStatus * 0x0012e51c) line 412 + 29 bytes
nsGenericElement::HandleDOMEvent(nsGenericElement * const 0x0580b270, 
nsIPresContext * 0x0574a090, nsEvent * 0x0012e5a0, nsIDOMEvent * * 0x0012e100, 
unsigned int 1, nsEventStatus * 0x0012e51c) line 1445 + 39 bytes
nsHTMLInputElement::HandleDOMEvent(nsHTMLInputElement * const 0x0580b270, 
nsIPresContext * 0x0574a090, nsEvent * 0x0012e5a0, nsIDOMEvent * * 0x00000000, 
unsigned int 1, nsEventStatus * 0x0012e51c) line 1021 + 29 bytes
PresShell::HandleEventInternal(nsEvent * 0x0012e5a0, nsIView * 0x05803f20, 
unsigned int 1, nsEventStatus * 0x0012e51c) line 4921 + 41 bytes
PresShell::HandleEvent(PresShell * const 0x057bf5b4, nsIView * 0x05803f20, 
nsGUIEvent * 0x0012e5a0, nsEventStatus * 0x0012e51c, int 0, int & 1) line 4850 + 
25 bytes
nsView::HandleEvent(nsView * const 0x05803f20, nsGUIEvent * 0x0012e5a0, unsigned 
int 8, nsEventStatus * 0x0012e51c, int 0, int & 1) line 379
nsView::HandleEvent(nsView * const 0x05802670, nsGUIEvent * 0x0012e5a0, unsigned 
int 8, nsEventStatus * 0x0012e51c, int 0, int & 1) line 352
nsView::HandleEvent(nsView * const 0x057bcf80, nsGUIEvent * 0x0012e5a0, unsigned 
int 28, nsEventStatus * 0x0012e51c, int 1, int & 1) line 352
nsViewManager2::DispatchEvent(nsViewManager2 * const 0x057b9310, nsGUIEvent * 
0x0012e5a0, nsEventStatus * 0x0012e51c) line 1537
HandleEvent(nsGUIEvent * 0x0012e5a0) line 68
nsWindow::DispatchEvent(nsWindow * const 0x05802534, nsGUIEvent * 0x0012e5a0, 
nsEventStatus & nsEventStatus_eIgnore) line 687 + 10 bytes
nsNativeDragTarget::DispatchDragDropEvent(unsigned int 1401, _POINTL {...}) line 
184
nsNativeDragTarget::ProcessDrag(IDataObject * 0x00000000, unsigned int 1401, 
unsigned long 1, _POINTL {...}, unsigned long * 0x0012e794) line 209
nsNativeDragTarget::DragOver(nsNativeDragTarget * const 0x05802490, unsigned 
long 1, _POINTL {...}, unsigned long * 0x0012e794) line 263
OLE32! 77ba90ab()
OLE32! 77ba9265()
OLE32! 77b8fac6()
OLE32! 77b8f60a()
nsDragService::StartInvokingDragSession(nsDragService * const 0x0363aa60, 
IDataObject * 0x05738440, unsigned int 3) line 144 + 25 bytes
nsDragService::InvokeDragSession(nsDragService * const 0x0363aa60, nsIDOMNode * 
0x04f2a6a0, nsISupportsArray * 0x0573ea90, nsIScriptableRegion * 0x00000000, 
unsigned int 3) line 113
nsHTMLEditor::DoDrag(nsHTMLEditor * const 0x04f67c8c, nsIDOMEvent * 0x0573eb74) 
line 5733 + 59 bytes
nsTextEditorDragListener::DragGesture(nsIDOMEvent * 0x0573eb74) line 622 + 27 
bytes
nsEventListenerManager::HandleEvent(nsIPresContext * 0x0369fb90, nsEvent * 
0x0012f230, nsIDOMEvent * * 0x0012f1b4, nsIDOMEventTarget * 0x04f326f4, unsigned 
int 2, nsEventStatus * 0x0012f274) line 1525 + 40 bytes
nsGenericElement::HandleDOMEvent(nsGenericElement * const 0x04f2a670, 
nsIPresContext * 0x0369fb90, nsEvent * 0x0012f230, nsIDOMEvent * * 0x0012f1b4, 
unsigned int 2, nsEventStatus * 0x0012f274) line 1426
nsHTMLInputElement::HandleDOMEvent(nsHTMLInputElement * const 0x04f2a670, 
nsIPresContext * 0x0369fb90, nsEvent * 0x0012f230, nsIDOMEvent * * 0x0012f1b4, 
unsigned int 2, nsEventStatus * 0x0012f274) line 1021 + 29 bytes
nsGenericElement::HandleDOMEvent(nsGenericElement * const 0x04f66170, 
nsIPresContext * 0x0369fb90, nsEvent * 0x0012f230, nsIDOMEvent * * 0x0012f1b4, 
unsigned int 2, nsEventStatus * 0x0012f274) line 1445 + 39 bytes
nsGenericDOMDataNode::HandleDOMEvent(nsIPresContext * 0x0369fb90, nsEvent * 
0x0012f230, nsIDOMEvent * * 0x0012f1b4, unsigned int 1, nsEventStatus * 
0x0012f274) line 691 + 39 bytes
nsTextNode::HandleDOMEvent(nsTextNode * const 0x05745638, nsIPresContext * 
0x0369fb90, nsEvent * 0x0012f230, nsIDOMEvent * * 0x00000000, unsigned int 1, 
nsEventStatus * 0x0012f274) line 252
nsEventStateManager::GenerateDragGesture(nsIPresContext * 0x0369fb90, nsGUIEvent 
* 0x0012f894) line 747
nsEventStateManager::PreHandleEvent(nsEventStateManager * const 0x047305f8, 
nsIPresContext * 0x0369fb90, nsEvent * 0x0012f894, nsIFrame * 0x00d685b4, 
nsEventStatus * 0x0012f788, nsIView * 0x04f6dc70) line 302
PresShell::HandleEventInternal(nsEvent * 0x0012f894, nsIView * 0x04f6dc70, 
unsigned int 1, nsEventStatus * 0x0012f788) line 4909 + 43 bytes
PresShell::HandleEvent(PresShell * const 0x036cdd64, nsIView * 0x04f6dc70, 
nsGUIEvent * 0x0012f894, nsEventStatus * 0x0012f788, int 1, int & 1) line 4850 + 
25 bytes
nsView::HandleEvent(nsView * const 0x04f6dc70, nsGUIEvent * 0x0012f894, unsigned 
int 28, nsEventStatus * 0x0012f788, int 1, int & 1) line 379
nsViewManager2::DispatchEvent(nsViewManager2 * const 0x0369ded0, nsGUIEvent * 
0x0012f894, nsEventStatus * 0x0012f788) line 1537
HandleEvent(nsGUIEvent * 0x0012f894) line 68
nsWindow::DispatchEvent(nsWindow * const 0x0369fe44, nsGUIEvent * 0x0012f894, 
nsEventStatus & nsEventStatus_eIgnore) line 687 + 10 bytes
nsWindow::DispatchWindowEvent(nsGUIEvent * 0x0012f894) line 708
nsWindow::DispatchMouseEvent(unsigned int 300, nsPoint * 0x00000000) line 3948 + 
21 bytes
ChildWindow::DispatchMouseEvent(unsigned int 300, nsPoint * 0x00000000) line 
4158
nsWindow::ProcessMessage(unsigned int 512, unsigned int 1, long 3342678, long * 
0x0012fc48) line 2942 + 24 bytes
nsWindow::WindowProc(HWND__ * 0x00460430, unsigned int 512, unsigned int 1, long 
3342678) line 922 + 27 bytes
USER32! 77e7124c()
JS3250! 00330156()

Comment 9

17 years ago
Adding myself to Cc list.
(Assignee)

Comment 10

17 years ago
Created attachment 23163 [details] [diff] [review]
patch to prevent event propagation
when you determine you can't drop, you don't want to let the event bubble.
brade's patch is the right thing.

Comment 12

17 years ago
update whiteboard
Whiteboard: FIX IN HAND

Comment 13

17 years ago
this will not be landing today, moving to mozilla0.9
Target Milestone: mozilla0.8 → mozilla0.9
(Assignee)

Comment 14

17 years ago
fix is in
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
Target Milestone: mozilla0.9 → mozilla0.8

Comment 15

17 years ago
Verified on build 20010724&20010730 os:win98/mac8.6/linux7
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.