Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: LayoutTests/fast/dom/fragment-activation-focuses-target.html

Issue 637323002: Focus unfocusable node upon reference fragment navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove "focusable node" from test expectation Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/fragment-activation-focuses-target-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/fragment-activation-focuses-target.html
diff --git a/LayoutTests/fast/dom/fragment-activation-focuses-target.html b/LayoutTests/fast/dom/fragment-activation-focuses-target.html
index 0043cdb83068c196550947983fb167d5f75a5249..8bf03284dabb23743e7c97ce3db0e15eba3198a2 100644
--- a/LayoutTests/fast/dom/fragment-activation-focuses-target.html
+++ b/LayoutTests/fast/dom/fragment-activation-focuses-target.html
@@ -6,6 +6,9 @@
<body>
<a href="#fragment1" id="link1" tabindex="0">link1</a>
<a href="#fragment2" id="link2" tabindex="0">link2</a>
+ <a href="#fragment3" id="link3" tabindex="0">link3</a>
+ <a href="#top" id="link4" tabindex="0">link4</a>
+ <a href="#" id="link5" tabindex="0">link5</a>
<br><br>
<div id="fragment1" name="fragment1" tabindex="0">fragment1</div>
<div id="fragment2" name="fragment2">fragment2</div>
@@ -31,12 +34,33 @@
shouldBe("document.activeElement", "document.getElementById('fragment1')");
}
- debug("Activate a link that does not have a focusable fragment and verify focus does not move.");
+ debug("Activate a link that does not have a focusable fragment and verify that the currently focused element is unfocused.");
var link2 = document.getElementById("link2");
link2.focus();
shouldBe("document.activeElement", "link2");
link2.click();
- shouldBe("document.activeElement", "link2");
+ shouldBe("document.activeElement", "document.body");
+
+ debug("Activate a link that does not refer to an existing fragment and verify that the currently focused element remains focused.");
+ var link3 = document.getElementById("link3");
+ link3.focus();
+ shouldBe("document.activeElement", "link3");
+ link3.click();
+ shouldBe("document.activeElement", "link3");
+
+ debug("Activate a link to #top and verify that the link remains focused");
+ var link4 = document.getElementById("link4");
+ link4.focus();
+ shouldBe("document.activeElement", "link4");
+ link4.click();
+ shouldBe("document.activeElement", "link4");
+
+ debug("Activate a link to # and verify that the link remains focused");
+ var link5 = document.getElementById("link5");
+ link5.focus();
+ shouldBe("document.activeElement", "link5");
+ link5.click();
+ shouldBe("document.activeElement", "link5");
var successfullyParsed = true;
</script>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/fragment-activation-focuses-target-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698