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

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

Issue 2351533005: Prune CreateVisiblePositionDeprecated from DOMSelection (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | 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/DOMSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/DOMSelection.cpp b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
index 832f6e12a446aaa80374eaedcc3cc3facde9f969..46d91f8276477d7676002347db8bd236b006f82d 100644
--- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
@@ -243,7 +243,7 @@ void DOMSelection::collapseToEnd(ExceptionState& exceptionState)
return;
}
- m_frame->selection().moveTo(createVisiblePositionDeprecated(selection.end()));
+ m_frame->selection().moveTo(selection.end(), SelDefaultAffinity);
yosin_UTC9 2016/09/20 08:33:17 Please get rid of FrameSelection::moveTo(const Vis
Xiaocheng 2016/09/20 08:56:37 A TODO is added to FrameSelection::moveTo(VP).
}
void DOMSelection::collapseToStart(ExceptionState& exceptionState)
@@ -258,7 +258,7 @@ void DOMSelection::collapseToStart(ExceptionState& exceptionState)
return;
}
- m_frame->selection().moveTo(createVisiblePositionDeprecated(selection.start()));
+ m_frame->selection().moveTo(selection.start(), SelDefaultAffinity);
}
void DOMSelection::empty()
@@ -289,10 +289,14 @@ void DOMSelection::setBaseAndExtent(Node* baseNode, int baseOffset, Node* extent
if (!isValidForPosition(baseNode) || !isValidForPosition(extentNode))
return;
- VisiblePosition visibleBase = createVisiblePositionDeprecated(createPosition(baseNode, baseOffset));
- VisiblePosition visibleExtent = createVisiblePositionDeprecated(createPosition(extentNode, extentOffset));
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ m_frame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
yosin_UTC9 2016/09/20 08:33:17 nit: It seems strange that making layout tree clea
Xiaocheng 2016/09/20 08:56:38 Reasonable. Done.
Xiaocheng 2016/09/20 08:56:38 Done.
+
+ Position base = createPosition(baseNode, baseOffset);
+ Position extent = createPosition(extentNode, extentOffset);
const bool selectionHasDirection = true;
- m_frame->selection().setSelection(VisibleSelection(visibleBase, visibleExtent, selectionHasDirection));
+ m_frame->selection().setSelection(VisibleSelection(base, extent, SelDefaultAffinity, selectionHasDirection));
}
void DOMSelection::modify(const String& alterString, const String& directionString, const String& granularityString)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698