Closed Bug 289022 Opened 20 years ago Closed 20 years ago

Clicking to focus text inputs and textareas sometimes doesn't allow text entry.

Categories

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

PowerPC
macOS
defect

Tracking

()

VERIFIED FIXED
mozilla1.8beta2

People

(Reporter: moz, Assigned: sfraser_bugs)

References

Details

(Keywords: regression)

Attachments

(2 files, 1 obsolete file)

In today's Camino build, when I click on a text input or textarea and attempt to type, it instead starts find-as-you-type (I've set it to not require the initial "/" in my user.js). It seems to happen most often when I double-click to select a word, or click in the input/textarea again after typing. Build ID: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b2) Gecko/20050404 Camino/0.8+
Hmm, this might be Camino-only; I can't reproduce with the latest Firefox nightly.
Sounds like a focus issue, which would be Aaron
Some additional info: It seems to happen on even clicks. Click once, typing is fine. Click again, typing breaks. Click again, typing is fine again. And on and on...
Find-as-you-type prefs are not involed here. I can reproduce the problem in a vanilla build. To repro: 1. click in a textarea, and start typing. everything is fine. 2. click again in the same textarea. Now the caret disappears and you can't type.
Assignee: roc → aaronleventhal
I have not made any focus related checkins in this regression window. Most likely suspect I see in the regression window is Ginn Chen's checkin for bug 260399 "disabled textarea/input should use DEFAULT pointer r+sr=bzbarsky" 2005-04-04 03:35 ginn.chen%sun.com mozilla/ content/ events/ src/ nsEventStateManager.h 1.130 0/1 Bug 260399 disabled textarea/input should use DEFAULT pointer r+sr=bzbarsky 2005-04-04 03:35 ginn.chen%sun.com mozilla/ content/ events/ src/ nsEventStateManager.cpp 1.561 6/34 2005-04-04 03:35 ginn.chen%sun.com mozilla/ layout/ forms/ resources/ content/ xbl-forms.css 1.27 2/2 2005-04-04 03:35 ginn.chen%sun.com mozilla/ layout/ style/ forms.css 3.101 4/2
Assignee: aaronleventhal → ginn.chen
This might be related roc's changes. When you click in the window, cocoa automatically sets the focussed NSView to the clicked view (which, for a blank page, is the scroll port view's widget). We then kick off Gecko focus logic, which changes the focus to the document view. On every click, we do this swapping of the focussed widget.
I see us hitting a code path in PresShell::HandleEvent() that seems wrong. For a textarea, the keypress comes in via the nsScrollPortView's widget. We hit PresShell::HandleEvent(), which does: nsIFrame* frame = NS_STATIC_CAST(nsIFrame*, aView->GetClientData()); the scroll port view has no frame (is that new?), so we drop into the RetargetEventToParent() code near the bottom of that method. That then sets focus to the DocumentViewer's widget, thus breaking typing.
Assignee: ginn.chen → roc
(In reply to comment #8) > I see us hitting a code path in PresShell::HandleEvent() that seems wrong. For > a textarea, the keypress comes in via the nsScrollPortView's widget. OK > We hit PresShell::HandleEvent(), which does: > > nsIFrame* frame = NS_STATIC_CAST(nsIFrame*, aView->GetClientData()); > > the scroll port view has no frame (is that new?) Yes indeed. > so we drop into the RetargetEventToParent() code near the bottom of that > method. That then sets focus to the DocumentViewer's widget, thus breaking > typing. I guess the easiest fix is to hack the viewmanager so that it retargets such events. Around here: http://lxr.mozilla.org/mozilla/source/view/src/nsViewManager.cpp#2459 if aView->GetClientData() is null, we should scan upwards through parents looking for a view with client data and use that instead.
Attachment #179663 - Flags: superreview?(roc)
Attachment #179663 - Flags: review?(dbaron)
Comment on attachment 179663 [details] [diff] [review] Retarget events on frameless views to parent with frame. It seems like this code should be in the pres shell, not the view manager. Views shouldn't treat the nsIViewObserver API differently depending on the opaque "client data" pointer. Also, should there be a coordinate transformation here? Does this depend on the extra views being at (0,0)? (Are they?)
Yeah, this would be better in the PresShell. These are key events so the coordinates are meaningless.
Keywords: regression
Comment on attachment 179663 [details] [diff] [review] Retarget events on frameless views to parent with frame. Sounds like you don't want this patch.
Attachment #179663 - Attachment is obsolete: true
Attachment #179663 - Flags: superreview?(roc)
Attachment #179663 - Flags: review?(dbaron)
Blocks: 289179
We need this fixed before the tree closes for alpha. It makes Camino almost unusable with forms.
Priority: -- → P2
Target Milestone: --- → mozilla1.8beta2
This patch has a couple of XXX comments in it. When retargeting events to parent views: Do we need to fix up coords for IME events? Is it ok to change |aView| for the rest of the method.
(In reply to comment #15) > This patch has a couple of XXX comments in it. When retargeting events to > parent views: > Do we need to fix up coords for IME events? Might as well, it's easy. Just do aEvent->point += aView->GetOffsetTo(targetView); aView = targetView; > Is it ok to change |aView| for the rest of the method. I think so.
Attachment #179923 - Flags: superreview?(dbaron)
Attachment #179923 - Flags: review?(roc)
Changing the wording of the subject a bit to include the word "focus", which seems to be the most common word used when looking for this (silly me).
Summary: Clicking in text inputs and textareas sometimes doesn't enter text. → Clicking to focus text inputs and textareas sometimes doesn't allow text entry.
*** Bug 289601 has been marked as a duplicate of this bug. ***
*** Bug 289832 has been marked as a duplicate of this bug. ***
Request blocking status. This bug makes camino unusable.
Flags: blocking1.8b2?
Flags: blocking1.8b2? → blocking1.8b2+
Attachment #179923 - Flags: superreview?(dbaron) → superreview+
Mine.
Assignee: roc → sfraser_bugs
Checked in to trunk.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Verified.
Status: RESOLVED → VERIFIED
*** Bug 290559 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: