| 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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 // 'beforeinput' event handler may destroy target frame. | 848 // 'beforeinput' event handler may destroy target frame. |
| 849 if (currentDocument != frame().document()) | 849 if (currentDocument != frame().document()) |
| 850 return; | 850 return; |
| 851 | 851 |
| 852 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets | 852 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| 853 // needs to be audited. See http://crbug.com/590369 for more details. | 853 // needs to be audited. See http://crbug.com/590369 for more details. |
| 854 frame().document()->updateStyleAndLayoutIgnorePendingStylesheets(); | 854 frame().document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
| 855 | 855 |
| 856 if (cancel) | 856 if (cancel) |
| 857 return; | 857 return; |
| 858 frame().editor().replaceSelectionForSpellChecker(text); | 858 frame().editor().replaceSelectionWithText( |
| 859 text, false, false, InputEvent::InputType::InsertReplacementText); |
| 859 } | 860 } |
| 860 | 861 |
| 861 static bool shouldCheckOldSelection(const Position& oldSelectionStart) { | 862 static bool shouldCheckOldSelection(const Position& oldSelectionStart) { |
| 862 if (!oldSelectionStart.isConnected()) | 863 if (!oldSelectionStart.isConnected()) |
| 863 return false; | 864 return false; |
| 864 if (isPositionInTextField(oldSelectionStart)) | 865 if (isPositionInTextField(oldSelectionStart)) |
| 865 return false; | 866 return false; |
| 866 if (isPositionInTextArea(oldSelectionStart)) | 867 if (isPositionInTextArea(oldSelectionStart)) |
| 867 return true; | 868 return true; |
| 868 | 869 |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1166 startOfNextParagraph(createVisiblePosition(paragraphEnd)); | 1167 startOfNextParagraph(createVisiblePosition(paragraphEnd)); |
| 1167 paragraphStart = newParagraphStart.toParentAnchoredPosition(); | 1168 paragraphStart = newParagraphStart.toParentAnchoredPosition(); |
| 1168 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPosition(); | 1169 paragraphEnd = endOfParagraph(newParagraphStart).toParentAnchoredPosition(); |
| 1169 firstIteration = false; | 1170 firstIteration = false; |
| 1170 totalLengthProcessed += currentLength; | 1171 totalLengthProcessed += currentLength; |
| 1171 } | 1172 } |
| 1172 return std::make_pair(firstFoundItem, firstFoundOffset); | 1173 return std::make_pair(firstFoundItem, firstFoundOffset); |
| 1173 } | 1174 } |
| 1174 | 1175 |
| 1175 } // namespace blink | 1176 } // namespace blink |
| OLD | NEW |