haikuwebkit/LayoutTests/fast/events/focusing-element-with-tabin...

16 lines
726 B
Plaintext
Raw Permalink Normal View History

iOS: An element with tabindex is not focusable unless there is no mouse event handler https://bugs.webkit.org/show_bug.cgi?id=165843 Reviewed by Antti Koivisto. Source/WebCore: The bug was caused by ancestorRespondingToClickEvents not checking the precense of tabindex attribute. Check that condition along with event listeners. Test: fast/events/focusing-element-with-tabindex-by-tap-or-click.html * page/ios/FrameIOS.mm: (WebCore::ancestorRespondingToClickEvents): Tools: Add testRunner.isWebKit2 which is always true in WebKitTestRunner. Without this, it's really hard to reliably differentiate DumpRenderTree and WebKitTestRunner, and DumpRenderTree's runUIScript would hit an assertion :( * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/TestRunner.h: (WTR::TestRunner::isWebKit2): LayoutTests: Added a regression test for focusing an element with just tabindex using UIHelper. Also fixed UIHelper to work in iOS DumpRenderTree which was hitting an assertion by explicitly checking testRunner.isWebKit2. Prior to fixing this, it was hitting an assertion in RunLoop::main() which was asserting that there is a runloop, which doesn't exist in DumpRenderTree. * fast/events/focusing-element-with-tabindex-by-tap-or-click-expected.txt: Added. * fast/events/focusing-element-with-tabindex-by-tap-or-click.html: Added. * platform/ios-simulator-wk2/TestExpectations: * resources/ui-helper.js: (window.UIHelper.isWebKit2): (window.UIHelper.wait): Added the support for js-test.js / js-test-pre.js style tests. Canonical link: https://commits.webkit.org/183477@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209833 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-14 21:57:37 +00:00
This tests tapping or clicking on an element with tabindex would focus the element.
To manually test, tap or click on each element below. Each element should be focused
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS "Activated contentEditableElement"; document.activeElement is contentEditableElement
PASS "Activated elementWithTabIndexAndClickHandler"; document.activeElement is elementWithTabIndexAndClickHandler
PASS "Activated elementWithTabIndex"; document.activeElement is elementWithTabIndex
PASS successfullyParsed is true
TEST COMPLETE
An element with contenteditable attribute
An element with click event handler and tabindex attribute
An element with tabindex attribute