Closed
Bug 834652
Opened 11 years ago
Closed 3 years ago
Fix <input type='file'> focus handling
Categories
(Core :: DOM: Core & HTML, defect, P5)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
DUPLICATE
of bug 505355
People
(Reporter: mounir, Unassigned)
References
Details
<input type='file'> has a very weird behaviour regarding focus because the frame has two anonymous nodes and we have to focus the second one. Because of that, the focus/blur handling sometimes doesn't work as expected. For example, right now, if .focus() is called on the element, we will get the frames and focus the anonymous node that needs to be focused. If the layout isn't there yet, the element wouldn't be focused. We can easily fix that by creating the frames when .focus() is called (aka. doing a reflow) but that would only be a new hack on top of others. I actually have a patch doing that somewhere in my queue but I wasn't very happy with pushing it. I feel like a better design would be to have the element marking itself as focused without having to care about the layout. Then, when the layout is created, it could ask the element its current focus state and focus the appropriate anonymous node. I tried an implementation of that but I had a few issues regarding events going back and forth inside the anonymous tree. I didn't spent much time on that though. It would be interesting to fix that because some other elements might suffer from the same issues. I think of <input type='number'> or even date/time inputs.
Comment 1•11 years ago
|
||
you may want to read nsFocusManager::CheckIfFocusable We don't want type="file" to behave differently. CheckIfFocusable does flush and check for primary frame.
Reporter | ||
Comment 2•11 years ago
|
||
Re-adding bug 834206 because I'm not sure why it has been removed from the list.
Blocks: 834206
Reporter | ||
Comment 3•11 years ago
|
||
... it has been marked as duplicate, that's a good reason :)
No longer blocks: 834206
Comment 4•3 years ago
|
||
Bulk-downgrade of unassigned, 4 years untouched DOM/Storage bugs' priority.
If you have reason to believe this is wrong (especially for the severity), please write a comment and ni :jstutte.
Severity: normal → S4
Priority: -- → P5
Updated•3 years ago
|
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•