Summary: | [Qt][Wk2] Assertion failure when selecting an option in select list with size attribute greater than one | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Dinu Jacob <dinu.jacob> | ||||||
Component: | WebKit2 | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | cmarcelo, menard, webkit.review.bot, zoltan | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Dinu Jacob
2012-05-20 16:13:19 PDT
Select list with size attribute value of greater than one and no option pre-selected will not have any option in selected state initially. This will cause m_selectedModelIndex to be -1. On selecting an option from the list will result in accessing an item from the list of options with this invalid index resulting in the assertion. Created attachment 142925 [details]
Patch
Comment on attachment 142925 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=142925&action=review Nice catch! Looks good to me, with a comment. > Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp:192 > + emit dataChanged(this->index(oldIndex), this->index(oldIndex)); I think is better to keep the signal emission where it was, after we update the new selected item. This way, if someone reacts to the dataChanged, our model will be in a consistent state. Created attachment 143562 [details]
Patch
(In reply to comment #3) > (From update of attachment 142925 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=142925&action=review > > Nice catch! Looks good to me, with a comment. > > > Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp:192 > > + emit dataChanged(this->index(oldIndex), this->index(oldIndex)); > > I think is better to keep the signal emission where it was, after we update the new selected item. This way, if someone reacts to the dataChanged, our model will be in a consistent state. Changed to emit the signals after updating the states. Comment on attachment 143562 [details] Patch Clearing flags on attachment: 143562 Committed r118228: <http://trac.webkit.org/changeset/118228> All reviewed patches have been landed. Closing bug. |