[Webkit-unassigned] [Bug 99525] New: Spatial Navigation handling of space key in <select> appears to confuse listIndex and optionIndex

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 16 16:48:12 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=99525

           Summary: Spatial Navigation handling of space key in <select>
                    appears to confuse listIndex and optionIndex
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Forms
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: joepeck at webkit.org
                CC: tkent at chromium.org, cshu at webkit.org


The default key event handler for HTMLSelectElement (HTMLSelectElement::listBoxDefaultEventHandler) attempts to handle the space key with spatial navigation like so:

    } else if (m_multiple && keyCode == ' ' && isSpatialNavigationEnabled(document()->frame())) {
        // Use space to toggle selection change.
        m_activeSelectionState = !m_activeSelectionState;
        updateSelectedState(listToOptionIndex(m_activeSelectionEndIndex), true /*multi*/, false /*shift*/);
        listBoxOnChange();
        event->setDefaultHandled();
    }

This would likely fail in a <select multiple> with <optgroup>s because

    • m_activeSelectionEndIndex is a listIndex
    • updateSelectedState expects a listIndex to be passed in
    • the handler above is converting the listIndex to an optionIndex! This would cause issues if there are optgroups

Proposed fix would be to just remove the listToOptionIndex conversion.

Test page would be something like this:

    <select multiple>
      <optgroup><option>1</option><option>2</option></optgroup>
      <optgroup><option>3</option><option>4</option></optgroup>
    </select>

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list