Bug 15088

Summary: HTMLOptionElement.selected returns false when parent HTMLSelectElement is "display: none" until parent's .selectedIndex is accessed
Product: WebKit Reporter: Mark Rowe (bdash) <mrowe>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ap
Priority: P2 Keywords: HasReduction
Version: 523.x (Safari 3)   
Hardware: Mac   
OS: OS X 10.5   
Bug Depends on: 15366    
Bug Blocks:    
Attachments:
Description Flags
Test case
none
First attempt mjs: review+

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.