Closed Bug 235522 Opened 21 years ago Closed 21 years ago

Here, Focus is coming at more than one places at a time

Categories

(SeaMonkey :: General, defect)

x86
Windows XP
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: nesharma, Assigned: bryner)

Details

Attachments

(3 files, 1 obsolete file)

User-Agent: Build Identifier: In this bug, Focus is not coming at appropriate place. Reproducible: Always Steps to Reproduce: 1. Load the page win1.htm into the browser, ensure that the browser does not occupy the whole screen. 2. Click in the textfield, click outside the browser window, then click onto the combo box. Both will now appear to have focus. 3.Now press the tab key until the window has focus, then click outside browser window, click on the textarea, click outside the browser window and then click on the combo box. The window, textarea and combo box will all now appear to have focus. 4. Reload the page win1.htm into the browser 5. clicking on the combo box and then clicking on the textarea, it will take two mouse clicks to actually set the focus in the text area
I have checked this problem in open source mozilla 1.1, 1.2, 1.3 and 1.4 on os2. Problem is occuring everywhere. It is occuring partially in mozilla 1.5 and 1.6 on os2 and windows. Regards, Neelesh Mozilla Support, IBM India
Attached file Testcase
mkaply, can you reproduce this? I can't seem to on Linux, but the focus model is very different....
I can't reproduce this. When I click on the combobox, it pops down (on Windows and OS/2) It sounds like the version you are using is missing my final fix in nsFrameWindow.cpp. http://lxr.mozilla.org/seamonkey/source/widget/src/os2/nsFrameWindow.cpp#435
ok, this is what I see: -- As late as mozilla 1.4 if you have the cursor flashing in the textfield, click outside the frame, then click on the combobox, the cursor will still flash on the textfield, yet the combobox will still be hashed. -- Starting on mozilla 1.5, this behavior doesn't occur anymore. -- If you tab around the page win1.htm until the client area of the fame has a hashed border, no amount of clicking on the widgets inside the page or switching focus to the desktop and then back to a widget in the page will cause the client area to lose its hashed border. This is recreatable on RedHat 9, Windows 2000 and OS/2. -- Mike Kaply and I have confirmed that the fix to nsFrameWindow.cpp that he mentioned is indeed in Mozilla 1.4 for OS/2. So I think that this bug should now be centered around getting the proper behavior across all platforms for the hashing and unhashing of the client area.
Attached patch patch (obsolete) — Splinter Review
Here's one way we could fix this. Right now, the tabbing code takes care of removing the canvas focus ring when you tab from the document into the content. This wasn't getting hit when you click instead of tab. This patch pulls the check into SetContentState, which is hit for all focus transitions. This probably needs a little more testing to cover all of the cases where the canvas focus ring should be removed. That includes these basic tests: - using f6 or ctrl+tab to switch between frameset frames - tabbing into/out of iframes - using ctrl+L to focus the URL bar (document focus ring should go away) and for more fun: - script focusing a control on a timer, with no keyboard or mouse event involved - focusing a control which doesn't accept focus (document focus ring should remain) - focusing a control which focuses something else in its focus handler Also, just so that it's not counted as a bug... the fact that the document focus ring does not appear when you _click_ in the page is intentional. We felt that since the focus ring is mainly wanted for keyboard navigation/accessibility, there's no point in showing it for click-focus and uglifying sites where a frameset with no borders is used to achieve the layout.
Assignee: general → bryner
Status: UNCONFIRMED → ASSIGNED
The previous patch crashed when displaying the profile manager. This fixes that by null-checking mDocument. I tested all of the scenarios I mentioned before and found no problems. I tested the frameset on http://msdn.microsoft.com/library/ and the iframe on http://tinderbox.mozilla.org/showbuilds.cgi?tree=SeaMonkey. I'll attach a testcase I used for the trickier tests.
Attachment #142778 - Attachment is obsolete: true
Attached file additional testcases
Attachment #142872 - Flags: superreview?(darin)
Attachment #142872 - Flags: review?(danm-moz)
Comment on attachment 142872 [details] [diff] [review] patch with null check >+ nsCOMPtr<nsIDocShell> docShell = >+ do_QueryInterface(nsCOMPtr<nsISupports>(mDocument->GetContainer())); it's too bad there isn't a way to avoid QI'ing twice here (once for the QueryReferent and once for the explicit QI). QueryReferent does take an IID, so maybe we should write a version of GetContainer that takes an IID (or uses template magic)? that's just a quick comment... i haven't really reviewed the patch yet ;)
Comment on attachment 142872 [details] [diff] [review] patch with null check >+ nsCOMPtr<nsIDocShell> docShell = >+ do_QueryInterface(nsCOMPtr<nsISupports>(mDocument->GetContainer())); >+ Mmmmmmm, refelicious. aghhhhhhhghghghgghhh Code looks fine and I noticed no regressions when I took it out for a spin. But there was this funky bit: >+ nsCOMPtr<nsIContent> oldFocus = mCurrentFocus; >+ oldFocus isn't referenced again before it goes out of scope. Is it a kungFuDeathGrip? It doesn't seem to be. I say ditch it or rename it. PS ditto comment 4: I can't reproduce the original testcase on my WinXP box, patched or not. (The second testcase is problematic without the patch.)
Attachment #142872 - Flags: review?(danm-moz) → review+
(In reply to comment #10) > there was this funky bit: > > >+ nsCOMPtr<nsIContent> oldFocus = mCurrentFocus; > >+ > > oldFocus isn't referenced again before it goes out of scope. Is it a > kungFuDeathGrip? It doesn't seem to be. I say ditch it or rename it. Yep, I changed my mind about how to do this and forgot to remove that part. Will do that before checking in. > PS ditto comment 4: I can't reproduce the original testcase on my WinXP box, > patched or not. (The second testcase is problematic without the patch.) > Same.
Comment on attachment 142872 [details] [diff] [review] patch with null check sr=darin
Attachment #142872 - Flags: superreview?(darin) → superreview+
checked in.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
I have ported this patch over IWB2.03la, which is nothing but mozilla 1.6, on os2. Problem related to 5th step in recreation scenario can be still seen. I found the same result with mozilla 1.7b on windows XP.
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: