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