Closed
Bug 122311
Opened 23 years ago
Closed 13 years ago
After onfocus event is finished, textarea has no focus.
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P3)
Core
DOM: UI Events & Focus Handling
Tracking
()
RESOLVED
WORKSFORME
Future
People
(Reporter: jay.yan, Unassigned)
References
()
Details
Attachments
(1 file)
2.35 KB,
text/plain
|
Details |
On Windows version 1 open a mozilla browser 2 load http://mozilla.org/quality/browser/standards/html/textarea_onfocus.html 3 click the url address and make sure textarea has no focus 4 click textarea, an alert dialog appears 5 click ok, caret is on textarea 6 press keyboard to input some characters, nothing happens to textarea Expected results: The input characters should appear in textarea, because TextArea is assumed to have got focus.
this bug should be fixed prior to bug 50092, and 50092 is *nix specificed, but this bug happens on all the platforms The reason of this bug is that becasue after aContent->HandleDomEvent is finisned, the nsEventStateManager->mCurrentFocus becames null, following code will not be executed: nsIFrame * currentFocusFrame = nsnull; if (mCurrentFocus) presShell->GetPrimaryFrameFor(mCurrentFocus, ¤tFocusFrame); if (!currentFocusFrame) currentFocusFrame = mCurrentTarget; // Find the window that this frame is in and // make sure it has focus if (currentFocusFrame) { nsIFrame * parentFrame; currentFocusFrame->GetParentWithView(aPresContext, &parentFrame); if (nsnull != parentFrame) { nsIView * pView; parentFrame->GetView(aPresContext, &pView); if (nsnull != pView) { nsIWidget *window = nsnull; nsIView *ancestor = pView; while (nsnull != ancestor) { ancestor->GetWidget(window); // addrefs if (nsnull != window) { window->SetFocus(); NS_RELEASE(window); // releases. Duh. break; } ancestor->GetParent(ancestor); } } } } the patch moves above code ahead of aContent->HandleDOMEvent, it works. I will attach patch for bug 50092 later.
Comment 2•23 years ago
|
||
Confirming issue.
Assignee: attinasi → rods
Status: UNCONFIRMED → NEW
Component: Layout → HTML Form Controls
Ever confirmed: true
QA Contact: petersen → madhur
Comment 3•23 years ago
|
||
On the OS X build (2002-01-31-08), I not only lose focus in either textarea/input field but url field nolonger gets focus.
Comment 5•23 years ago
|
||
Hm... I'd say a safer fix might be to obtain currentFocusFrame prior to dispatching the DOM event, but leave the nsIWidget SetFocus() where it is now. That would have less of a chance of regressing something, I think.
Updated•23 years ago
|
Target Milestone: --- → mozilla1.0.1
Updated•23 years ago
|
QA Contact: madhur → tpreston
Comment 6•22 years ago
|
||
A test suite has been created to track bug 58441, bug 134293, bug 105129, bug 131843, bug 50221, bug 134321, bug 122311, and bug 112294: http://bugzilla.mozilla.org/attachment.cgi?id=100778&action=view People who have reported problems in the bugs mentioned please perform all the test in this suite. All bugs will be resolved as duplicate of the appropriate bug unless someone can reproduce a problem with onblur/onfocus style change (no alert involved)
Updated•21 years ago
|
Assignee: kinmoz → events
Component: Layout: Form Controls → Event Handling
QA Contact: tpreston → ian
Updated•15 years ago
|
Assignee: events → nobody
QA Contact: ian → events
Comment 7•13 years ago
|
||
wfm with Mozilla/5.0 (Windows NT 6.1; rv:13.0a1) Gecko/20120214 Firefox/13.0a1 SeaMonkey/2.10a1 The textarea has focus after dismissing the alert and i can type.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
Assignee | ||
Updated•5 years ago
|
Component: Event Handling → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•