Crash Trying to Rename PT items

VERIFIED DUPLICATE of bug 76715

Status

VERIFIED DUPLICATE of bug 76715
18 years ago
14 years ago

People

(Reporter: kerz, Assigned: bugs)

Tracking

Trunk
mozilla0.9.1
x86
Windows 2000

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: important for 0.9)

Attachments

(1 attachment)

(Reporter)

Description

18 years ago
repro:
make sure you have items on your personal toolbar first.

.rename an item using the context menu
.continue renaming until it stops working
.bring another window into focus
.go back to original window
.crash

tb id is tb29299719m
"Until it stops working" is the important note ;)

It shouldn't stop working. Here's why it does: Focus shifts from one of the 
valid focusable elements (the edit field, the urlbar, etc) into something else, 
or maybe into nothing. As a result the controllers array seems to "change." 
There is one controller in it, the editor controller. 

I wouldn't be surprised if there is something very wrong here, and that this is 
leading to the crash. 

I saw this yesterday, but can't seem to reproduce it anymore. Trying harder 
now...
Created attachment 31422 [details] [diff] [review]
patch that fixes crash
OK, so here's what seems to be happening:

the il field seems to still have focus (somehow, some way) when the window 
deactivates. Whatever mechanism notes down which element is focused so that this 
can be restored when the window is reactivated records this. However the blur 
handler in the binding for the il toolbar buttons tears the field out of the 
document. 

The window is reactivated, the NS_ACTIVATE case in 
nsEventStateManager::PreHandleEvent gets the focused content and tries to call 
SetFocus on it (which ends up in nsHTMLInputElement::SetFocus). Unfortunately 
mDocument of that is null, and boom. So I added a check that a document exists 
for the focused content before trying to set focus. 

Copying chris & dave for r/sr=
Status: NEW → ASSIGNED
updated the patch in my tree to call the nsIDocument COMPtr 'contentDoc' rather 
than 'elementDoc'
Keywords: approval, patch, review
Target Milestone: --- → mozilla0.9.1

Updated

18 years ago
Whiteboard: important for 0.9

Comment 5

18 years ago
This bug should be duped on a fix waterson already made and is going to check 
in today.

Comment 6

18 years ago
did you mean bug 76715? (which waterson punted back to hyatt, by the way).

Comment 7

18 years ago
Or perhaps bug 68451?
sure.

the setAttribute bug is different, I think. 

*** This bug has been marked as a duplicate of 76715 ***
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → DUPLICATE

Comment 9

18 years ago
VERIFIED Dupe
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.