Closed
Bug 305840
Opened 19 years ago
Closed 19 years ago
Focus doesn't move to FindToolBar. (Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLInputElement.select]"
Categories
(Toolkit :: Find Toolbar, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: sugar.waffle, Assigned: MatsPalmgren_bugz)
References
Details
(Keywords: regression, testcase)
Attachments
(5 files, 8 obsolete files)
983 bytes,
application/vnd.mozilla.xul+xml
|
Details | |
5.18 KB,
patch
|
aaronlev
:
review+
bryner
:
superreview+
|
Details | Diff | Splinter Review |
512 bytes,
application/vnd.mozilla.xul+xml
|
Details | |
2.02 KB,
application/vnd.mozilla.xul+xml
|
Details | |
4.38 KB,
patch
|
aaronlev
:
review+
bryner
:
superreview+
|
Details | Diff | Splinter Review |
When hit Ctrl+f or "/"(FAYT mode), focus doesn't move to FindToolBar.
And the following errors are output to JavaScript Console.
Reproducible: Always
Error: uncaught exception: [Exception... "Component returned failure code:
0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLInputElement.select]" nsresult:
"0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::
chrome://global/content/bindings/textbox.xml :: select :: line 69" data: no]
Mozilla/5.0 (Windows; U; Windows NT 5.1; ja-JP; rv:1.9a1) Gecko/20050824
Firefox/1.6a1
Comment 1•19 years ago
|
||
Maybe, regression of Bug 303620.
Severity: normal → major
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 2•19 years ago
|
||
> ************************************************************
> * Call to xpconnect wrapped JSObject produced this error: *
> [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)
[nsIDOMHTMLInputElement.select]" nsresult: "0x80004005 (NS_ERROR_FAILURE)"
location: "JS frame :: chrome://global/content/bindings/textbox.xml :: select ::
line 69" data: no]
> ************************************************************
Debug build's message.
Keywords: regression
Comment 3•19 years ago
|
||
*** Bug 305894 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 4•19 years ago
|
||
It's a regression from bug 303620. Patch coming up...
Updated•19 years ago
|
Assignee: mats.palmgren → nobody
Flags: blocking1.8b4? → blocking1.8b4+
Updated•19 years ago
|
Assignee: nobody → mats.palmgren
Assignee | ||
Comment 5•19 years ago
|
||
We should return early but not fail in case the focus was moved elsewhere.
The extra focus checks we added in ESM fails for the Find toolbar -
we have either a null frame (in case it was hidden) or a
non-focusable <textbox> if it was visible.
So, we need to add an explicit 'tabindex' attribute to make it
"IsFocusable" and also to flush frames to fix the null frame issue.
Attachment #193851 -
Flags: superreview?(bryner)
Attachment #193851 -
Flags: review?(aaronleventhal)
Updated•19 years ago
|
Attachment #193851 -
Flags: superreview?(bryner) → superreview+
Assignee | ||
Comment 6•19 years ago
|
||
Hmm, now that I think about, shouldn't a <textbox> be "IsFocusable" by default?
Is this also what causes bug 305913 and potentially many others?
Blocks: 305913
Flags: blocking1.8b4rc?
Assignee | ||
Comment 7•19 years ago
|
||
Yep, this fixes bug 305913:
textbox {
-moz-binding: url("chrome://global/content/bindings/textbox.xml#textbox");
-moz-user-select: text;
+ -moz-user-focus: normal;
}
Maybe we should go for that solution instead of having to add "tabindex"
all over?
Assignee | ||
Comment 8•19 years ago
|
||
I prefer this version. It also fixes the about:config and GTK1 file picker
issues mentioned in bug 305913.
Attachment #193851 -
Attachment is obsolete: true
Attachment #193870 -
Flags: superreview?(bryner)
Attachment #193870 -
Flags: review?(aaronleventhal)
Assignee | ||
Updated•19 years ago
|
Attachment #193851 -
Flags: review?(aaronleventhal)
Assignee | ||
Comment 9•19 years ago
|
||
Updated•19 years ago
|
Attachment #193870 -
Flags: superreview?(bryner) → superreview+
Assignee | ||
Comment 10•19 years ago
|
||
"Patch rev. 2" also fixes the URL bar problem, bug 305872
Comment 11•19 years ago
|
||
textbox {
-moz-binding: url("chrome://global/content/bindings/textbox.xml#textbox");
-moz-user-select: text;
+ -moz-user-focus: normal;
}
This change prevents the address bar dropdown history from opening
Assignee | ||
Comment 12•19 years ago
|
||
(In reply to comment #11)
> textbox {
> -moz-binding: url("chrome://global/content/bindings/textbox.xml#textbox");
> -moz-user-select: text;
> + -moz-user-focus: normal;
> }
>
> This change prevents the address bar dropdown history from opening
Thanks for testing the patch and finding this!
It seems the event handling in this file needs tweaking:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/toolkit/content/widgets/autocomplete.xml&root=/cvsroot
I can't say I really understand how that code works though...
Assignee | ||
Comment 13•19 years ago
|
||
Timo, could you apply this additional patch and see if it fixes it?
(it seems to work for me)
Assignee | ||
Comment 14•19 years ago
|
||
Comment on attachment 193887 [details] [diff] [review]
Additional tweak
Nevermind, it does not popup the autocompletion menu unless
you have opened it manually once...
Suggestions are welcome if someone knows this code.
Attachment #193887 -
Attachment is obsolete: true
Assignee | ||
Comment 15•19 years ago
|
||
Ok, this seems to work. I'm not sure exactly why, I'm guessing the popup now
occurs later and that there is some focus handler somehwhere that
does stuff the takes down the menu... please test it if you can, thanks.
Updated•19 years ago
|
Attachment #193870 -
Flags: review?(aaronleventhal) → review+
Comment 16•19 years ago
|
||
Comment on attachment 193898 [details] [diff] [review]
Additional tweak, rev. 2
Mats, is this part of the patch necessary -- did you want to seek review for
it?
Attachment #193898 -
Flags: review?(mconnor)
Comment 17•19 years ago
|
||
Comment on attachment 193870 [details] [diff] [review]
Patch rev. 2
> + -moz-user-focus: normal
I think doing this might mess up tab order somehow, because a XUL textbox
already has a focusable anonymous HTML input child.
Instead, let's fix the IsFocusable() check from SendFocusBlur(). Or, for now
just change it to a visibility check. That's still better than what it was,
which was just a check to see if the frame still existed.
Attachment #193870 -
Flags: review+
Assignee | ||
Updated•19 years ago
|
Attachment #193898 -
Attachment is obsolete: true
Attachment #193898 -
Flags: review?(mconnor)
Assignee | ||
Comment 18•19 years ago
|
||
(In reply to comment #17)
> (From update of attachment 193870 [details] [diff] [review] [edit])
> > + -moz-user-focus: normal
> I think doing this might mess up tab order somehow, because a XUL textbox
> already has a focusable anonymous HTML input child.
Yes, you're right, this breaks SHIFT-TAB over <textboxes> because we
get stuck on the outer textbox frame. I guess this means that the
-moz-user-focus property and the tabindex attribute is basically
unusable for a XUL textbox? (let's deal with that elsewhere though)
> Instead, let's fix the IsFocusable() check from SendFocusBlur(). Or, for now
> just change it to a visibility check. That's still better than what it was,
> which was just a check to see if the frame still existed.
>
Agreed, I added a "visible && !disabled" check instead in the upcoming patch...
Assignee | ||
Comment 19•19 years ago
|
||
Attachment #193870 -
Attachment is obsolete: true
Attachment #193917 -
Flags: superreview?(bryner)
Attachment #193917 -
Flags: review?(aaronleventhal)
Comment 20•19 years ago
|
||
(In reply to comment #19)
> Created an attachment (id=193917) [edit]
> Patch rev. 3
>
I wonder if any other tags end up creating a XUL textbox. It might be better to
attempt a QI to nsIDOMXULTextboxElement, and then GetInputField() and then
GetPrimaryFrameFor to get the focusFrame for that, then continue with the normal
checking.
However, for branch we could just simplify this code completely and just check
for visibility only on everything, including area and textbox. The same check
for everything.
What's your thought?
Assignee | ||
Comment 21•19 years ago
|
||
Yes, that's even better.
I kind of like the fact that we don't execute onfocus for stuff that isn't
focusable. Checking only for visibility wouldn't catch disabled textboxes
for example.
This patch isn't necessary for the branch unless we also check in bug 303620
on the branch? I don't know how much time there is to shake out regressions
before 1.8 but IMO we should go for it (both bug 303620 and this).
Attachment #193917 -
Attachment is obsolete: true
Attachment #193929 -
Flags: superreview?(bryner)
Attachment #193929 -
Flags: review?(aaronleventhal)
Assignee | ||
Updated•19 years ago
|
Attachment #193917 -
Flags: superreview?(bryner)
Attachment #193917 -
Flags: review?(aaronleventhal)
Updated•19 years ago
|
Attachment #193929 -
Flags: superreview?(bryner) → superreview+
Updated•19 years ago
|
Attachment #193929 -
Flags: review?(aaronleventhal) → review+
*** Bug 306064 has been marked as a duplicate of this bug. ***
Comment 23•19 years ago
|
||
Fixed on trunk.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment 24•19 years ago
|
||
This doesn't fix editable menulists. Test case forthcoming.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 25•19 years ago
|
||
the thunderbird compose window addressing widget is still broken, even with this
patch, as near as I can tell. Have you tried that?
Comment 26•19 years ago
|
||
On old builds both Alt+T and Alt+M work.
On recent builds neither Alt+T or Alt+M work.
On new builds Alt+T works but Alt+M doesn't.
Comment 27•19 years ago
|
||
never mind, I was somehow out of date in toolkit - all seems ok in mailnews compose
Assignee | ||
Comment 28•19 years ago
|
||
I tried to fix the menulist in a similar manner, but it seems its
GetInputField() always returns a null nsIDOMXULTextBoxElement?
Also, I see there is a GetInputField() in nsIDOMXULTreeElement.h too.
So, let's just test visibility for other XUL for now...
This fixes the attached <menulist> testcase, if someone can provide a
small testcase for the tree-element case that would be appreciated.
Attachment #193979 -
Flags: superreview?(bryner)
Attachment #193979 -
Flags: review?(aaronleventhal)
Comment 29•19 years ago
|
||
(In reply to comment #28)
>I tried to fix the menulist in a similar manner, but it seems its
>GetInputField() always returns a null nsIDOMXULTextBoxElement?
>Also, I see there is a GetInputField() in nsIDOMXULTreeElement.h too.
Odd, it looks as if it should work...
>So, let's just test visibility for other XUL for now...
Wouldn't that make the textbox code unnecessary?
>This fixes the attached <menulist> testcase, if someone can provide a
>small testcase for the tree-element case that would be appreciated.
1. Trees can already take focus
2. That element is reserved for future expansion.
Comment 30•19 years ago
|
||
The additional patch seems to fix bug 305833 too.
Comment 31•19 years ago
|
||
Seems that people rely on being able to .focus() arbitrary XUL elements...
I've just throught of another case - Suite's compose window has a tree with an
explicit focus style to stop you tabbing to it although you can still use the
access key or F6 to cycle to it if you have attachments.
Comment 32•19 years ago
|
||
Comment on attachment 193979 [details] [diff] [review]
Additional patch rev. 1
It's getting a little messy and hard to read. Maybe it needs to be factored out
into a separate method. I'd say the separate requireFocusability variable
somehow doesn't make it more readable.
Attachment #193979 -
Flags: review?(aaronleventhal) → review-
Assignee | ||
Comment 33•19 years ago
|
||
Attachment #193979 -
Attachment is obsolete: true
Attachment #193994 -
Flags: superreview?(bryner)
Attachment #193994 -
Flags: review?(aaronleventhal)
Assignee | ||
Updated•19 years ago
|
Attachment #193979 -
Flags: superreview?(bryner)
Comment 34•19 years ago
|
||
Comment on attachment 193994 [details] [diff] [review]
Cleaned up version, rev. 1
Please remove the else's after returns, since they aren't necessary and are
against Mozilla style.
For the textbox, I recommend you consider saving a couple of lines by using
recursion:
+ nsCOMPtr<nsIContent> input = do_QueryInterface(inputNode);
+ return IsFocusable(aPresShell, input);
Attachment #193994 -
Flags: review?(aaronleventhal) → review+
Comment 35•19 years ago
|
||
Come to think of it, it's strange that of all the XUL elements, we're only
checking focusability on the textbox element, and only visibility on everything
else.
For XUL just check visibility. Anyway, you still have r=
Assignee | ||
Comment 36•19 years ago
|
||
With Aaron's suggestions in comment 34.
Attachment #193994 -
Attachment is obsolete: true
Attachment #194021 -
Flags: superreview?(bryner)
Assignee | ||
Comment 37•19 years ago
|
||
(In reply to comment #35)
But the goal here is that we should not focus the element if it is no longer
focusable after the blur handlers have run.
I don't see why should we break that for textboxes just because we can't
implement it correctly for other XUL elements at the moment.
Of course, I would rather see that we fix nsIFrame::IsFocusble(),
'-moz-user-focus' and tabindex to behave in a sane way for XUL.
Then we can just use focusFrame->IsFocusable() here (as we did
in the original checkin for bug 303620).
Assignee | ||
Updated•19 years ago
|
Attachment #193994 -
Flags: superreview?(bryner)
Comment 38•19 years ago
|
||
(In reply to comment #37)
> (In reply to comment #35)
> But the goal here is that we should not focus the element if it is no longer
> focusable after the blur handlers have run.
> I don't see why should we break that for textboxes just because we can't
> implement it correctly for other XUL elements at the moment.
>
> Of course, I would rather see that we fix nsIFrame::IsFocusble(),
> '-moz-user-focus' and tabindex to behave in a sane way for XUL.
> Then we can just use focusFrame->IsFocusable() here (as we did
> in the original checkin for bug 303620).
>
Okay, but my point was that if we're going to do a whitelist, then it seems
strange to be skipping all the easy ones like <button> and <checkbox>. At least
it seems worth commenting on in the code.
Assignee | ||
Comment 39•19 years ago
|
||
(I filed bug 306160 and bug 306162 for XUL problems I stumbled upon)
Assignee | ||
Comment 40•19 years ago
|
||
Comment on attachment 194021 [details] [diff] [review]
Cleaned up version, rev. 2
(In reply to comment #38)
> Okay, but my point was that if we're going to do a whitelist, then it seems
> strange to be skipping all the easy ones like <button> and <checkbox>. At least
> it seems worth commenting on in the code.
Ok, so let's use nsIContent::IsFocusable instead, which covers all
disabled controls. New patch coming up...
Attachment #194021 -
Flags: superreview?(bryner)
Assignee | ||
Comment 41•19 years ago
|
||
This triggers the code where we find we are no longer focusable after the blur
handlers have been run. The first testcase used disabled="disabled" which is
confusing since the XUL <textbox> is then focusable but the inner html:input is
not - this caused some of my earlier confusion in this bug, sorry for that.
Assignee | ||
Comment 42•19 years ago
|
||
Attachment #194021 -
Attachment is obsolete: true
Attachment #194038 -
Flags: superreview?(bryner)
Attachment #194038 -
Flags: review?(aaronleventhal)
Comment 43•19 years ago
|
||
*** Bug 306008 has been marked as a duplicate of this bug. ***
Comment 44•19 years ago
|
||
Comment on attachment 194038 [details] [diff] [review]
Cleaned up version, rev. 3
Please put in a comment as to why nsIContent->IsFocusable(&tabIndex) with
tabIndex = 0 insteadl if frame->IsFocusable()
I understand it, but the casual observer won't.
Is the :: necessary before ::IsFocusable?
Attachment #194038 -
Flags: review?(aaronleventhal) → review+
Updated•19 years ago
|
Whiteboard: [needs SR bryner]
Updated•19 years ago
|
Attachment #194038 -
Flags: superreview?(bryner) → superreview+
Updated•19 years ago
|
Whiteboard: [needs SR bryner]
Comment 45•19 years ago
|
||
has this landed on the trunk yet for testing?
Assignee | ||
Comment 46•19 years ago
|
||
(In reply to comment #44)
> Please put in a comment ...
ok, did so
> Is the :: necessary before ::IsFocusable?
>
Not really, it's to point out that this is a function in global scope rather
than a method. I think it was dbaron who suggested this style to me
and I have used it ever since.
Assignee | ||
Comment 47•19 years ago
|
||
"Cleaned up version, rev. 3" was checked in on trunk at 2005-08-30 13:22 PDT.
Note that this will only be needed on the branch if bug 303620 goes in there.
-> FIXED
Status: REOPENED → RESOLVED
Closed: 19 years ago → 19 years ago
Keywords: testcase
Resolution: --- → FIXED
Comment 48•19 years ago
|
||
not applicable for the branch since we're not taking the bug that regressed this
on the trunk.
Flags: blocking1.8b5+
Flags: blocking1.8b4?
Comment 49•18 years ago
|
||
verified with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061205 Minefield/3.0a1
Status: RESOLVED → VERIFIED
Updated•16 years ago
|
Product: Firefox → Toolkit
You need to log in
before you can comment on or make changes to this bug.
Description
•