Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: webkit/glue/editor_client_impl.cc

Issue 159516: [chromium-reviews] Fix for spell check underlines disappearing when user clicks out of the Text ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // The Mac interface forwards most of these commands to the application layer, 5 // The Mac interface forwards most of these commands to the application layer,
6 // and I'm not really sure what to do about most of them. 6 // and I'm not really sure what to do about most of them.
7 7
8 #include "config.h" 8 #include "config.h"
9 #include "webkit/glue/editor_client_impl.h" 9 #include "webkit/glue/editor_client_impl.h"
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 const WebCore::Frame* frame = web_view_->GetFocusedWebCoreFrame(); 123 const WebCore::Frame* frame = web_view_->GetFocusedWebCoreFrame();
124 if (!frame) 124 if (!frame)
125 return false; 125 return false;
126 const WebCore::Editor* editor = frame->editor(); 126 const WebCore::Editor* editor = frame->editor();
127 if (!editor) 127 if (!editor)
128 return false; 128 return false;
129 const WebCore::Document* document = frame->document(); 129 const WebCore::Document* document = frame->document();
130 if (!document) 130 if (!document)
131 return false; 131 return false;
132 const WebCore::Node* node = document->focusedNode(); 132 const WebCore::Node* node = document->focusedNode();
133 // If |node| is NULL, we default to allowing spellchecking. This is done in
134 // order to mitigate the issue when the user clicks outside the textbox, as a
135 // result of which |node| becomes NULL, resulting in all the spell check
136 // markers being deleted. Also, the Frame will decide not to do spellchecking
137 // if the user can't edit - so returning true here will not cause any problems
138 // to the Frame's behavior.
133 if (!node) 139 if (!node)
134 return false; 140 return true;
135 const WebCore::RenderObject* renderer = node->renderer(); 141 const WebCore::RenderObject* renderer = node->renderer();
136 if (!renderer) 142 if (!renderer)
137 return false; 143 return false;
138 144
139 return (!renderer->isTextField() && editor->canEdit()); 145 return !renderer->isTextField();
140 } 146 }
141 147
142 bool EditorClientImpl::isContinuousSpellCheckingEnabled() { 148 bool EditorClientImpl::isContinuousSpellCheckingEnabled() {
143 if (spell_check_this_field_status_ == SPELLCHECK_FORCED_OFF) 149 if (spell_check_this_field_status_ == SPELLCHECK_FORCED_OFF)
144 return false; 150 return false;
145 else if (spell_check_this_field_status_ == SPELLCHECK_FORCED_ON) 151 else if (spell_check_this_field_status_ == SPELLCHECK_FORCED_ON)
146 return true; 152 return true;
147 else 153 else
148 return ShouldSpellcheckByDefault(); 154 return ShouldSpellcheckByDefault();
149 } 155 }
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 } 1016 }
1011 return L"(UNKNOWN AFFINITY)"; 1017 return L"(UNKNOWN AFFINITY)";
1012 } 1018 }
1013 1019
1014 std::wstring EditorClientImpl::Describe(WebCore::CSSStyleDeclaration* style) { 1020 std::wstring EditorClientImpl::Describe(WebCore::CSSStyleDeclaration* style) {
1015 // TODO(pamg): Implement me. It's not clear what WebKit produces for this 1021 // TODO(pamg): Implement me. It's not clear what WebKit produces for this
1016 // (their [style description] method), and none of the layout tests provide 1022 // (their [style description] method), and none of the layout tests provide
1017 // an example. But because none of them use it, it's not yet important. 1023 // an example. But because none of them use it, it's not yet important.
1018 return std::wstring(); 1024 return std::wstring();
1019 } 1025 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698