OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 return frame().settings() && frame().settings()->asynchronousSpellCheckingEn
abled(); | 163 return frame().settings() && frame().settings()->asynchronousSpellCheckingEn
abled(); |
164 } | 164 } |
165 | 165 |
166 bool SpellCheckRequester::canCheckAsynchronously(Range* range) const | 166 bool SpellCheckRequester::canCheckAsynchronously(Range* range) const |
167 { | 167 { |
168 return isCheckable(range) && isAsynchronousEnabled(); | 168 return isCheckable(range) && isAsynchronousEnabled(); |
169 } | 169 } |
170 | 170 |
171 bool SpellCheckRequester::isCheckable(Range* range) const | 171 bool SpellCheckRequester::isCheckable(Range* range) const |
172 { | 172 { |
173 if (!range || !range->firstNode() || !range->firstNode()->renderer()) | 173 if (!range || !range->firstNode() || !range->firstNode()->layoutObject()) |
174 return false; | 174 return false; |
175 const Node* node = range->startContainer(); | 175 const Node* node = range->startContainer(); |
176 if (node && node->isElementNode() && !toElement(node)->isSpellCheckingEnable
d()) | 176 if (node && node->isElementNode() && !toElement(node)->isSpellCheckingEnable
d()) |
177 return false; | 177 return false; |
178 return true; | 178 return true; |
179 } | 179 } |
180 | 180 |
181 void SpellCheckRequester::requestCheckingFor(PassRefPtrWillBeRawPtr<SpellCheckRe
quest> request) | 181 void SpellCheckRequester::requestCheckingFor(PassRefPtrWillBeRawPtr<SpellCheckRe
quest> request) |
182 { | 182 { |
183 if (!request || !canCheckAsynchronously(request->paragraphRange().get())) | 183 if (!request || !canCheckAsynchronously(request->paragraphRange().get())) |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 } | 277 } |
278 | 278 |
279 DEFINE_TRACE(SpellCheckRequester) | 279 DEFINE_TRACE(SpellCheckRequester) |
280 { | 280 { |
281 visitor->trace(m_frame); | 281 visitor->trace(m_frame); |
282 visitor->trace(m_processingRequest); | 282 visitor->trace(m_processingRequest); |
283 visitor->trace(m_requestQueue); | 283 visitor->trace(m_requestQueue); |
284 } | 284 } |
285 | 285 |
286 } // namespace blink | 286 } // namespace blink |
OLD | NEW |