Form inputs remain focused when disabled (focus fixup rule not followed)
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox106 | --- | fixed |
People
(Reporter: abacabadabacaba, Assigned: emilio)
References
(Blocks 2 open bugs, Regressed 1 open bug)
Details
Attachments
(3 files)
Steps to reproduce:
Try the following code:
HTML:
<input id=foo>
JavaScript:
foo.focus();
foo.disabled = true;
console.log(document.activeElement);
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.
Comment 1•3 years ago
|
||
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.
Reporter | ||
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
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.
Assignee | ||
Comment 3•3 years ago
|
||
Not even display: none
, for that matter.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 4•2 years ago
|
||
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.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 5•2 years ago
|
||
This implements the proposal in the linked spec issue, and makes
it nightly-only pending resolution + edits.
Assignee | ||
Updated•2 years ago
|
Comment 7•2 years ago
|
||
Backed out for causing mochitest-chrome failures on test_modal_prompts.html.
[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 - SimpleTest.is@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:497:14
[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
Assignee | ||
Updated•2 years ago
|
Comment 9•2 years ago
|
||
bugherder |
Description
•