[webkit-reviews] review granted: [Bug 70547] selectedIndex gets set from -1 to 0 when modifying options : [Attachment 112277] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 25 14:49:29 PDT 2011


Darin Adler <darin at apple.com> has granted Jon Lee <jonlee at apple.com>'s request
for review:
Bug 70547: selectedIndex gets set from -1 to 0 when modifying options
https://bugs.webkit.org/show_bug.cgi?id=70547

Attachment 112277: Patch
https://bugs.webkit.org/attachment.cgi?id=112277&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=112277&action=review


> Source/WebCore/html/HTMLOptionElement.cpp:144
> +    bool selectIsMenuList = select && !select->multiple() && select->size()
<= 1;

It’s not great for this to repeat the algorithm for whether the select is a
menu list. Instead, the HTMLSelectElement function that answers that question
could be made public.

> Source/WebCore/html/HTMLOptionElement.cpp:157
> +	   select->setSelectedIndex(oldSelectedIndex);

Is letting the thing get deselected and re-selecting it OK? Are there side
effects? Any extra DOM events that get sent?


More information about the webkit-reviews mailing list