diff options
author | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-17 22:24:48 +0000 |
---|---|---|
committer | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-17 22:24:48 +0000 |
commit | 3d6202584c5fe55c54a07feeb240f4bdc442aad4 (patch) | |
tree | 0203a8e780103f85edffe127e1d247503a443b70 | |
parent | 018a396fc1650116ecc1df0ad7e5b65ec5ad7bec (diff) | |
download | chromium_src-3d6202584c5fe55c54a07feeb240f4bdc442aad4.zip chromium_src-3d6202584c5fe55c54a07feeb240f4bdc442aad4.tar.gz chromium_src-3d6202584c5fe55c54a07feeb240f4bdc442aad4.tar.bz2 |
Implement WebKitTabToLinksPreferenceKey for the test_shell.
BUG=21267
TEST=Run layout tests
Review URL: http://codereview.chromium.org/212004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26508 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/glue/chrome_client_impl.cc | 6 | ||||
-rw-r--r-- | webkit/glue/webpreferences.cc | 4 | ||||
-rw-r--r-- | webkit/glue/webpreferences.h | 2 | ||||
-rw-r--r-- | webkit/glue/webview.h | 3 | ||||
-rw-r--r-- | webkit/glue/webview_impl.cc | 8 | ||||
-rw-r--r-- | webkit/glue/webview_impl.h | 6 | ||||
-rwxr-xr-x | webkit/tools/layout_tests/test_expectations.txt | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/layout_test_controller.cc | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 3 |
9 files changed, 29 insertions, 9 deletions
diff --git a/webkit/glue/chrome_client_impl.cc b/webkit/glue/chrome_client_impl.cc index 6aa4478..4da7d47 100644 --- a/webkit/glue/chrome_client_impl.cc +++ b/webkit/glue/chrome_client_impl.cc @@ -414,11 +414,7 @@ bool ChromeClientImpl::shouldInterruptJavaScript() { } bool ChromeClientImpl::tabsToLinks() const { - // TODO(pamg): Consider controlling this with a user preference, when we have - // a preference system in place. - // For now Chrome will allow link to take focus if we're not running layout - // tests. - return !WebKit::layoutTestMode(); + return webview_->GetTabsToLinks(); } WebCore::IntRect ChromeClientImpl::windowResizerRect() const { diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc index 6c872d6..5c5aabc 100644 --- a/webkit/glue/webpreferences.cc +++ b/webkit/glue/webpreferences.cc @@ -77,4 +77,8 @@ void WebPreferences::Apply(WebView* web_view) const { // Web inspector settings need to be passed in differently. web_view->SetInspectorSettings(inspector_settings); + + // Tabs to link is not part of the settings. WebCore calls + // ChromeClient::tabsToLinks which is part of the glue code. + web_view->SetTabsToLinks(tabs_to_links); } diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h index e6fbb49..1b14dc8 100644 --- a/webkit/glue/webpreferences.h +++ b/webkit/glue/webpreferences.h @@ -48,6 +48,7 @@ struct WebPreferences { bool databases_enabled; bool session_storage_enabled; bool application_cache_enabled; + bool tabs_to_links; // TODO(tc): User style sheets will not work in chrome because it tries to // load the style sheet using a request without a frame. @@ -91,6 +92,7 @@ struct WebPreferences { databases_enabled(false), session_storage_enabled(false), application_cache_enabled(false), + tabs_to_links(true), user_style_sheet_enabled(false), allow_universal_access_from_file_urls(false) { } diff --git a/webkit/glue/webview.h b/webkit/glue/webview.h index 86f2d28..7968aa4 100644 --- a/webkit/glue/webview.h +++ b/webkit/glue/webview.h @@ -248,6 +248,9 @@ class WebView : public WebKit::WebWidget { virtual void SetSpellingPanelVisibility(bool is_visible) = 0; virtual bool GetSpellingPanelVisibility() = 0; + virtual void SetTabsToLinks(bool enable) = 0; + virtual bool GetTabsToLinks() const = 0; + // Performs an action from a context menu for the node at the given // location. virtual void MediaPlayerActionAt(int x, diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc index 419ca4b..a90d162 100644 --- a/webkit/glue/webview_impl.cc +++ b/webkit/glue/webview_impl.cc @@ -1935,3 +1935,11 @@ void WebViewImpl::SetSpellingPanelVisibility(bool is_visible) { bool WebViewImpl::GetSpellingPanelVisibility() { return spelling_panel_is_visible_; } + +void WebViewImpl::SetTabsToLinks(bool enable) { + tabs_to_links_ = enable; +} + +bool WebViewImpl::GetTabsToLinks() const { + return tabs_to_links_; +}
\ No newline at end of file diff --git a/webkit/glue/webview_impl.h b/webkit/glue/webview_impl.h index 9b860bc..cc947e9 100644 --- a/webkit/glue/webview_impl.h +++ b/webkit/glue/webview_impl.h @@ -248,6 +248,9 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> { virtual void SetSpellingPanelVisibility(bool is_visible); virtual bool GetSpellingPanelVisibility(); + virtual void SetTabsToLinks(bool enable); + virtual bool GetTabsToLinks() const; + #if ENABLE(NOTIFICATIONS) // Returns the provider of desktop notifications. WebKit::NotificationPresenterImpl* GetNotificationPresenter(); @@ -403,6 +406,9 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> { // Whether the spelling panel is currently being displayed or not. bool spelling_panel_is_visible_; + // Whether the user can press tab to focus links. + bool tabs_to_links_; + // Inspector settings. std::wstring inspector_settings_; diff --git a/webkit/tools/layout_tests/test_expectations.txt b/webkit/tools/layout_tests/test_expectations.txt index 29c8484..2818ca1 100755 --- a/webkit/tools/layout_tests/test_expectations.txt +++ b/webkit/tools/layout_tests/test_expectations.txt @@ -2276,10 +2276,6 @@ BUG21141 LINUX : LayoutTests/fast/forms/select-script-onchange.html = FAIL // The test is flaky. BUG_VICTORW : LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-from-javascript-url-sub-frame-2-level.html = PASS CRASH -// WebKit 48098:48155 -BUG21267 : LayoutTests/fast/events/click-focus-anchor.html = FAIL -BUG21267 : LayoutTests/fast/events/tab-focus-anchor.html = FAIL - BUG_JAPHET MAC : LayoutTests/animations/change-keyframes-name.html = FAIL PASS // Flaky, not clear as of when. diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index d6145a4..dada6c4 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -922,6 +922,8 @@ void LayoutTestController::overridePreference( preferences->local_storage_enabled = CppVariantToBool(value); else if (key == "WebKitOfflineWebApplicationCacheEnabled") preferences->application_cache_enabled = CppVariantToBool(value); + else if (key == "WebKitTabToLinksPreferenceKey") + preferences->tabs_to_links = CppVariantToBool(value); else { std::string message("Invalid name for preference: "); message.append(key); diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index a58c9bc..19ff932 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -423,6 +423,9 @@ void TestShell::ResetWebPreferences() { web_prefs_->local_storage_enabled = true; web_prefs_->session_storage_enabled = true; web_prefs_->application_cache_enabled = false; + // LayoutTests were written with Safari Mac in mind which does not allow + // tabbing to links by default. + web_prefs_->tabs_to_links = false; // Allow those layout tests running as local files, i.e. under // LayoutTests/http/tests/local, to access http server. |