Bug 99523 - HTMLSelectElement::optionSelectedByUser confuses listIndex and optionIndex
Summary: HTMLSelectElement::optionSelectedByUser confuses listIndex and optionIndex
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-10-16 16:23 PDT by Joseph Pecoraro
Modified: 2012-10-16 17:47 PDT (History)
5 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (4.94 KB, patch)
2012-10-16 16:32 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2012-10-16 16:23:40 PDT
HTMLSelectElement::optionSelectedByUser confuses listIndex and optionIndex.

This breaks the ObjC binding to select element which call that method directly:
-[DOMHTMLSelectElement _activateItemAtIndex:allowMultipleSelection:].
Comment 1 Joseph Pecoraro 2012-10-16 16:30:45 PDT
<rdar://problem/12363971>
Comment 2 Joseph Pecoraro 2012-10-16 16:32:03 PDT
Created attachment 169054 [details]
[PATCH] Proposed Fix

Without the patch, the test fails with the following output:

    Select multiple indexes, with multi-select on, in a <select multiple> with <optgroup>s.
    ** change event fired **
    ** change event fired **
    FAIL - option 0 was not what we expected.
    FAIL - option 2 was not what we expected.
Comment 3 Darin Adler 2012-10-16 17:18:01 PDT
Great fix!
Comment 4 WebKit Review Bot 2012-10-16 17:24:25 PDT
Comment on attachment 169054 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 169054

Committed r131534: <http://trac.webkit.org/changeset/131534>
Comment 5 WebKit Review Bot 2012-10-16 17:24:28 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Kent Tamura 2012-10-16 17:47:03 PDT
We should give different types to optionIndex and listIndex.  At least typedefs, ideally their own classes...