Closed Bug 1729342 Opened 3 years ago Closed 3 years ago

Probably use delegatesFocus for <input type=date/time/datetime-local> widget, rather than MozBlurInnerTextBox / MozFocusInnerTextBox

Categories

(Core :: DOM: Core & HTML, task)

task

Tracking

()

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: emilio, Assigned: sefeng)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Right now we use hand-rolled code like this, which has various issues like not respecting FocusOptions.preventScroll among others.

We should probably use focus delegation once that is landed and enabled everywhere.

Hey Emilio, I don't understand what needs to be done about this bug. Is the expected behaviour defined somewhere in spec and which logic can be reused here?

Flags: needinfo?(emilio)

So we have some internal events (MozFocusInnerTextBox / MozBlurInnerTextBox) to delegate the focus to the inner text fields inside the <input>. Also, we have HTMLInputElement.setFocusState() to manually set the focus state in the <input>.

My understanding is that at least the events we could remove if we used delegateFocus in the internal shadow tree of the <input> element, is that wrong? That'd also give us the benefit of honoring FocusOptions, which right now we don't for those input types.

Flags: needinfo?(emilio)

Basically, delegatesFocus was designed to allow you to do exactly what these inputs do, minus the :focus-visible bit perhaps...

Type: defect → task

Currently datetimebox uses some hardcoded logic to find the edit
field inside the shadow tree and focus it.

Since we have delegatesFocus implemented, we could just use it without
these logic.

Assignee: nobody → sefeng
Status: NEW → ASSIGNED
Depends on: 1730566
Pushed by sefeng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d57de4af5089
Use delegatesFocus for <input type=date/time/datetime-local> widget r=emilio
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
Blocks: 1731771
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: