Closed Bug 1801761 Opened 2 years ago Closed 2 years ago

UnsuppressAndInvalidate -> SetReadyForFocus may cause unexpected side affect when it's triggered by Element::Focus

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

RESOLVED FIXED
112 Branch
Tracking Status
firefox112 --- fixed

People

(Reporter: sefeng, Assigned: sefeng)

References

Details

Attachments

(1 file)

While updating the autofocus algorithm, I noticed this assertion is flaky.

I think what happened was when Element::Focus run, we generated a new action id. And then FlushPendingNotifications was triggered by FlushAndCheckIfFocusable which might unsuppress the painting. If the parent document was not focused yet, SetReadyForFocus would focus the parent document by generating an new action id, and this new action made the previous action id staled.

Sounds plausible Emilio?

Flags: needinfo?(emilio)

Sounds believable. Seems it should be easy to fix by generating the action id inside SetFocusInner rather than relying on the caller to provide it? Afaict most if not all callers just give a fresh focus action id.

Flags: needinfo?(emilio)

Thanks, I'll fix this

Severity: -- → S3

This fixes an issue where Element::Focus triggered another focus
event and caused the initial focus event failed to be executed.

Assignee: nobody → sefeng
Status: NEW → ASSIGNED

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:sefeng, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit auto_nag documentation.

Flags: needinfo?(sefeng)
Flags: needinfo?(hsivonen)

I'll land this along with the patches for bug 1444491.

Flags: needinfo?(sefeng)
Flags: needinfo?(hsivonen)
Pushed by sefeng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ce06375518a7
Generate focus actionId in SetFocusInner rather than relying on the caller to provide it r=emilio,hsivonen

Backed out along with Bug 1444491 for causing failures on autofocus-attribute.svg

Pushed by sefeng@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7da0a39b1461
Generate focus actionId in SetFocusInner rather than relying on the caller to provide it r=emilio,hsivonen
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: