Closed Bug 6133 Opened 26 years ago Closed 23 years ago

[FIX][DEPEND]<input type="file"> control: Doesn't respond to focus() call

Categories

(Core :: XUL, defect, P1)

x86
Windows NT
defect

Tracking

()

RESOLVED WORKSFORME
Future

People

(Reporter: cmanske, Assigned: rods)

References

Details

(Whiteboard: Fix in hand)

Attachments

(2 files)

The JavaScript focus() method should place the keyboard focus in the input edit field, as it does for <input type="text"> I haven't tested other JavaScript methods, but they probably should be investigated as well.
Status: NEW → ASSIGNED
Target Milestone: M7
Target Milestone: M7 → M9
Assignee: kmcclusk → evaughan
Status: ASSIGNED → NEW
Eric, I'm re-assigning this to you since your working on this form element.
Target Milestone: M9 → M11
Blocks: 12673
Target Milestone: M11 → M12
mass-moving all m12 bugs to m13
Status: NEW → ASSIGNED
giving me rest of phillips open qa contact bugs, sorry for spam
Target Milestone: M13 → M14
pushing to m14
Target Milestone: M14 → M15
*IGNORE* - massive spam changing open XPToolkit bug's QA contact to jrgm@netscape.com
QA Contact: paulmac → jrgm
Rod this is an html control.
Assignee: evaughan → rods
Status: ASSIGNED → NEW
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
fixed.
I can't get filecontrol.focus() to work, but should it work? Allowing it would make exploits easier. If it's not supposed to work, it should fail completely instead activating the window or losing the focus if the window is already active, which is what it does now.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached file doesn't work (deleted) —
This got broken when they turned on the new GfxTextControl. Here is the fix: Index: nsFileControlFrame.cpp =================================================================== RCS file: /cvsroot/mozilla/layout/html/forms/src/nsFileControlFrame.cpp,v retrieving revision 3.96 diff -u -r3.96 nsFileControlFrame.cpp --- nsFileControlFrame.cpp 2000/09/13 23:52:43 3.96 +++ nsFileControlFrame.cpp 2000/10/11 18:50:18 @@ -214,8 +214,13 @@ void nsFileControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) { + // Fix for Bug 6133 if (mTextFrame) { - mTextFrame->SetFocus(aOn, aRepaint); + nsCOMPtr<nsIContent> content; + mTextFrame->GetContent(getter_AddRefs(content)); + if (content) { + content->SetFocus(mPresContext); + } } }
Status: REOPENED → ASSIGNED
Summary: <input type="file"> control: Doesn't respond to focus() call → [FIX]<input type="file"> control: Doesn't respond to focus() call
Whiteboard: Fix in hand
Target Milestone: M15 → Future
sr=waterson
Attached patch patch file (deleted) — Splinter Review
It might be a good idea to hold this patch until bug 57770 is fixed. Being able to focus the field makes it slightly easier to exploit a more general security hole involving file upload controls. (Bug 56236 shows an exploit that *mostly* gets around the annoyance of not being able to focus the control.)
Depends on: 57770
I'll wait and check it in when the dependency clears - thanks for the heads up
Summary: [FIX]<input type="file"> control: Doesn't respond to focus() call → [FIX][DEPEND]<input type="file"> control: Doesn't respond to focus() call
Priority: P3 → P1
Target Milestone: Future → ---
Target Milestone: --- → Future
This works for me. Can we mark it resolved?
marking worksforme.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago23 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: