Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit 43721a2

Browse files
Reduce Preference Override Methods: TabsToLinks/SpatialNavigation
https://bugs.webkit.org/show_bug.cgi?id=218288 Reviewed by Tim Horton. Source/WebKit: Removes WKPreferencesGet/SetTabToLinksEnabled preference as it duplicates functionality of WKPreferencesGet/SetTabsToLinks. The former was added for https://bugs.webkit.org/show_bug.cgi?id=95329 but was redundant even at the time. We can now use test header commands for all of its use cases. Also removes testing only bundle SPI for enabling spatial navigation which also can be set via test headers instead. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetTabToLinksEnabled): Deleted. (WKPreferencesGetTabToLinksEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetSpatialNavigationEnabled): Deleted. * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): (WebKit::InjectedBundle::setSpatialNavigationEnabled): Deleted. * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::setTabToLinksEnabled): Deleted. (WebKit::WebPage::tabToLinksEnabled const): Deleted. Source/WTF: * Scripts/Preferences/WebPreferences.yaml: Unify TabToLinksEnabled and TabsToLinks. TabToLinksEnabled was added for https://bugs.webkit.org/show_bug.cgi?id=95329 and has never actually been needed. Tools: Replace uses of testRunner.overridePreference("WebKitTabToLinksPreferenceKey", ...) and testRunner.setSpatialNavigationEnabled(...) with test header commands, helping to reduce the number of different ways we have to override preferences in LayoutTests. * DumpRenderTree/TestOptions.cpp: (WTR::TestOptions::defaults): * DumpRenderTree/TestRunner.cpp: (TestRunner::staticFunctions): (setSpatialNavigationEnabledCallback): Deleted. * DumpRenderTree/TestRunner.h: * DumpRenderTree/mac/DumpRenderTree.mm: (resetWebPreferencesToConsistentValues): * DumpRenderTree/mac/TestRunnerMac.mm: (TestRunner::setSpatialNavigationEnabled): Deleted. * DumpRenderTree/win/DumpRenderTree.cpp: (resetWebPreferencesToConsistentValues): (setWebPreferencesForTestOptions): * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::beginTesting): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setSpatialNavigationEnabled): Deleted. * WebKitTestRunner/InjectedBundle/TestRunner.h: * WebKitTestRunner/TestController.cpp: (WTR::TestController::resetPreferencesToConsistentValues): LayoutTests: Replace uses of testRunner.overridePreference("WebKitTabToLinksPreferenceKey", ...) and testRunner.setSpatialNavigationEnabled(...) with test header commands, helping to reduce the number of different ways we have to override preferences in LayoutTests. * accessibility/mac/caret-browsing-tab-selection.html: * accessibility/mac/focus-setting-selection-syncronizing-not-clearing.html: * accessibility/mac/selection-element-tabbing-to-link.html: * accessibility/mac/selection-notification-focus-change.html: * accessibility/mac/tab-focus-post-notification.html: * fast/events/tab-focus-anchor.html: * fast/events/tab-focus-link-in-canvas.html: * fast/spatial-navigation/snav-1st-stop.html: * fast/spatial-navigation/snav-clipped-overflowed-content.html: * fast/spatial-navigation/snav-container-only-white-space.html: * fast/spatial-navigation/snav-container-white-space.html: * fast/spatial-navigation/snav-display-contents-crash.html: * fast/spatial-navigation/snav-div-overflow-scrol-hidden.html: * fast/spatial-navigation/snav-div-scrollable-but-without-focusable-content.html: * fast/spatial-navigation/snav-fully-aligned-horizontally.html: * fast/spatial-navigation/snav-fully-aligned-vertically.html: * fast/spatial-navigation/snav-hidden-focusable-element.html: * fast/spatial-navigation/snav-hidden-iframe-zero-size.html: * fast/spatial-navigation/snav-hidden-iframe.html: * fast/spatial-navigation/snav-iframe-flattening-simple.html: * fast/spatial-navigation/snav-iframe-nested.html: * fast/spatial-navigation/snav-iframe-no-focusable-content.html: * fast/spatial-navigation/snav-iframe-no-scrollable-content.html: * fast/spatial-navigation/snav-iframe-recursive-offset-parent.html: * fast/spatial-navigation/snav-iframe-with-offscreen-focusable-element.html: * fast/spatial-navigation/snav-imagemap-area-not-focusable.html: * fast/spatial-navigation/snav-imagemap-area-without-image.html: * fast/spatial-navigation/snav-imagemap-overlapped-areas.html: * fast/spatial-navigation/snav-imagemap-simple.html: * fast/spatial-navigation/snav-input.html: * fast/spatial-navigation/snav-media-elements.html: * fast/spatial-navigation/snav-multiple-select-focusring.html: * fast/spatial-navigation/snav-multiple-select-optgroup.html: * fast/spatial-navigation/snav-multiple-select.html: * fast/spatial-navigation/snav-offscreen-content.html: * fast/spatial-navigation/snav-only-clipped-overflow-content.html: * fast/spatial-navigation/snav-radio-group.html: * fast/spatial-navigation/snav-radio.html: * fast/spatial-navigation/snav-search-optimization.html: * fast/spatial-navigation/snav-simple-content-overflow.html: * fast/spatial-navigation/snav-single-select-list.html: * fast/spatial-navigation/snav-single-select.html: * fast/spatial-navigation/snav-table-traversal.html: * fast/spatial-navigation/snav-textarea.html: * fast/spatial-navigation/snav-tiny-table-traversal.html: * fast/spatial-navigation/snav-two-elements-one-line.html: * fast/spatial-navigation/snav-unit-overflow-and-scroll-in-direction.html: * fast/spatial-navigation/snav-z-index.html: * fast/spatial-navigation/snav-zero-margin-content.html: * media/media-controls-accessibility.html: * media/tab-focus-inside-media-elements.html: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@269111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 60d8a70 commit 43721a2

