Index: LayoutTests/svg/custom/a-focus-by-tab.html |
diff --git a/LayoutTests/svg/custom/a-focus-by-tab.html b/LayoutTests/svg/custom/a-focus-by-tab.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..339ba2d325f0030eed8ae3a6f6a33663f8024ef0 |
--- /dev/null |
+++ b/LayoutTests/svg/custom/a-focus-by-tab.html |
@@ -0,0 +1,24 @@ |
+<!DOCTYPE html> |
+<html> |
+<body> |
+<input id="input1"> |
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="100" viewBox="0 0 100 100"> |
+<a xlink:href="" id="svg-a"><text>Link</text></a> |
+</svg> |
+<script src="../../fast/js/resources/js-test-pre.js"></script> |
+<script> |
+var input1 = document.getElementById('input1'); |
+var tab = '\t'; |
+testRunner.overridePreference('WebKitTabToLinksPreferenceKey', true); |
+debug('tabToLinks=true'); |
+shouldBe('input1.focus(); document.activeElement', 'input1'); |
+shouldBe('eventSender.keyDown(tab); document.activeElement', 'document.getElementById("svg-a")'); |
+document.activeElement.blur(); |
+ |
+debug('tabToLinks=false'); |
+testRunner.overridePreference('WebKitTabToLinksPreferenceKey', false); |
+shouldBe('input1.focus(); document.activeElement', 'input1'); |
+shouldNotBe('eventSender.keyDown(tab); document.activeElement', 'document.getElementById("svg-a")'); |
+</script> |
+<script src="../../fast/js/resources/js-test-post.js"></script> |
+</body> |