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 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 TypingCommand::Options options = 0; | 909 TypingCommand::Options options = 0; |
910 if (selectInsertedText) | 910 if (selectInsertedText) |
911 options |= TypingCommand::SelectInsertedText; | 911 options |= TypingCommand::SelectInsertedText; |
912 if (autocorrectionWasApplied) | 912 if (autocorrectionWasApplied) |
913 options |= TypingCommand::RetainAutocorrectionIndicator; | 913 options |= TypingCommand::RetainAutocorrectionIndicator; |
914 TypingCommand::insertText(document.get(), text, selection, options,
triggeringEvent && triggeringEvent->isComposition() ? TypingCommand::TextComposi
tionConfirm : TypingCommand::TextCompositionNone); | 914 TypingCommand::insertText(document.get(), text, selection, options,
triggeringEvent && triggeringEvent->isComposition() ? TypingCommand::TextComposi
tionConfirm : TypingCommand::TextCompositionNone); |
915 | 915 |
916 // Reveal the current selection | 916 // Reveal the current selection |
917 if (Frame* editedFrame = document->frame()) | 917 if (Frame* editedFrame = document->frame()) |
918 if (Page* page = editedFrame->page()) | 918 if (Page* page = editedFrame->page()) |
919 page->focusController()->focusedOrMainFrame()->selection()->
revealSelection(ScrollAlignment::alignCenterIfNeeded); | 919 page->focusController()->focusedOrMainFrame()->selection()->
revealSelection(ScrollAlignment::alignToEdgeIfNeeded); |
920 } | 920 } |
921 } | 921 } |
922 | 922 |
923 return true; | 923 return true; |
924 } | 924 } |
925 | 925 |
926 bool Editor::insertLineBreak() | 926 bool Editor::insertLineBreak() |
927 { | 927 { |
928 if (!canEdit()) | 928 if (!canEdit()) |
929 return false; | 929 return false; |
(...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2248 LayoutPoint framePoint = frameView->windowToContents(windowPoint); | 2248 LayoutPoint framePoint = frameView->windowToContents(windowPoint); |
2249 VisibleSelection selection(frame->visiblePositionForPoint(framePoint)); | 2249 VisibleSelection selection(frame->visiblePositionForPoint(framePoint)); |
2250 return avoidIntersectionWithNode(selection.toNormalizedRange().get(), m_dele
teButtonController->containerElement()); | 2250 return avoidIntersectionWithNode(selection.toNormalizedRange().get(), m_dele
teButtonController->containerElement()); |
2251 } | 2251 } |
2252 | 2252 |
2253 void Editor::revealSelectionAfterEditingOperation() | 2253 void Editor::revealSelectionAfterEditingOperation() |
2254 { | 2254 { |
2255 if (m_ignoreCompositionSelectionChange) | 2255 if (m_ignoreCompositionSelectionChange) |
2256 return; | 2256 return; |
2257 | 2257 |
2258 m_frame->selection()->revealSelection(ScrollAlignment::alignCenterIfNeeded); | 2258 m_frame->selection()->revealSelection(ScrollAlignment::alignToEdgeIfNeeded); |
2259 } | 2259 } |
2260 | 2260 |
2261 void Editor::setIgnoreCompositionSelectionChange(bool ignore) | 2261 void Editor::setIgnoreCompositionSelectionChange(bool ignore) |
2262 { | 2262 { |
2263 if (m_ignoreCompositionSelectionChange == ignore) | 2263 if (m_ignoreCompositionSelectionChange == ignore) |
2264 return; | 2264 return; |
2265 | 2265 |
2266 m_ignoreCompositionSelectionChange = ignore; | 2266 m_ignoreCompositionSelectionChange = ignore; |
2267 if (!ignore) | 2267 if (!ignore) |
2268 revealSelectionAfterEditingOperation(); | 2268 revealSelectionAfterEditingOperation(); |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3014 { | 3014 { |
3015 m_deleteButtonController->deviceScaleFactorChanged(); | 3015 m_deleteButtonController->deviceScaleFactorChanged(); |
3016 } | 3016 } |
3017 | 3017 |
3018 bool Editor::unifiedTextCheckerEnabled() const | 3018 bool Editor::unifiedTextCheckerEnabled() const |
3019 { | 3019 { |
3020 return WebCore::unifiedTextCheckerEnabled(m_frame); | 3020 return WebCore::unifiedTextCheckerEnabled(m_frame); |
3021 } | 3021 } |
3022 | 3022 |
3023 } // namespace WebCore | 3023 } // namespace WebCore |
OLD | NEW |