Changeset 69078 in webkit
- Timestamp:
- Oct 4, 2010 10:43:54 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r69077 r69078 1 2010-10-04 Yael Aharon <yael.aharon@nokia.com> 2 3 Reviewed by Antonio Gomes. 4 5 Spatial Navigation: Add support for <input type="radio"> 6 https://bugs.webkit.org/show_bug.cgi?id=46993 7 8 * fast/events/spatial-navigation/snav-radio-expected.txt: Added. 9 * fast/events/spatial-navigation/snav-radio-group-expected.txt: Added. 10 * fast/events/spatial-navigation/snav-radio-group.html: Added. 11 * fast/events/spatial-navigation/snav-radio.html: Added. 12 1 13 2010-10-04 Renata Hodovan <reni@inf.u-szeged.hu> 2 14 -
trunk/WebCore/ChangeLog
r69077 r69078 1 2010-10-04 Yael Aharon <yael.aharon@nokia.com> 2 3 Reviewed by Antonio Gomes. 4 5 Spatial Navigation: Add support for <input type="radio"> 6 https://bugs.webkit.org/show_bug.cgi?id=46993 7 8 When using Spatial Navigation, every radio button should be focusable and 9 users should be able to navigate from one button to the next without moving the selection. 10 11 Tests: fast/events/spatial-navigation/snav-radio-group.html 12 fast/events/spatial-navigation/snav-radio.html 13 14 * html/HTMLInputElement.cpp: 15 (WebCore::HTMLInputElement::isKeyboardFocusable): 16 Every radio button should be keyboard focusable, if using Spatial Navigation. 17 (WebCore::HTMLInputElement::defaultEventHandler): 18 Disable the algorithm for selecting the next radio button within a group, if using Spatial Navigation. 19 1 20 2010-10-04 Renata Hodovan <reni@inf.u-szeged.hu> 2 21 -
trunk/WebCore/html/HTMLInputElement.cpp
r68996 r69078 66 66 #include "RenderTheme.h" 67 67 #include "ScriptEventListener.h" 68 #include "Settings.h" 68 69 #include "StepRange.h" 69 70 #include "TextEvent.h" … … 768 769 769 770 if (deprecatedInputType() == RADIO) { 771 // When using Spatial Navigation, every radio button should be focusable. 772 if (document()->frame() && document()->frame()->settings() && document()->frame()->settings()->isSpatialNavigationEnabled()) 773 return true; 770 774 771 775 // Never allow keyboard tabbing to leave you in the same radio group. Always … … 2261 2265 // Tested in WinIE, and even for RTL, left still means previous radio button (and so moves 2262 2266 // to the right). Seems strange, but we'll match it. 2263 bool forward = (key == "Down" || key == "Right"); 2264 2265 // We can only stay within the form's children if the form hasn't been demoted to a leaf because 2266 // of malformed HTML. 2267 Node* n = this; 2268 while ((n = (forward ? n->traverseNextNode() : n->traversePreviousNode()))) { 2269 // Once we encounter a form element, we know we're through. 2270 if (n->hasTagName(formTag)) 2271 break; 2272 2273 // Look for more radio buttons. 2274 if (n->hasTagName(inputTag)) { 2275 HTMLInputElement* elt = static_cast<HTMLInputElement*>(n); 2276 if (elt->form() != form()) 2267 // However, when using Spatial Navigation, we need to be able to navigate without changing the selection. 2268 if (!document()->frame() || !document()->frame()->settings() || !document()->frame()->settings()->isSpatialNavigationEnabled()) { 2269 bool forward = (key == "Down" || key == "Right"); 2270 2271 // We can only stay within the form's children if the form hasn't been demoted to a leaf because 2272 // of malformed HTML. 2273 Node* n = this; 2274 while ((n = (forward ? n->traverseNextNode() : n->traversePreviousNode()))) { 2275 // Once we encounter a form element, we know we're through. 2276 if (n->hasTagName(formTag)) 2277 2277 break; 2278 2279 // Look for more radio buttons. 2278 2280 if (n->hasTagName(inputTag)) { 2279 HTMLInputElement* inputElt = static_cast<HTMLInputElement*>(n); 2280 if (inputElt->deprecatedInputType() == RADIO && inputElt->name() == name() && inputElt->isFocusable()) { 2281 inputElt->setChecked(true); 2282 document()->setFocusedNode(inputElt); 2283 inputElt->dispatchSimulatedClick(evt, false, false); 2284 evt->setDefaultHandled(); 2281 HTMLInputElement* elt = static_cast<HTMLInputElement*>(n); 2282 if (elt->form() != form()) 2285 2283 break; 2284 if (n->hasTagName(inputTag)) { 2285 HTMLInputElement* inputElt = static_cast<HTMLInputElement*>(n); 2286 if (inputElt->deprecatedInputType() == RADIO && inputElt->name() == name() && inputElt->isFocusable()) { 2287 inputElt->setChecked(true); 2288 document()->setFocusedNode(inputElt); 2289 inputElt->dispatchSimulatedClick(evt, false, false); 2290 evt->setDefaultHandled(); 2291 break; 2292 } 2286 2293 } 2287 2294 }
Note: See TracChangeset
for help on using the changeset viewer.