File tree

75 files changed

+194
-210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+194
-210
lines changed

LayoutTests/ChangeLog

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,66 @@
1+
2020-10-28 Sam Weinig <[email protected]>
2+
3+
Reduce Preference Override Methods: TabsToLinks/SpatialNavigation
4+
https://bugs.webkit.org/show_bug.cgi?id=218288
5+
6+
Reviewed by Tim Horton.
7+
8+
Replace uses of testRunner.overridePreference("WebKitTabToLinksPreferenceKey", ...) and
9+
testRunner.setSpatialNavigationEnabled(...) with test header commands, helping to reduce
10+
the number of different ways we have to override preferences in LayoutTests.
11+
12+
* accessibility/mac/caret-browsing-tab-selection.html:
13+
* accessibility/mac/focus-setting-selection-syncronizing-not-clearing.html:
14+
* accessibility/mac/selection-element-tabbing-to-link.html:
15+
* accessibility/mac/selection-notification-focus-change.html:
16+
* accessibility/mac/tab-focus-post-notification.html:
17+
* fast/events/tab-focus-anchor.html:
18+
* fast/events/tab-focus-link-in-canvas.html:
19+
* fast/spatial-navigation/snav-1st-stop.html:
20+
* fast/spatial-navigation/snav-clipped-overflowed-content.html:
21+
* fast/spatial-navigation/snav-container-only-white-space.html:
22+
* fast/spatial-navigation/snav-container-white-space.html:
23+
* fast/spatial-navigation/snav-display-contents-crash.html:
24+
* fast/spatial-navigation/snav-div-overflow-scrol-hidden.html:
25+
* fast/spatial-navigation/snav-div-scrollable-but-without-focusable-content.html:
26+
* fast/spatial-navigation/snav-fully-aligned-horizontally.html:
27+
* fast/spatial-navigation/snav-fully-aligned-vertically.html:
28+
* fast/spatial-navigation/snav-hidden-focusable-element.html:
29+
* fast/spatial-navigation/snav-hidden-iframe-zero-size.html:
30+
* fast/spatial-navigation/snav-hidden-iframe.html:
31+
* fast/spatial-navigation/snav-iframe-flattening-simple.html:
32+
* fast/spatial-navigation/snav-iframe-nested.html:
33+
* fast/spatial-navigation/snav-iframe-no-focusable-content.html:
34+
* fast/spatial-navigation/snav-iframe-no-scrollable-content.html:
35+
* fast/spatial-navigation/snav-iframe-recursive-offset-parent.html:
36+
* fast/spatial-navigation/snav-iframe-with-offscreen-focusable-element.html:
37+
* fast/spatial-navigation/snav-imagemap-area-not-focusable.html:
38+
* fast/spatial-navigation/snav-imagemap-area-without-image.html:
39+
* fast/spatial-navigation/snav-imagemap-overlapped-areas.html:
40+
* fast/spatial-navigation/snav-imagemap-simple.html:
41+
* fast/spatial-navigation/snav-input.html:
42+
* fast/spatial-navigation/snav-media-elements.html:
43+
* fast/spatial-navigation/snav-multiple-select-focusring.html:
44+
* fast/spatial-navigation/snav-multiple-select-optgroup.html:
45+
* fast/spatial-navigation/snav-multiple-select.html:
46+
* fast/spatial-navigation/snav-offscreen-content.html:
47+
* fast/spatial-navigation/snav-only-clipped-overflow-content.html:
48+
* fast/spatial-navigation/snav-radio-group.html:
49+
* fast/spatial-navigation/snav-radio.html:
50+
* fast/spatial-navigation/snav-search-optimization.html:
51+
* fast/spatial-navigation/snav-simple-content-overflow.html:
52+
* fast/spatial-navigation/snav-single-select-list.html:
53+
* fast/spatial-navigation/snav-single-select.html:
54+
* fast/spatial-navigation/snav-table-traversal.html:
55+
* fast/spatial-navigation/snav-textarea.html:
56+
* fast/spatial-navigation/snav-tiny-table-traversal.html:
57+
* fast/spatial-navigation/snav-two-elements-one-line.html:
58+
* fast/spatial-navigation/snav-unit-overflow-and-scroll-in-direction.html:
59+
* fast/spatial-navigation/snav-z-index.html:
60+
* fast/spatial-navigation/snav-zero-margin-content.html:
61+
* media/media-controls-accessibility.html:
62+
* media/tab-focus-inside-media-elements.html:
63+
164
2020-10-28 Chris Dumez <[email protected]>
265

