Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 312 if (spellCheckerClient().spellingUIIsShowing()) { | 312 if (spellCheckerClient().spellingUIIsShowing()) { |
| 313 spellCheckerClient().showSpellingUI(false); | 313 spellCheckerClient().showSpellingUI(false); |
| 314 return; | 314 return; |
| 315 } | 315 } |
| 316 | 316 |
| 317 advanceToNextMisspelling(true); | 317 advanceToNextMisspelling(true); |
| 318 spellCheckerClient().showSpellingUI(true); | 318 spellCheckerClient().showSpellingUI(true); |
| 319 } | 319 } |
| 320 | 320 |
| 321 void SpellChecker::clearMisspellingsForMovingParagraphs( | 321 void SpellChecker::clearMisspellingsForMovingParagraphs( |
| 322 const VisibleSelection& movingSelection) { | 322 const SelectionInDOMTree& movingSelection) { |
| 323 removeMarkers(movingSelection.toNormalizedEphemeralRange(), | 323 removeMarkers( |
| 324 DocumentMarker::MisspellingMarkers()); | 324 createVisibleSelection(movingSelection).toNormalizedEphemeralRange(), |
|
Xiaocheng
2017/03/09 19:14:23
Is there any way to get rid of this canonicalizati
yosin_UTC9
2017/03/10 00:58:00
I guess we can use VS::start/end here.
Or, we get
| |
| 325 DocumentMarker::MisspellingMarkers()); | |
| 325 } | 326 } |
| 326 | 327 |
| 327 void SpellChecker::markMisspellingsForMovingParagraphs( | 328 void SpellChecker::markMisspellingsForMovingParagraphs( |
| 328 const VisibleSelection& movingSelection) { | 329 const VisibleSelection& movingSelection) { |
| 329 if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled()) | 330 if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled()) |
| 330 return; | 331 return; |
| 331 | 332 |
| 332 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets | 333 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| 333 // needs to be audited. See http://crbug.com/590369 for more details. | 334 // needs to be audited. See http://crbug.com/590369 for more details. |
| 334 // In the long term we should use idle time spell checker to prevent | 335 // In the long term we should use idle time spell checker to prevent |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1189 if (!input.isFocusedElementInDocument()) | 1190 if (!input.isFocusedElementInDocument()) |
| 1190 return false; | 1191 return false; |
| 1191 } | 1192 } |
| 1192 } | 1193 } |
| 1193 HTMLElement* element = | 1194 HTMLElement* element = |
| 1194 Traversal<HTMLElement>::firstAncestorOrSelf(*position.anchorNode()); | 1195 Traversal<HTMLElement>::firstAncestorOrSelf(*position.anchorNode()); |
| 1195 return element && element->isSpellCheckingEnabled(); | 1196 return element && element->isSpellCheckingEnabled(); |
| 1196 } | 1197 } |
| 1197 | 1198 |
| 1198 } // namespace blink | 1199 } // namespace blink |
| OLD | NEW |