Closed Bug 1740989 Opened 2 years ago Closed 9 months ago

Form inputs remain focused when disabled (focus fixup rule not followed)


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

Firefox 94



106 Branch
Tracking Status
firefox106 --- fixed


(Reporter: abacabadabacaba, Assigned: emilio)


(Blocks 2 open bugs, Regressed 2 open bugs)



(3 files)

Steps to reproduce:

Try the following code:

<input id=foo>

foo.disabled = true;

Actual results:

The value logged is the input element.

Expected results:

According to the HTML specification, the document's body element should have been logged instead. Chromium behaves according to the specification, but Firefox doesn't.

The Bugbug bot thinks this bug should belong to the 'DevTools::Console' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Console
Product: Firefox → DevTools
Component: Console → DOM: UI Events & Focus Handling
Product: DevTools → Core
Blocks: 1656849
Severity: -- → S3
Attached file Another test-case.

Chrome seems to implement the fixup rule somewhat inconsistently. It works for disabled, but not for other stuff that affects focusability like visibility or so.

Not even display: none, for that matter.

Assignee: nobody → emilio
Attached file Refined test-case.

It seems Blink implements this at some point after the RAF callbacks but before rendering. Need to check the spec but I think it's about time to fix this.

Flags: needinfo?(emilio)
See Also: → 1787456

This implements the proposal in the linked spec issue, and makes
it nightly-only pending resolution + edits.

Flags: needinfo?(emilio)
Pushed by
Implement focus fixup rule. r=smaug

Backed out for causing mochitest-chrome failures on test_modal_prompts.html.

Push with failures

Failure log

Backout link

[task 2022-08-31T21:49:32.358Z] 21:49:32     INFO - TEST-PASS | toolkit/components/prompts/test/test_modal_prompts.html | Checking cancel-button isn't disabled 
[task 2022-08-31T21:49:32.359Z] 21:49:32     INFO - Buffered messages finished
[task 2022-08-31T21:49:32.359Z] 21:49:32     INFO - TEST-UNEXPECTED-FAIL | toolkit/components/prompts/test/test_modal_prompts.html | checking button0 default - got true, expected false
[task 2022-08-31T21:49:32.359Z] 21:49:32     INFO -
[task 2022-08-31T21:49:32.359Z] 21:49:32     INFO - checkPromptState@chrome://mochitests/content/chrome/toolkit/components/prompts/test/prompt_common.js:291:5
[task 2022-08-31T21:49:32.360Z] 21:49:32     INFO - handlePrompt@chrome://mochitests/content/chrome/toolkit/components/prompts/test/prompt_common.js:196:19
[task 2022-08-31T21:49:32.360Z] 21:49:32     INFO - TEST-PASS | toolkit/components/prompts/test/test_modal_prompts.html | checking button1 default 
Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Pushed by
Implement focus fixup rule. r=smaug
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
Blocks: 1788741
Regressions: 1788808
Regressions: 1788908
Regressions: 1788913
Regressions: 1789170
Regressions: 1789427
Regressions: 1792057
Blocks: 1810077
Regressions: 1829890
Regressions: 1829594
You need to log in before you can comment on or make changes to this bug.