Changeset 295179 in webkit
- Timestamp:
- Jun 2, 2022, 11:45:17 PM (4 years ago)
- Location:
- branches/safari-613-branch
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-script-focus-020-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-script-focus-020.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/Document.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-613-branch/LayoutTests/imported/w3c/ChangeLog
r294305 r295179 1 2022-05-06 Manuel Rego Casasnovas <rego@igalia.com> 2 3 [selectors] Double script focus after mouse click shouldn't match :focus-visible 4 https://bugs.webkit.org/show_bug.cgi?id=239472 5 <rdar://problem/92301472> 6 7 Reviewed by Antti Koivisto. 8 9 * web-platform-tests/css/selectors/focus-visible-script-focus-020-expected.txt: Added. 10 * web-platform-tests/css/selectors/focus-visible-script-focus-020.html: Added. 11 1 12 2022-05-16 Alan Coon <alancoon@apple.com> 2 13 -
branches/safari-613-branch/Source/WebCore/ChangeLog
r294850 r295179 1 2022-05-06 Manuel Rego Casasnovas <rego@igalia.com> 2 3 [selectors] Double script focus after mouse click shouldn't match :focus-visible 4 https://bugs.webkit.org/show_bug.cgi?id=239472 5 <rdar://problem/92301472> 6 7 Reviewed by Antti Koivisto. 8 9 When you do the second script focus, we were setting 10 m_latestFocusTrigger to FocusTrigger::Bindings, that makes us lose the 11 information about the previous element that was focused via mouse 12 click and start matching :focus-visible on that case. 13 14 Test: imported/w3c/web-platform-tests/css/selectors/focus-visible-script-focus-020.html 15 16 * dom/Document.cpp: 17 (WebCore::Document::setFocusedElement): We avoid setting 18 m_latestFocusTrigger if we come from script focus. That way we know if 19 the previous focused element was focused via mouse click after several 20 script focus. 21 1 22 2022-05-25 Alan Coon <alancoon@apple.com> 2 23 -
branches/safari-613-branch/Source/WebCore/dom/Document.cpp
r295106 r295179 4672 4672 setFocusNavigationStartingNode(m_focusedElement.get()); 4673 4673 m_focusedElement->setFocus(true, options.visibility); 4674 m_latestFocusTrigger = options.trigger; 4674 if (options.trigger != FocusTrigger::Bindings) 4675 m_latestFocusTrigger = options.trigger; 4675 4676 4676 4677 // The setFocus call triggers a blur and a focus event. Event handlers could cause the focused element to be cleared.
Note:
See TracChangeset
for help on using the changeset viewer.