Bug 119713
Summary: | Remove focus if supportsFocus state is changed | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | ahmad.saleem792, ap, bfulgham, ntim, tkent, webkit-bug-importer |
Priority: | P2 | Keywords: | BlinkMergeCandidate, InRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | 112992 | ||
Bug Blocks: |
Ryosuke Niwa
Consider merging https://chromium.googlesource.com/chromium/blink/+/bdf4e305bcf5a7ab899f06a2cc697acaa9ab8116
Changes of *[tabindex], a[href], button[disabled], etc. affect focusable state,
but these changes don't always trigger layout. We need to ask focus check
explicitly.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
I took test cases from Chrome Commit:
Test Case 1 - https://jsfiddle.net/ojL52nsq/show
*** Safari 15.6 on macOS 12.6 ***
AIL document.activeElement should be javascript:. Was [object HTMLBodyElement].
Remove href.
FAIL No blur event
PASS successfullyParsed is true
TEST COMPLETE
link
>>>> then Safari HANGS!!
*** Firefox Nightly 105 ***
PASS document.activeElement is target
Remove href.
FAIL No blur event
PASS successfullyParsed is true
TEST COMPLETE
PASS blur event was disaptched.
PASS successfullyParsed is true
TEST COMPLETE
*** Chrome Canary 106 ***
PASS document.activeElement is target
Remove href.
PASS blur event was disaptched.
PASS successfullyParsed is true
TEST COMPLETE
FAIL No blur event
PASS successfullyParsed is true
TEST COMPLETE
______________
Test Case 2 - https://jsfiddle.net/r3x84k6y/show
*** Safari 15.6 on macOS 12.5 ***
FAIL document.activeElement should be [object HTMLDivElement]. Was [object HTMLBodyElement].
Remove tabindex.
FAIL No blur event
PASS successfullyParsed is true
TEST COMPLETE
div
>>>> then Safari HANGS!!
*** Chrome Canary 106 ***
PASS document.activeElement is target
Remove tabindex.
PASS blur event was disaptched.
PASS successfullyParsed is true
TEST COMPLETE
FAIL No blur event
PASS successfullyParsed is true
TEST COMPLETE
*** Firefox Nightly 105 ***
PASS document.activeElement is target
Remove tabindex.
FAIL No blur event
PASS successfullyParsed is true
TEST COMPLETE
PASS blur event was disaptched.
PASS successfullyParsed is true
TEST COMPLETE
____________
Test Case 3 - https://jsfiddle.net/ob561dma/show
*** Safari 15.6 on macOS 12.5 ***
FAIL document.activeElement should be [object HTMLButtonElement]. Was [object HTMLBodyElement].
Clicking a button makes the button disabled.
FAIL No blur event.
PASS successfullyParsed is true
TEST COMPLETE
*** Chrome Canary 106 ***
FAIL document.activeElement should be [object HTMLButtonElement]. Was [object HTMLBodyElement].
Clicking a button makes the button disabled.
FAIL No blur event.
PASS successfullyParsed is true
TEST COMPLETE
*** Firefox Nightly 105 ***
FAIL document.activeElement should be [object HTMLButtonElement]. Was [object HTMLBodyElement].
Clicking a button makes the button disabled.
FAIL No blur event.
PASS successfullyParsed is true
TEST COMPLETE
__________________
I just wanted to share updated test results and it shows that Safari do differ from other browsers in some cases. Thanks!
Radar WebKit Bug Importer
<rdar://problem/98460092>