diff options
author | xji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-23 16:36:29 +0000 |
---|---|---|
committer | xji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-23 16:36:29 +0000 |
commit | d2b0ab05ce248d278b8ce4124402c631c3ec921d (patch) | |
tree | 218310f24ffb57c50c53e429e36e75a63e4d71d8 /webkit | |
parent | 7cd2fbecfcd81d19a0d028c504adfbc8f2dea0a0 (diff) | |
download | chromium_src-d2b0ab05ce248d278b8ce4124402c631c3ec921d.zip chromium_src-d2b0ab05ce248d278b8ce4124402c631c3ec921d.tar.gz chromium_src-d2b0ab05ce248d278b8ce4124402c631c3ec921d.tar.bz2 |
This CL fixes issue 22712 -- REGRESSION: auto-complete close cause chrome crash.
crashed was caused by a dead loop introduced by a serial webkit changes in PopupMenuClient::hidePopup/PopupDidHide.
Change AutocompletePopupMenuClient::popupDidHide() to call WebViewImpl::AutoCompletePopupDidHide() which only set the popup_showing_ flag instead of calling WebViewImpl::HideAutoCompletePopup().
BUG=http://crbug.com/22712
TEST=
1. Open the following html
<html>
<head>
</head>
<body>
<form action="form_action.asp" method="get">
First name: <input type="text" name="fname" dir="rtl"/><br />
Last name: <input type="text" name="lname" /><br />
<input type="submit" value="Submit" />
</form>
</body>
</html>
2. Type some text in the "First name" input box, for example "abcd"
3. Click "Submit"
4. Open the file again
5. Type the first letter "a" and select "abcd".
6. "abcd" should be selected instead of crashing.
Review URL: http://codereview.chromium.org/223001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26935 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/webview_impl.cc | 8 | ||||
-rw-r--r-- | webkit/glue/webview_impl.h | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc index 89f7e2c..5cb6a29 100644 --- a/webkit/glue/webview_impl.cc +++ b/webkit/glue/webview_impl.cc @@ -234,7 +234,7 @@ class AutocompletePopupMenuClient : public WebCore::PopupMenuClient { return selected_index_; } virtual void popupDidHide() { - webview_->HideAutoCompletePopup(); + webview_->AutoCompletePopupDidHide(); } virtual bool itemIsSeparator(unsigned listIndex) const { return false; @@ -1856,10 +1856,14 @@ void WebViewImpl::DeleteImageResourceFetcher(ImageResourceFetcher* fetcher) { void WebViewImpl::HideAutoCompletePopup() { if (autocomplete_popup_showing_) { autocomplete_popup_->hidePopup(); - autocomplete_popup_showing_ = false; + AutoCompletePopupDidHide(); } } +void WebViewImpl::AutoCompletePopupDidHide() { + autocomplete_popup_showing_ = false; +} + void WebViewImpl::SetIgnoreInputEvents(bool new_value) { DCHECK(ignore_input_events_ != new_value); ignore_input_events_ = new_value; diff --git a/webkit/glue/webview_impl.h b/webkit/glue/webview_impl.h index 5687590..5ecb4cc 100644 --- a/webkit/glue/webview_impl.h +++ b/webkit/glue/webview_impl.h @@ -239,6 +239,7 @@ class WebViewImpl : public WebView, public base::RefCounted<WebViewImpl> { // Hides the autocomplete popup if it is showing. void HideAutoCompletePopup(); + void AutoCompletePopupDidHide(); // Converts |x|, |y| from window coordinates to contents coordinates and gets // the underlying Node for them. |