Changeset 271146 in webkit
- Timestamp:
- Jan 5, 2021 5:39:54 AM (19 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-in-focus-event-001-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-in-focus-event-001.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-005-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/selectors/w3c-import.log (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/focus-autofocus-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/Document.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r271142 r271146 1 2021-01-05 Manuel Rego Casasnovas <rego@igalia.com> 2 3 [selectors] :focus should match inside the focus event 4 https://bugs.webkit.org/show_bug.cgi?id=220243 5 6 Reviewed by Frédéric Wang. 7 8 * TestExpectations: Skip some :focus-visible tests as current failure results 9 depend on the platform. 10 This issue has been fixed upstream in https://github.com/web-platform-tests/wpt/pull/27041 11 and these tests will be re-imported and unskipped in a follow-up patch. 12 1 13 2021-01-04 Rob Buis <rbuis@igalia.com> 2 14 -
trunk/LayoutTests/TestExpectations
r271142 r271146 1231 1231 imported/w3c/web-platform-tests/css/selectors/old-tests/css3-modsel-173a.xml [ ImageOnlyFailure ] 1232 1232 imported/w3c/web-platform-tests/css/selectors/old-tests/css3-modsel-173b.xml [ ImageOnlyFailure ] 1233 webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-001.html [ Skip ] 1233 1234 webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-002.html [ Skip ] 1235 webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-007.html [ Skip ] 1236 webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-009.html [ Skip ] 1237 webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-010.html [ Skip ] 1234 1238 webkit.org/b/185859 imported/w3c/web-platform-tests/css/selectors/focus-visible-012.html [ Skip ] 1235 1239 webkit.org/b/217904 imported/w3c/web-platform-tests/css/selectors/is-where-visited.html [ ImageOnlyFailure ] -
trunk/LayoutTests/imported/w3c/ChangeLog
r271142 r271146 1 2021-01-05 Manuel Rego Casasnovas <rego@igalia.com> 2 3 [selectors] :focus should match inside the focus event 4 https://bugs.webkit.org/show_bug.cgi?id=220243 5 6 Reviewed by Frédéric Wang. 7 8 Import focus-in-focus-event-001.html test from WPT. 9 Rebaseline 2 tests: 10 - focus-autofocus.html now passes after fixing this bug. 11 - focus-visible-005.html now fails, but it was passing because it was not checking anything due to this bug. 12 13 * web-platform-tests/css/selectors/focus-in-focus-event-001-expected.txt: Added. 14 * web-platform-tests/css/selectors/focus-in-focus-event-001.html: Added. 15 * web-platform-tests/css/selectors/focus-visible-005-expected.txt: Rebaseline. 16 * web-platform-tests/css/selectors/w3c-import.log: 17 * web-platform-tests/html/semantics/selectors/pseudo-classes/focus-autofocus-expected.txt: Rebaesline. 18 19 1 20 2021-01-04 Rob Buis <rbuis@igalia.com> 2 21 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-005-expected.txt
r267650 r271146 7 7 I will be focused programmatically. 8 8 9 PASS Programmatic focus after click should not match :focus-visible 9 FAIL Programmatic focus after click should not match :focus-visible assert_equals: expected "none" but got "auto" 10 10 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/w3c-import.log
r270933 r271146 29 29 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/floating-first-letter-feff.html 30 30 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-display-none-001.html 31 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-in-focus-event-001.html 31 32 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-001.html 32 33 /LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-002.html -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/focus-autofocus-expected.txt
r262254 r271146 1 1 2 2 3 FAIL :focus selector should work with an autofocused element. assert_array_equals: lengths differ, expected array [Element node <input autofocus=""></input>] length 1, got object "[object NodeList]" length 0 3 PASS :focus selector should work with an autofocused element. 4 4 -
trunk/Source/WebCore/ChangeLog
r271137 r271146 1 2021-01-05 Manuel Rego Casasnovas <rego@igalia.com> 2 3 [selectors] :focus should match inside the focus event 4 https://bugs.webkit.org/show_bug.cgi?id=220243 5 6 Reviewed by Frédéric Wang. 7 8 Before this patch this was working different in WebKit than Chromium and Firefox. 9 The specs are clear about the expected behavior for this: 10 - From https://drafts.csswg.org/selectors-4/#the-focus-pseudo: 11 "The :focus pseudo-class applies while an element has the focus" 12 - From https://w3c.github.io/uievents/#event-type-focus: 13 "The focus MUST be given to the element before the dispatch of this event type" 14 15 A similar fix has been done on Blink in r201118 by <kochi@chromium.org> 16 (https://chromium.googlesource.com/chromium/src/+/cc49a6966f5ae6d89e86fbd3f53e4deea4e066ca). 17 18 Test: imported/w3c/web-platform-tests/css/selectors/focus-in-focus-event-001.html 19 20 * dom/Document.cpp: 21 (WebCore::Document::setFocusedElement): Just moved the call to m_focusedElement->setFocus(true) 22 right before dispatching the events. 23 1 24 2021-01-04 Alexey Shvayka <shvaikalesh@gmail.com> 2 25 -
trunk/Source/WebCore/dom/Document.cpp
r271125 r271146 4446 4446 m_focusedElement = newFocusedElement; 4447 4447 setFocusNavigationStartingNode(m_focusedElement.get()); 4448 4449 // Dispatch the focus event and let the node do any other focus related activities (important for text fields) 4450 m_focusedElement->dispatchFocusEvent(oldFocusedElement.copyRef(), direction); 4451 4448 m_focusedElement->setFocus(true); 4449 4450 // The setFocus call triggers a blur and a focus event. Event handlers could cause the focused element to be cleared. 4452 4451 if (m_focusedElement != newFocusedElement) { 4453 4452 // handler shifted focus … … 4455 4454 } 4456 4455 4457 m_focusedElement->dispatchFocusInEvent(eventNames().focusinEvent, oldFocusedElement.copyRef()); // DOM level 3 bubbling focus event. 4456 // Dispatch the focus event and let the node do any other focus related activities (important for text fields) 4457 m_focusedElement->dispatchFocusEvent(oldFocusedElement.copyRef(), direction); 4458 4458 4459 4459 if (m_focusedElement != newFocusedElement) { … … 4462 4462 } 4463 4463 4464 // FIXME: We should remove firing DOMFocusInEvent event when we are sure no content depends 4465 // on it, probably when <rdar://problem/8503958> is m. 4466 m_focusedElement->dispatchFocusInEvent(eventNames().DOMFocusInEvent, oldFocusedElement.copyRef()); // DOM level 2 for compatibility. 4464 m_focusedElement->dispatchFocusInEvent(eventNames().focusinEvent, oldFocusedElement.copyRef()); // DOM level 3 bubbling focus event. 4467 4465 4468 4466 if (m_focusedElement != newFocusedElement) { … … 4471 4469 } 4472 4470 4473 m_focusedElement->setFocus(true); 4474 4475 // The setFocus call triggers a blur and a focus event. Event handlers could cause the focused element to be cleared. 4471 // FIXME: We should remove firing DOMFocusInEvent event when we are sure no content depends 4472 // on it, probably when <rdar://problem/8503958> is m. 4473 m_focusedElement->dispatchFocusInEvent(eventNames().DOMFocusInEvent, oldFocusedElement.copyRef()); // DOM level 2 for compatibility. 4474 4476 4475 if (m_focusedElement != newFocusedElement) { 4477 4476 // handler shifted focus
Note: See TracChangeset
for help on using the changeset viewer.