Closed Bug 252984 Opened 21 years ago Closed 21 years ago

Cannot type in any of the fields - forms don't get focus on left-click

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect
Not set
major

Tracking

()

VERIFIED FIXED

People

(Reporter: jamesrome, Assigned: aaronlev)

References

()

Details

(Keywords: regression)

Attachments

(1 file, 4 obsolete files)

This Web page will not allow me to type into any of the fields. Build 2004072307 Windows XP Pro
I see this too, testing with 2004072307 WinXP I have to right-click in the fields and bring up the context - THEN start typing. The fields simply don't get focus with a common left-click
Summary: Cannot type in any of the fields → Cannot type in any of the fields - forms don't get focus on left-click
This broke between 2004-07-05-07 and 2004-07-06-19 It's a regression from the bug 171366 landing -- removing the tabindex="18" from the <form> makes the page work again. Note that clicking in a textfield puts a focus outline on the form, for some odd reason.
Assignee: dveditz → aaronleventhal
Severity: normal → major
Component: Form Manager → Keyboard: Navigation
Keywords: regression
OS: Windows XP → All
Hardware: PC → All
ccing reviewers of bug 171366 too. James, for further reference, "form manager" is about saving and prefilling form data, not this sort of problem...
I am glad it is a regression and not an example of dirty politics. ;-) I apologize for the mislabeling of the component, but it is not at all clear what component does what, or even what they do! It would be really nice if Bugzilla put on some tool tips on the list items.
James, the "Component" link next to the dropdown gives descriptions of all the components....
We both need to fix something (the site and Mozilla). Page fix: tabindex=18 is on the <form> is bad. This creates issues even in IE. For example, using IE click to the right of the 3 checkboxes at the bottom of the page. Notice how a bunch of things appear to receive focus. Please get rid of tabindex on the form itself, because a positive tabindex makes something focusable and the <form> should not be focusable. Tabindex should go on the individual focusable controls. For more info on tabindex see msdn.microsoft.com/workshop/author/dhtml/reference/properties/tabindex.asp Mozilla fix: Mozilla does not want to have focusable decendants of something that's already focusable (unless it's a frame/iframe). This avoids problems like <button>'s or <a>'s with focusable things inside of them. I think I'll do this with a black list for button and a instead of the current whitelist approach for iframe and frame.
Very cool -- we actually don't need nsGenericHTMLElement::HandleDOMEvent() any more because click to focus is now generically handled for everything in esm::PostHandleEvent(), which was changed in bug 250006 to use IsFocusable(). So, that now handles the case where click needs to focus something like a div or span with tabindex >= 0
Attachment #154379 - Flags: review?(bryner)
Attachment #154379 - Flags: review?(bryner)
Patch with more context this time.
Attachment #154379 - Attachment is obsolete: true
Aaron, the xlink code is wrong (it should not be in the |if (HTML)| block).
Attachment #154380 - Attachment is obsolete: true
Attachment #154477 - Flags: superreview?(bzbarsky)
Comment on attachment 154477 [details] [diff] [review] Oops, Boris is right. Had the xlink condition in the wrong block First of all, this assumes that HTML nodes can't be XLinks. That's true so far in Mozilla, but we need to fix that, and I'd rather not build an assumption about it into more code. Second, this seems to treat <a> the same whether or not it's actually got a reasonable href attribute. So <a name="foo"><input></a> won't work, as far as I can tell. Finally, if we _do_ have a button inside a link or something along those lines, clicking on the button should trigger the _button_, not the link. We have an existing bug on this.... It looks like this patch continues enforcing the current buggy behavior of triggering the link, not the button, no?
Attachment #154477 - Flags: superreview?(bzbarsky) → superreview-
I realize now that FocusableAncestor() was necessary before the rewrite in bug 250006. However, now IsFocusable() does everything it needs without the focusable ancestor check. There's no longer any danger of the wrong thing getting focused in something like <a href="Foo">Hello you <b>crazy</b> animal</a>. This is because nsIFrame/nsIContent::IsFocusable() know what they're doing and we don't just use -moz-user-focus to decide if something is focusable (-moz-user-focus is inherited by child elements which would cause the problem).
Attachment #154477 - Attachment is obsolete: true
Attachment #154483 - Flags: superreview?(bzbarsky)
Attachment #154477 - Flags: superreview-
Comment on attachment 154483 [details] [diff] [review] We actually don't need either nsIFrame::FocusableAncestor() or nsGenericHTMLElement::HandleDOMEvent() anymore If things still work right and someone who knows the focus code reviews, sr=bzbarsky
Attachment #154483 - Flags: superreview?(bzbarsky) → superreview+
Comment on attachment 154483 [details] [diff] [review] We actually don't need either nsIFrame::FocusableAncestor() or nsGenericHTMLElement::HandleDOMEvent() anymore Brian, this patch is pure code removal.
Attachment #154483 - Flags: review?
Comment on attachment 154483 [details] [diff] [review] We actually don't need either nsIFrame::FocusableAncestor() or nsGenericHTMLElement::HandleDOMEvent() anymore Forgot to put bryner's email in review flag field. Bryner, this is a pure code removal patch.
Attachment #154483 - Flags: review? → review?(bryner)
Attachment #154483 - Flags: superreview+
Attachment #154483 - Flags: review?(bryner)
Comment on attachment 154652 [details] [diff] [review] Correct patch. In the last one The last patch didn't include the removal of the call to FocusableAncestor() in nsFrame::IsFocusable() Carrying bz's sr=
Attachment #154652 - Flags: superreview+
Attachment #154652 - Flags: review?(bryner)
Blocks: 253472
Blocks: 253374
Attachment #154652 - Flags: review?(bryner) → review+
Checking in layout/base/public/nsIFrame.h; /cvsroot/mozilla/layout/base/public/nsIFrame.h,v <-- nsIFrame.h new revision: 3.249; previous revision: 3.248 done Checking in layout/html/base/src/nsFrame.cpp; /cvsroot/mozilla/layout/html/base/src/nsFrame.cpp,v <-- nsFrame.cpp new revision: 3.494; previous revision: 3.493 done Checking in content/html/content/src/nsGenericHTMLElement.cpp; /cvsroot/mozilla/content/html/content/src/nsGenericHTMLElement.cpp,v <-- nsGenericHTMLElement.cpp new revision: 1.529; previous revision: 1.528 done Checking in content/html/content/src/nsGenericHTMLElement.h; /cvsroot/mozilla/content/html/content/src/nsGenericHTMLElement.h,v <-- nsGenericHTMLElement.h new revision: 1.197; previous revision: 1.196 done
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
*** Bug 253659 has been marked as a duplicate of this bug. ***
*** Bug 253708 has been marked as a duplicate of this bug. ***
I am not sure this is fixed yet. I assume the patch is in the 7/30 build. But http://www.cs.utk.edu/~dunigan/landforms/map.html does not properly support clicking.
Verified FIXED with build 2004-08-16-13 on Windows XP.
Status: RESOLVED → VERIFIED
Component: Keyboard: Navigation → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: