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

Side by Side Diff: third_party/WebKit/Source/core/editing/EditingUtilities.cpp

Issue 2366223002: Prune CreateVisiblePositionDeprecated from adjustedSelectionStartForStyleComputation (Closed)
Patch Set: Created 4 years, 2 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 | « third_party/WebKit/Source/core/editing/EditingStyle.cpp ('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) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007 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 1818 matching lines...) Expand 10 before | Expand all | Expand 10 after
1829 return node.isElementNode() && layoutObject && layoutObject->isLayoutBlockFl ow(); 1829 return node.isElementNode() && layoutObject && layoutObject->isLayoutBlockFl ow();
1830 } 1830 }
1831 1831
1832 Position adjustedSelectionStartForStyleComputation(const VisibleSelection& selec tion) 1832 Position adjustedSelectionStartForStyleComputation(const VisibleSelection& selec tion)
1833 { 1833 {
1834 // This function is used by range style computations to avoid bugs like: 1834 // This function is used by range style computations to avoid bugs like:
1835 // <rdar://problem/4017641> REGRESSION (Mail): you can only bold/unbold a se lection starting from end of line once 1835 // <rdar://problem/4017641> REGRESSION (Mail): you can only bold/unbold a se lection starting from end of line once
1836 // It is important to skip certain irrelevant content at the start of the se lection, so we do not wind up 1836 // It is important to skip certain irrelevant content at the start of the se lection, so we do not wind up
1837 // with a spurious "mixed" style. 1837 // with a spurious "mixed" style.
1838 1838
1839 VisiblePosition visiblePosition = createVisiblePositionDeprecated(selection. start()); 1839 VisiblePosition visiblePosition = createVisiblePosition(selection.start());
1840 if (visiblePosition.isNull()) 1840 if (visiblePosition.isNull())
1841 return Position(); 1841 return Position();
1842 1842
1843 // if the selection is a caret, just return the position, since the style 1843 // if the selection is a caret, just return the position, since the style
1844 // behind us is relevant 1844 // behind us is relevant
1845 if (selection.isCaret()) 1845 if (selection.isCaret())
1846 return visiblePosition.deepEquivalent(); 1846 return visiblePosition.deepEquivalent();
1847 1847
1848 // if the selection starts just before a paragraph break, skip over it 1848 // if the selection starts just before a paragraph break, skip over it
1849 if (isEndOfParagraph(visiblePosition)) 1849 if (isEndOfParagraph(visiblePosition))
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1918 return InputType::DeleteWordBackward; 1918 return InputType::DeleteWordBackward;
1919 if (granularity == LineBoundary) 1919 if (granularity == LineBoundary)
1920 return InputType::DeleteLineBackward; 1920 return InputType::DeleteLineBackward;
1921 return InputType::DeleteContentBackward; 1921 return InputType::DeleteContentBackward;
1922 default: 1922 default:
1923 return InputType::None; 1923 return InputType::None;
1924 } 1924 }
1925 } 1925 }
1926 1926
1927 } // namespace blink 1927 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingStyle.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698