зеркало из https://github.com/mozilla/gecko-dev.git
169354c54c
When Escape key is pressed, nsAutoCompleteController needs to restore last string which was default value of the input or typed by the user. However, somebody may change the value, e.g., an event listener which handles Escape key. In this case, nsAutoCompleteController shouldn't restore the last string. Unfortunately, when JS sets input value, DOM "input" event won't be fired. Therefore, nsAutoCompleteController doesn't have a chance to modify mSearchString in this case. Therefore, nsAutoCompleteController needs to store expected input string for checking if somebody modified the input value. For solving this issue, this patch adds a new member, mSetValue which is modified when the input value is modified by nsAutoCompleteController itself or mSearchString is modified. Even with this patch, if user temporarily selects an item of the popup and JS sets same value as the selected item from JS, nsAutoCompleteController restores the input value with mSearchString. However, this must be rare case and I don't have idea to fix this issue with simple patches. MozReview-Commit-ID: lig8c7xvD7 --HG-- extra : rebase_source : 787dbfb35bc70d27fb09ec93861164e7a5165be3 |
||
---|---|---|
.. | ||
tests/unit | ||
moz.build | ||
nsAutoCompleteController.cpp | ||
nsAutoCompleteController.h | ||
nsAutoCompleteSimpleResult.cpp | ||
nsAutoCompleteSimpleResult.h | ||
nsIAutoCompleteController.idl | ||
nsIAutoCompleteInput.idl | ||
nsIAutoCompletePopup.idl | ||
nsIAutoCompleteResult.idl | ||
nsIAutoCompleteSearch.idl | ||
nsIAutoCompleteSimpleResult.idl |