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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/fragment-activation-focuses-target.html

Issue 1438953002: Update selection when an element is focused by in-document fragment link. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/fragment-activation-focuses-target-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <a href="#fragment1" id="link1" tabindex="0">link1</a> 7 <a href="#fragment1" id="link1" tabindex="0">link1</a>
8 <a href="#fragment2" id="link2" tabindex="0">link2</a> 8 <a href="#fragment2" id="link2" tabindex="0">link2</a>
9 <a href="#fragment3" id="link3" tabindex="0">link3</a> 9 <a href="#fragment3" id="link3" tabindex="0">link3</a>
10 <a href="#top" id="link4" tabindex="0">link4</a> 10 <a href="#top" id="link4" tabindex="0">link4</a>
11 <a href="#" id="link5" tabindex="0">link5</a> 11 <a href="#" id="link5" tabindex="0">link5</a>
12 <a href="#input1" id="link6" tabindex="0">link6</a>
12 <br><br> 13 <br><br>
13 <div id="fragment1" name="fragment1" tabindex="0">fragment1</div> 14 <div id="fragment1" name="fragment1" tabindex="0">fragment1</div>
14 <div id="fragment2" name="fragment2">fragment2</div> 15 <div id="fragment2" name="fragment2">fragment2</div>
16 <input id="input1" value="abcdef">
15 <script> 17 <script>
16 description("This tests that if an in-page link is activated, focus cont rol is transferred to the fragment if possible."); 18 description("This tests that if an in-page link is activated, focus cont rol is transferred to the fragment if possible.");
17 19
18 var link1 = document.getElementById("link1"); 20 var link1 = document.getElementById("link1");
19 link1.focus(); 21 link1.focus();
20 debug("Verify that the focus is on the link."); 22 debug("Verify that the focus is on the link.");
21 shouldBe("document.activeElement", "link1"); 23 shouldBe("document.activeElement", "link1");
22 24
23 link1.click(); 25 link1.click();
24 debug("Click the link and verify that focus has moved to the fragment.") ; 26 debug("Click the link and verify that focus has moved to the fragment.") ;
(...skipping 30 matching lines...) Expand all
55 link4.click(); 57 link4.click();
56 shouldBe("document.activeElement", "link4"); 58 shouldBe("document.activeElement", "link4");
57 59
58 debug("Activate a link to # and verify that the link remains focused"); 60 debug("Activate a link to # and verify that the link remains focused");
59 var link5 = document.getElementById("link5"); 61 var link5 = document.getElementById("link5");
60 link5.focus(); 62 link5.focus();
61 shouldBe("document.activeElement", "link5"); 63 shouldBe("document.activeElement", "link5");
62 link5.click(); 64 link5.click();
63 shouldBe("document.activeElement", "link5"); 65 shouldBe("document.activeElement", "link5");
64 66
67 debug("Activate a link to an INPUT elemnt, verify that the INPUT is edit able");
68 var input1 = document.getElementById("input1");
69 input1.setSelectionRange(3, 3);
70 var link6 = document.getElementById("link6");
71 link6.focus();
72 shouldBe("document.activeElement", "link6");
73 link6.click();
74 shouldBe("document.activeElement", "input1");
75 if (window.eventSender) {
76 eventSender.keyDown('X');
77 shouldBeEqualToString("input1.value", "abcXdef");
78 }
65 var successfullyParsed = true; 79 var successfullyParsed = true;
66 </script> 80 </script>
67 </body> 81 </body>
68 </html> 82 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/fragment-activation-focuses-target-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698