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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/click-focus-anchor.html

Issue 342071: Fix persistent focus rings on anchor elements on the 223 branch.... (Closed) Base URL: svn://chrome-svn/chrome/branches/223/src/
Patch Set: Created 11 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 | third_party/WebKit/LayoutTests/fast/events/click-focus-anchor-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/events/click-focus-anchor.html
===================================================================
--- third_party/WebKit/LayoutTests/fast/events/click-focus-anchor.html (revision 30623)
+++ third_party/WebKit/LayoutTests/fast/events/click-focus-anchor.html (working copy)
@@ -7,25 +7,38 @@
<p>This test ensures that we can click to focus an a element.
Click on the element below.
-<p><a tabindex=0 onfocus="pass('r1')" id=t1>Focusable anchor with tab index</a>
-<p><a onfocus="pass('r2')" id=t2 href="#">Focusable anchor</a>
+<p>The expected result is platform specific. GTK and QT allows all links to be
+mouse focusable.
+<div id=test-container>
+<p><a id=a1 tabindex=0 title="focusable">Anchor with tab index</a>
+<p><a id=a2 title="not focusable">Anchor without tab index</a>
+<p><a id=a3 href="#" title="focusable on GTK and QT">Link without tab index</a>
+<p><a id=a4 href="#" tabindex=0 title="focusable">Link with tab index</a>
+<p><a id=a5 href="#" contentEditable title="focusable">Link with contentEditable</a>
+<p contentEditable><a id=a6 href="#" focusable="not focusable">Link inside contentEditable</a>
+</div>
+
<p>Result
-<pre id=r1>FAIL</pre>
-<pre id=r2>FAIL</pre>
+<pre id=out></pre>
<script>
-function pass(id)
+function log(s)
{
- var el = document.getElementById(id);
- el.textContent = 'PASS';
+ var el = document.getElementById('out');
+ el.textContent += '\n' + s;
}
+function handleFocus(e)
+{
+ var el = e.target;
+ log(el.id + ' received focus (' + el.title + ')');
+}
+
if (window.layoutTestController) {
layoutTestController.dumpAsText();
- layoutTestController.overridePreference('WebKitTabToLinksPreferenceKey', false);
}
window.onload = function()
@@ -33,13 +46,16 @@
if (!window.layoutTestController)
return;
- var aElement = document.getElementById('t1');
- eventSender.mouseMoveTo(aElement.offsetLeft + 2, aElement.offsetTop + 2);
- eventSender.mouseDown();
+ for (var i = 1; i <= 6; i++) {
+ var aElement = document.getElementById('a' + i);
+ aElement.onfocus = handleFocus;
+ eventSender.mouseMoveTo(aElement.offsetLeft + 2, aElement.offsetTop + 2);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ }
- aElement = document.getElementById('t2');
- eventSender.mouseMoveTo(aElement.offsetLeft + 2, aElement.offsetTop + 2);
- eventSender.mouseDown();
+ var tc = document.getElementById('test-container');
+ tc.parentNode.removeChild(tc);
};
</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/events/click-focus-anchor-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698