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

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

Issue 701493002: Merge 183455 "Focus unfocusable node upon reference fragment nav..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2171/
Patch Set: Created 6 years, 1 month 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
===================================================================
--- LayoutTests/fast/dom/fragment-activation-focuses-target.html (revision 184784)
+++ LayoutTests/fast/dom/fragment-activation-focuses-target.html (working copy)
@@ -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,13 +34,34 @@
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>
</body>
« 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