366
AudioBuffer channels should be neuterable / detachable

LayoutTests/accessibility/mac/caret-browsing-tab-selection.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
1+
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- webkit-test-runner [ TabsToLinks=true ] -->
22
<html>
33
<head>
44
<script src="../../resources/js-test-pre.js"></script>
@@ -12,8 +12,6 @@
1212
<script>
1313
description("This tests caret browsing for html select elements.");
1414
if (window.testRunner) {
15-
16-
testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
1715
testRunner.dumpAsText();
1816

1917
if (window.accessibilityController && window.eventSender) {

LayoutTests/accessibility/mac/focus-setting-selection-syncronizing-not-clearing.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
1+
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- webkit-test-runner [ TabsToLinks=true ] -->
22
<html>
33
<head>
44
<script src="../../resources/js-test.js"></script>
@@ -61,7 +61,6 @@
6161

6262
if (window.accessibilityController) {
6363
jsTestIsAsync = true;
64-
testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
6564

6665
accessibilityController.enableEnhancedAccessibility(true);
6766
webArea = accessibilityController.rootElement.childAtIndex(0);

LayoutTests/accessibility/mac/selection-element-tabbing-to-link.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
1+
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- webkit-test-runner [ TabsToLinks=true ] -->
22
<html>
33
<head>
44
<script src="../../resources/js-test.js"></script>
@@ -55,7 +55,6 @@
5555

5656
if (window.accessibilityController) {
5757
jsTestIsAsync = true;
58-
testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
5958

6059
accessibilityController.enableEnhancedAccessibility(true);
6160
webArea = accessibilityController.rootElement.childAtIndex(0);

LayoutTests/accessibility/mac/selection-notification-focus-change.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!DOCTYPE html><!-- webkit-test-runner [ TabsToLinks=true ] -->
22
<html>
33
<head>
44
<script src="../../resources/js-test-pre.js"></script>
@@ -37,8 +37,6 @@
3737
}
3838

3939
function runFirstTabMoveTest() {
40-
testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
41-
4240
accessibilityController.enableEnhancedAccessibility(true);
4341
webArea = accessibilityController.rootElement.childAtIndex(0);
4442
webArea.setBoolAttributeValue("AXCaretBrowsingEnabled", true)

LayoutTests/accessibility/mac/tab-focus-post-notification.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html><!-- webkit-test-runner [ TabsToLinks=true ] -->
12
<html>
23
<head>
34
<script src="../../resources/js-test-pre.js"></script>
@@ -25,8 +26,6 @@
2526
description("This tests that tabbing focus onto elements will send out notifications");
2627

2728
if (window.testRunner && window.accessibilityController) {
28-
29-
testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
3029
accessibilityController.enableEnhancedAccessibility(true);
3130

3231
var count = 0;

LayoutTests/fast/events/tab-focus-anchor.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!DOCTYPE html><!-- webkit-test-runner [ TabsToLinks=false ] -->
22
<html>
33
<head>
44
<script>
@@ -17,7 +17,6 @@
1717

1818
if (window.testRunner) {
1919
testRunner.dumpAsText();
20-
testRunner.overridePreference('WebKitTabToLinksPreferenceKey', false);
2120
}
2221

2322
window.onload = function()

LayoutTests/fast/events/tab-focus-link-in-canvas.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!DOCTYPE html><!-- webkit-test-runner [ TabsToLinks=true ] -->
22
<html>
33
<head>
44
<script src="../../resources/js-test-pre.js"></script>
@@ -16,7 +16,6 @@
1616

1717
if (window.testRunner && window.eventSender) {
1818
testRunner.dumpAsText();
19-
testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
2019

2120
document.getElementById('before').focus();
2221
shouldBe('document.activeElement.id', '"before"');

LayoutTests/fast/spatial-navigation/snav-1st-stop.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html><!-- webkit-test-runner [ TabsToLinks=true SpatialNavigationEnabled=true ] -->
12
<html>
23
<!--
34
This test ensures the correctness of Spatial Navigation (SNav) algorithm from a non-focus scenario.
@@ -21,8 +22,6 @@
2122

2223
if (window.testRunner) {
2324
testRunner.dumpAsText();
24-
testRunner.setSpatialNavigationEnabled(true);
25-
testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
2625
testRunner.waitUntilDone();
2726
}
2827

LayoutTests/fast/spatial-navigation/snav-clipped-overflowed-content.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html><!-- webkit-test-runner [ TabsToLinks=true SpatialNavigationEnabled=true ] -->
12
<html>
23
<!--
34
This test ensures the correctness of a basic aspect of spatial navigation traversal
@@ -48,8 +49,6 @@
4849

4950
if (window.testRunner) {
5051
testRunner.dumpAsText();
51-
testRunner.setSpatialNavigationEnabled(true);
52-
testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
5352
testRunner.waitUntilDone();
5453
}
5554

0 commit comments

Comments
 (0)