Changeset 50315 in webkit
- Timestamp:
- Oct 29, 2009 7:39:01 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r50314 r50315 1 2009-10-29 Erik Arvidsson <arv@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Make links mouse focusable only on GTK and QT. 6 7 Links are now always mouse focusable on GTK and QT. On other platforms 8 the link needs a tabIndex or it needs to be contentEditable. 9 10 https://bugs.webkit.org/show_bug.cgi?id=26856 11 12 * fast/events/click-focus-anchor-expected.txt: 13 * fast/events/click-focus-anchor.html: 14 * platform/gtk/fast/events/click-focus-anchor-expected.txt: Added. 15 * platform/mac/fast/events/click-focus-anchor-expected.txt: Removed. 16 * platform/qt/fast/events/click-focus-anchor-expected.txt: Added. 17 1 18 2009-10-29 Jonathan Dixon <joth@chromium.org> 2 19 -
trunk/LayoutTests/fast/events/click-focus-anchor-expected.txt
r49619 r50315 1 1 This test ensures that we can click to focus an a element. Click on the element below. 2 2 3 Focusable anchor with tab index 4 5 Focusable anchor 3 The expected result is platform specific. GTK and QT allows all links to be mouse focusable. 6 4 7 5 Result 8 6 9 PASS 10 PASS 7 8 a1 received focus (focusable) 9 a4 received focus (focusable) 10 a5 received focus (focusable) -
trunk/LayoutTests/fast/events/click-focus-anchor.html
r49914 r50315 8 8 Click on the element below. 9 9 10 <p><a tabindex=0 onfocus="pass('r1')" id=t1>Focusable anchor with tab index</a> 11 <p><a onfocus="pass('r2')" id=t2 href="#">Focusable anchor</a> 10 <p>The expected result is platform specific. GTK and QT allows all links to be 11 mouse focusable. 12 13 <div id=test-container> 14 <p><a id=a1 tabindex=0 title="focusable">Anchor with tab index</a> 15 <p><a id=a2 title="not focusable">Anchor without tab index</a> 16 <p><a id=a3 href="#" title="focusable on GTK and QT">Link without tab index</a> 17 <p><a id=a4 href="#" tabindex=0 title="focusable">Link with tab index</a> 18 <p><a id=a5 href="#" contentEditable title="focusable">Link with contentEditable</a> 19 <p contentEditable><a id=a6 href="#" focusable="not focusable">Link inside contentEditable</a> 20 </div> 12 21 13 22 <p>Result 14 23 15 <pre id=r1>FAIL</pre> 16 <pre id=r2>FAIL</pre> 24 <pre id=out></pre> 17 25 18 26 <script> 19 27 20 function pass(id)28 function log(s) 21 29 { 22 var el = document.getElementById(id); 23 el.textContent = 'PASS'; 30 var el = document.getElementById('out'); 31 el.textContent += '\n' + s; 32 } 33 34 function handleFocus(e) 35 { 36 var el = e.target; 37 log(el.id + ' received focus (' + el.title + ')'); 24 38 } 25 39 26 40 if (window.layoutTestController) { 27 41 layoutTestController.dumpAsText(); 28 layoutTestController.overridePreference('WebKitTabToLinksPreferenceKey', false);29 42 } 30 43 … … 34 47 return; 35 48 36 var aElement = document.getElementById('t1'); 37 eventSender.mouseMoveTo(aElement.offsetLeft + 2, aElement.offsetTop + 2); 38 eventSender.mouseDown(); 39 eventSender.mouseUp(); 49 for (var i = 1; i <= 6; i++) { 50 var aElement = document.getElementById('a' + i); 51 aElement.onfocus = handleFocus; 52 eventSender.mouseMoveTo(aElement.offsetLeft + 2, aElement.offsetTop + 2); 53 eventSender.mouseDown(); 54 eventSender.mouseUp(); 55 } 40 56 41 aElement = document.getElementById('t2'); 42 eventSender.mouseMoveTo(aElement.offsetLeft + 2, aElement.offsetTop + 2); 43 eventSender.mouseDown(); 44 eventSender.mouseUp(); 57 var tc = document.getElementById('test-container'); 58 tc.parentNode.removeChild(tc); 45 59 }; 46 60 -
trunk/WebCore/ChangeLog
r50312 r50315 1 2009-10-29 Erik Arvidsson <arv@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Make links mouse focusable only on GTK and QT. 6 7 Links are now always mouse focusable on GTK and QT. On other platforms 8 the link needs a tabIndex or it needs to be contentEditable. 9 10 https://bugs.webkit.org/show_bug.cgi?id=26856 11 12 * html/HTMLAnchorElement.cpp: 13 (WebCore::HTMLAnchorElement::isMouseFocusable): 14 1 15 2009-10-29 Dan Bernstein <mitz@apple.com> 2 16 -
trunk/WebCore/html/HTMLAnchorElement.cpp
r49809 r50315 70 70 { 71 71 // Anchor elements should be mouse focusable, https://bugs.webkit.org/show_bug.cgi?id=26856 72 #if PLATFORM(MAC)72 #if !PLATFORM(GTK) && !PLATFORM(QT) 73 73 if (isLink()) 74 return false; 74 // Only allow links with tabIndex or contentEditable to be mouse focusable. 75 return HTMLElement::supportsFocus(); 75 76 #endif 77 76 78 // Allow tab index etc to control focus. 77 79 return HTMLElement::isMouseFocusable();
Note: See TracChangeset
for help on using the changeset viewer.