This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pressing shift+tab when focused in the middle of a contenteditable el…
…ement doesn't work https://bugs.webkit.org/show_bug.cgi?id=241902 Reviewed by Wenson Hsieh. The bug was caused by Document::focusNavigationStartingNode returning an element after the root editable element when m_focusNavigationStartingNode is set to a text node inside the focused element. When moving backwards starting at this node, we would find the root editable element as the previous focusable element and the focus never moves. Fixed the bug by detecting this case and returning the focused element as the starting node instead. * Source/WebCore/dom/Document.cpp: (WebCore::Document::focusNavigationStartingNode const): Return the focused element if the focused element is a root editable element and the focus navigation starting node is inside this editable element. * LayoutTests/fast/events/sequential-focus-navigation-after-clicking-editable-text-expected.txt: Added. * LayoutTests/fast/events/sequential-focus-navigation-after-clicking-editable-text.html: Added. * LayoutTests/platform/ios/TestExpectations: Canonical link: https://commits.webkit.org/252029@main
- Loading branch information
Showing 4 changed files with 43 additions and 0 deletions.