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

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

Issue 1477313003: Make SelectionEditor::setWithoutValidation() not to use obsoleted layout objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2015-11-30T10:45:57 Created 5 years, 1 month 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/SelectionEditor.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/SelectionEditor.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionEditor.cpp b/third_party/WebKit/Source/core/editing/SelectionEditor.cpp
index 4d0cd695e87d192c92942c7f10ed7e428ba93dc3..746562310b9739df6d37aa3efd23cc6c6f82c547 100644
--- a/third_party/WebKit/Source/core/editing/SelectionEditor.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionEditor.cpp
@@ -84,11 +84,7 @@ void SelectionEditor::setVisibleSelection(const VisibleSelection& newSelection,
{
m_selection = newSelection;
if (options & FrameSelection::DoNotAdjustInComposedTree) {
- const auto& base = toPositionInComposedTree(m_selection.base());
- const auto& extent = toPositionInComposedTree(m_selection.extent());
- base.anchorNode()->updateDistribution();
- extent.anchorNode()->updateDistribution();
- m_selectionInComposedTree.setWithoutValidation(base, extent);
+ m_selectionInComposedTree.setWithoutValidation(toPositionInComposedTree(m_selection.base()), toPositionInComposedTree(m_selection.extent()));
return;
}
@@ -170,10 +166,10 @@ void SelectionEditor::setIsDirectional(bool isDirectional)
m_selectionInComposedTree.setIsDirectional(isDirectional);
}
-void SelectionEditor::setWithoutValidation(const Position& start, const Position& end)
+void SelectionEditor::setWithoutValidation(const Position& base, const Position& extent)
{
- m_selection.setWithoutValidation(start, end);
- adjustVisibleSelectionInComposedTree();
+ m_selection.setWithoutValidation(base, extent);
+ m_selectionInComposedTree.setWithoutValidation(toPositionInComposedTree(base), toPositionInComposedTree(extent));
}
TextDirection SelectionEditor::directionOfEnclosingBlock()
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionEditor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698