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

Side by Side Diff: Source/core/editing/FrameSelection.cpp

Issue 1330233003: Revert of Avoid style clobbering in setCompositionFromExistingText. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 // Always clear the x position used for vertical arrow navigation. 307 // Always clear the x position used for vertical arrow navigation.
308 // It will be restored by the vertical arrow navigation code if necessary. 308 // It will be restored by the vertical arrow navigation code if necessary.
309 m_xPosForVerticalArrowNavigation = NoXPosForVerticalArrowNavigation(); 309 m_xPosForVerticalArrowNavigation = NoXPosForVerticalArrowNavigation();
310 selectFrameElementInParentIfFullySelected(); 310 selectFrameElementInParentIfFullySelected();
311 notifyLayoutObjectOfSelectionChange(userTriggered); 311 notifyLayoutObjectOfSelectionChange(userTriggered);
312 // If the selections are same in the DOM tree but not in the composed tree, 312 // If the selections are same in the DOM tree but not in the composed tree,
313 // don't fire events. For example, if the selection crosses shadow tree 313 // don't fire events. For example, if the selection crosses shadow tree
314 // boundary, selection for the DOM tree is shrunk while that for the 314 // boundary, selection for the DOM tree is shrunk while that for the
315 // composed tree is not. Additionally, this case occurs in some edge cases. 315 // composed tree is not. Additionally, this case occurs in some edge cases.
316 // See also: editing/pasteboard/4076267-3.html 316 // See also: editing/pasteboard/4076267-3.html
317 if (VisibleSelection::InDOMTree::equalSelections(oldSelection, m_selection)) { 317 if (VisibleSelection::InDOMTree::equalSelections(oldSelection, m_selection))
318 m_frame->inputMethodController().cancelCompositionIfSelectionIsInvalid() ;
319 return; 318 return;
320 }
321 m_frame->editor().respondToChangedSelection(oldSelection, options); 319 m_frame->editor().respondToChangedSelection(oldSelection, options);
322 if (userTriggered == UserTriggered) { 320 if (userTriggered == UserTriggered) {
323 ScrollAlignment alignment; 321 ScrollAlignment alignment;
324 322
325 if (m_frame->editor().behavior().shouldCenterAlignWhenSelectionIsReveale d()) 323 if (m_frame->editor().behavior().shouldCenterAlignWhenSelectionIsReveale d())
326 alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment:: alignCenterAlways : ScrollAlignment::alignCenterIfNeeded; 324 alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment:: alignCenterAlways : ScrollAlignment::alignCenterIfNeeded;
327 else 325 else
328 alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment:: alignTopAlways : ScrollAlignment::alignToEdgeIfNeeded; 326 alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment:: alignTopAlways : ScrollAlignment::alignToEdgeIfNeeded;
329 327
330 revealSelection(alignment, RevealExtent); 328 revealSelection(alignment, RevealExtent);
(...skipping 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after
2060 2058
2061 void showTree(const blink::FrameSelection* sel) 2059 void showTree(const blink::FrameSelection* sel)
2062 { 2060 {
2063 if (sel) 2061 if (sel)
2064 sel->showTreeForThis(); 2062 sel->showTreeForThis();
2065 else 2063 else
2066 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); 2064 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n");
2067 } 2065 }
2068 2066
2069 #endif 2067 #endif
OLDNEW
« no previous file with comments | « Source/core/editing/CompositionUnderlineRangeFilterTest.cpp ('k') | Source/core/editing/InputMethodController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698