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

Unified Diff: third_party/WebKit/Source/core/editing/EditingStyleUtilities.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 | « no previous file | third_party/WebKit/Source/core/editing/EditingUtilities.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/EditingStyleUtilities.cpp
diff --git a/third_party/WebKit/Source/core/editing/EditingStyleUtilities.cpp b/third_party/WebKit/Source/core/editing/EditingStyleUtilities.cpp
index 1c72d9b452487d87e062b1f1395fbc785e1379be..07db045f4a8be6f304c48789a0dca9779a6975be 100644
--- a/third_party/WebKit/Source/core/editing/EditingStyleUtilities.cpp
+++ b/third_party/WebKit/Source/core/editing/EditingStyleUtilities.cpp
@@ -101,7 +101,12 @@ EditingStyle* EditingStyleUtilities::createStyleAtSelectionStart(
DocumentLifecycle::DisallowTransitionScope disallowTransition(
document.lifecycle());
- Position position = adjustedSelectionStartForStyleComputation(selection);
+ // TODO(editing-dev): We should make |position| to |const Position&| by
+ // integrating this expression and if-statement below.
+ Position position =
+ selection.isCaret()
+ ? createVisiblePosition(selection.start()).deepEquivalent()
+ : adjustedSelectionStartForStyleComputation(selection.start());
// If the pos is at the end of a text node, then this node is not fully
// selected. Move it to the next deep equivalent position to avoid removing
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/EditingUtilities.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698