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

Unified Diff: third_party/WebKit/Source/core/editing/EditingUtilities.cpp

Issue 2739023003: Make adjustedSelectionStartForStyleComputation() to take Position instead of VisibleSeleciton (Closed)
Patch Set: 2017-03-09T15:23:37 Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingUtilities.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/EditingUtilities.cpp
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
index c4fd9c04fa9072c1e1cc67fcd884951b81944d23..beeba1971b64d70dbe3c02b984713d7830533117 100644
--- a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
+++ b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
@@ -2048,23 +2048,17 @@ bool isBlockFlowElement(const Node& node) {
layoutObject->isLayoutBlockFlow();
}
-Position adjustedSelectionStartForStyleComputation(
- const VisibleSelection& selection) {
+Position adjustedSelectionStartForStyleComputation(const Position& position) {
// This function is used by range style computations to avoid bugs like:
// <rdar://problem/4017641> REGRESSION (Mail): you can only bold/unbold a
// selection starting from end of line once
// It is important to skip certain irrelevant content at the start of the
// selection, so we do not wind up with a spurious "mixed" style.
- VisiblePosition visiblePosition = createVisiblePosition(selection.start());
+ VisiblePosition visiblePosition = createVisiblePosition(position);
if (visiblePosition.isNull())
return Position();
- // if the selection is a caret, just return the position, since the style
- // behind us is relevant
- if (selection.isCaret())
- return visiblePosition.deepEquivalent();
-
// if the selection starts just before a paragraph break, skip over it
if (isEndOfParagraph(visiblePosition))
return mostForwardCaretPosition(
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingUtilities.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698