12011-10-03 Jon Lee <jonlee@apple.com>
2
3 REGRESSION (WK2): (Shift-)option-tabbing skips over elements when transitioning from chrome to webview
4 https://bugs.webkit.org/show_bug.cgi?id=68412
5 <rdar://problem/9988252>
6
7 Reviewed by NOBODY (OOPS!).
8
9 In order to create a test for the bug, I had to update DRT and WKTR to create some
10 widget that allows first responder status to move away from the main web view.
11
12 Three methods were added to layoutTestController: addChromeInputField,
13 removeChromeInputField, and focusWebView. addChromeInputField adds a text field
14 that is a sibling to the web view, and sets up the key event loop between the two.
15 removeChromeInputField removes that field. focusWebView moves first responder
16 status to the web view.
17
18 The test makes the call via layoutTestController and passes a callback that it
19 assumes will be executed once the task is completed. In DRT the callback is called
20 synchronously. In WKTR this is handled with message passing between the two
21 processes.
22
23 * DumpRenderTree/LayoutTestController.cpp:
24 (addChromeInputFieldCallback):
25 (removeChromeInputFieldCallback):
26 (focusWebViewCallback):
27 (LayoutTestController::staticFunctions):
28 * DumpRenderTree/LayoutTestController.h:
29 * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
30 (LayoutTestController::addChromeInputField):
31 (LayoutTestController::removeChromeInputField):
32 (LayoutTestController::focusWebView):
33 * DumpRenderTree/mac/DumpRenderTree.mm:
34 (resetWebViewToConsistentStateBeforeTesting): When resetting for the next test,
35 make sure to remove the chrome input field.
36 * DumpRenderTree/mac/LayoutTestControllerMac.mm:
37 (LayoutTestController::addChromeInputField):
38 (LayoutTestController::removeChromeInputField):
39 (LayoutTestController::focusWebView):
40 * DumpRenderTree/win/LayoutTestControllerWin.cpp:
41 (LayoutTestController::addChromeInputField):
42 (LayoutTestController::removeChromeInputField):
43 (LayoutTestController::focusWebView):
44 * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
45 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
46 (WTR::InjectedBundle::didReceiveMessage):
47 (WTR::InjectedBundle::postAddChromeInputField):
48 (WTR::InjectedBundle::postRemoveChromeInputField):
49 (WTR::InjectedBundle::postFocusWebView):
50 * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
51 * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
52 (WTR::callbackMap): Create a hash map that keeps track of the callbacks provided
53 through JS.
54 (WTR::cacheLayoutTestControllerCallback):
55 (WTR::callLayoutTestControllerCallback):
56 (WTR::LayoutTestController::addChromeInputField):
57 (WTR::LayoutTestController::removeChromeInputField):
58 (WTR::LayoutTestController::focusWebView):
59 (WTR::LayoutTestController::callAddChromeInputFieldCallback):
60 (WTR::LayoutTestController::callRemoveChromeInputFieldCallback):
61 (WTR::LayoutTestController::callFocusWebViewCallback):
62 * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
63 * WebKitTestRunner/PlatformWebView.h:
64 * WebKitTestRunner/TestController.cpp:
65 (WTR::TestController::resetStateToConsistentValues):
66 * WebKitTestRunner/TestInvocation.cpp:
67 (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
68 * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
69 (WTR::PlatformWebView::addChromeInputField):
70 (WTR::PlatformWebView::removeChromeInputField):
71 (WTR::PlatformWebView::makeWebViewFirstResponder):
72 * WebKitTestRunner/mac/PlatformWebViewMac.mm:
73 (WTR::PlatformWebView::addChromeInputField):
74 (WTR::PlatformWebView::removeChromeInputField):
75 (WTR::PlatformWebView::makeWebViewFirstResponder):
76 * WebKitTestRunner/win/PlatformWebViewWin.cpp:
77 (WTR::PlatformWebView::addChromeInputField):
78 (WTR::PlatformWebView::removeChromeInputField):
79 (WTR::PlatformWebView::makeWebViewFirstResponder):
80
81 * DumpRenderTree/mac/LayoutTestControllerMac.mm: These functions have nothing to do
82 with the patch-- just cleaning up style.
83 (LayoutTestController::addDisallowedURL):
84 (originsArrayToJS):
85 (LayoutTestController::queueLoad):
86 (LayoutTestController::setMockDeviceOrientation):
87 (LayoutTestController::setIconDatabaseEnabled):
88 (LayoutTestController::setEditingBehavior):
89