Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: Source/WebCore/editing/Editor.cpp

Issue 9965112: Revert 103073 - Scroll non-visible edit controls and caret into the center of the view when startin… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/editing/input/reveal-edit-on-paste-vertically-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 TypingCommand::Options options = 0; 993 TypingCommand::Options options = 0;
994 if (selectInsertedText) 994 if (selectInsertedText)
995 options |= TypingCommand::SelectInsertedText; 995 options |= TypingCommand::SelectInsertedText;
996 if (autocorrectionWasApplied) 996 if (autocorrectionWasApplied)
997 options |= TypingCommand::RetainAutocorrectionIndicator; 997 options |= TypingCommand::RetainAutocorrectionIndicator;
998 TypingCommand::insertText(document.get(), text, selection, options, triggeringEvent && triggeringEvent->isComposition() ? TypingCommand::TextComposi tionConfirm : TypingCommand::TextCompositionNone); 998 TypingCommand::insertText(document.get(), text, selection, options, triggeringEvent && triggeringEvent->isComposition() ? TypingCommand::TextComposi tionConfirm : TypingCommand::TextCompositionNone);
999 999
1000 // Reveal the current selection 1000 // Reveal the current selection
1001 if (Frame* editedFrame = document->frame()) 1001 if (Frame* editedFrame = document->frame())
1002 if (Page* page = editedFrame->page()) 1002 if (Page* page = editedFrame->page())
1003 page->focusController()->focusedOrMainFrame()->selection()-> revealSelection(ScrollAlignment::alignCenterIfNeeded); 1003 page->focusController()->focusedOrMainFrame()->selection()-> revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
1004 } 1004 }
1005 } 1005 }
1006 1006
1007 return true; 1007 return true;
1008 } 1008 }
1009 1009
1010 bool Editor::insertLineBreak() 1010 bool Editor::insertLineBreak()
1011 { 1011 {
1012 if (!canEdit()) 1012 if (!canEdit())
1013 return false; 1013 return false;
(...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after
2332 LayoutPoint framePoint = frameView->windowToContents(windowPoint); 2332 LayoutPoint framePoint = frameView->windowToContents(windowPoint);
2333 VisibleSelection selection(frame->visiblePositionForPoint(framePoint)); 2333 VisibleSelection selection(frame->visiblePositionForPoint(framePoint));
2334 return avoidIntersectionWithNode(selection.toNormalizedRange().get(), m_dele teButtonController->containerElement()); 2334 return avoidIntersectionWithNode(selection.toNormalizedRange().get(), m_dele teButtonController->containerElement());
2335 } 2335 }
2336 2336
2337 void Editor::revealSelectionAfterEditingOperation() 2337 void Editor::revealSelectionAfterEditingOperation()
2338 { 2338 {
2339 if (m_ignoreCompositionSelectionChange) 2339 if (m_ignoreCompositionSelectionChange)
2340 return; 2340 return;
2341 2341
2342 m_frame->selection()->revealSelection(ScrollAlignment::alignCenterIfNeeded); 2342 m_frame->selection()->revealSelection(ScrollAlignment::alignToEdgeIfNeeded);
2343 } 2343 }
2344 2344
2345 void Editor::setIgnoreCompositionSelectionChange(bool ignore) 2345 void Editor::setIgnoreCompositionSelectionChange(bool ignore)
2346 { 2346 {
2347 if (m_ignoreCompositionSelectionChange == ignore) 2347 if (m_ignoreCompositionSelectionChange == ignore)
2348 return; 2348 return;
2349 2349
2350 m_ignoreCompositionSelectionChange = ignore; 2350 m_ignoreCompositionSelectionChange = ignore;
2351 if (!ignore) 2351 if (!ignore)
2352 revealSelectionAfterEditingOperation(); 2352 revealSelectionAfterEditingOperation();
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
3095 { 3095 {
3096 m_deleteButtonController->deviceScaleFactorChanged(); 3096 m_deleteButtonController->deviceScaleFactorChanged();
3097 } 3097 }
3098 3098
3099 bool Editor::unifiedTextCheckerEnabled() const 3099 bool Editor::unifiedTextCheckerEnabled() const
3100 { 3100 {
3101 return WebCore::unifiedTextCheckerEnabled(m_frame); 3101 return WebCore::unifiedTextCheckerEnabled(m_frame);
3102 } 3102 }
3103 3103
3104 } // namespace WebCore 3104 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/editing/input/reveal-edit-on-paste-vertically-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698