Bug 15088 - HTMLOptionElement.selected returns false when parent HTMLSelectElement is "display: none" until parent's .selectedIndex is accessed
Summary: HTMLOptionElement.selected returns false when parent HTMLSelectElement is "di...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 523.x (Safari 3)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords: HasReduction
Depends on: 15366
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-27 01:28 PDT by Mark Rowe (bdash)
Modified: 2007-10-09 05:26 PDT (History)
1 user (show)

See Also:


Attachments
Test case (703 bytes, text/html)
2007-08-27 01:31 PDT, Mark Rowe (bdash)
no flags Details
First attempt (3.68 KB, patch)
2007-08-27 11:27 PDT, Rob Buis
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Rowe (bdash) 2007-08-27 01:28:27 PDT
I noticed this bug while reading over the jQuery source code.

        <select id='theSelect' style='display: none'>
            <option id='theOption'>The Option</option>
        </select>

Accessing theOption.selected returns false until theSelect.selectedIndex is accessed, in which case it switches to returning true.
Comment 1 Mark Rowe (bdash) 2007-08-27 01:31:23 PDT
Created attachment 16129 [details]
Test case

Test case.  Expected result would be "true, true" as per Firefox and common sense.
Comment 2 Rob Buis 2007-08-27 11:27:54 PDT
Created attachment 16134 [details]
First attempt

Hopefully this is the best place to do it :)
Cheers,

Rob.
Comment 3 Adam Roben (:aroben) 2007-09-28 12:13:58 PDT
Comment on attachment 16134 [details]
First attempt

This looks fine to me, but it'd be nice for Adele to take a look as well.
Comment 4 Maciej Stachowiak 2007-09-29 20:42:07 PDT
Comment on attachment 16134 [details]
First attempt

r=me for feature branch
Comment 5 Rob Buis 2007-10-05 00:55:50 PDT
Currently landing on fb is blocked by bug 15366.
Cheers,

Rob.
Comment 6 Rob Buis 2007-10-09 05:26:25 PDT
Landed in r26156 on fb.