Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Qt][Wk2] Assertion failure when selecting an option in select list w…
…ith size attribute greater than one https://bugs.webkit.org/show_bug.cgi?id=86974 Patch by Dinu Jacob <dinu.jacob@nokia.com> on 2012-05-23 Reviewed by Simon Hausmann. Select list with size attribute greater than one will not initially have any item in selected state (if no option has 'selected' tag), resulting in m_selectedModelIndex in WebPopupMenuProxyQt to be invalid. Hence, need to check whether the old index is invalid before accessing the item at that index. * UIProcess/API/qt/tests/qmltests/DesktopBehavior/tst_itemSelector.qml: Added new test that tests selection in a select list with size attribute value of 2. * UIProcess/API/qt/tests/qmltests/common/selectwithsize.html: Added. * UIProcess/qt/WebPopupMenuProxyQt.cpp: (WebKit::PopupMenuItemModel::select): Check whether old index is valid before accessing the item at that index. Canonical link: https://commits.webkit.org/105025@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@118228 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
6a8a511
commit 0bb267d
Showing
4 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
Source/WebKit2/UIProcess/API/qt/tests/qmltests/common/selectwithsize.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>No new selection was made</title> | ||
<script> | ||
function updateTitle(selectElement) { | ||
var index = selectElement.selectedIndex; | ||
document.title = selectElement.options[index].value; | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<select size=2 onchange="updateTitle(this)"> | ||
<option value="__open__" >Open</option> | ||
<option value="__closed__" >Closed</option> | ||
<option value="__all__" >All</option> | ||
</select> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters