Bug 119713 - Remove focus if supportsFocus state is changed
Summary: Remove focus if supportsFocus state is changed
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BlinkMergeCandidate, InRadar
Depends on: 112992
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-12 19:19 PDT by Ryosuke Niwa
Modified: 2022-08-18 17:24 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-08-12 19:19:24 PDT
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.
Comment 1 Ahmad Saleem 2022-08-09 16:48:25 PDT
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!
Comment 2 Radar WebKit Bug Importer 2022-08-10 10:56:09 PDT
<rdar://problem/98460092>