diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-29 01:12:22 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-29 01:12:22 +0000 |
commit | 529c8529aa099e4173ac1ef912069b475f0b01ac (patch) | |
tree | 029a24bd939963ef0604e6d638f12141e7b8c4a7 | |
parent | 985f0e6ba8533b63f508eecdaa0d205c91a8e776 (diff) | |
download | chromium_src-529c8529aa099e4173ac1ef912069b475f0b01ac.zip chromium_src-529c8529aa099e4173ac1ef912069b475f0b01ac.tar.gz chromium_src-529c8529aa099e4173ac1ef912069b475f0b01ac.tar.bz2 |
Fix a bug where we would allow the user to spell check words in
a readonly textarea. This triggered lots of asserts.
Review URL: http://codereview.chromium.org/8860
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4119 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/glue/webview_impl.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/webkit/glue/webview_impl.cc b/webkit/glue/webview_impl.cc index e3bab02..8dfb3f5 100644 --- a/webkit/glue/webview_impl.cc +++ b/webkit/glue/webview_impl.cc @@ -1032,6 +1032,9 @@ bool WebViewImpl::FocusedFrameNeedsSpellchecking() { const WebCore::Frame* frame = GetFocusedWebCoreFrame(); if (!frame) return false; + const WebCore::Editor* editor = frame->editor(); + if (!editor) + return false; const WebCore::Document* document = frame->document(); if (!document) return false; @@ -1044,7 +1047,7 @@ bool WebViewImpl::FocusedFrameNeedsSpellchecking() { // We should also retrieve the contenteditable attribute of this element to // determine if this element needs spell-checking. const WebCore::EUserModify user_modify = renderer->style()->userModify(); - return renderer->isTextArea() || + return (renderer->isTextArea() && editor->canEdit()) || user_modify == WebCore::READ_WRITE || user_modify == WebCore::READ_WRITE_PLAINTEXT_ONLY; } |