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

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

Issue 2800813006: Move layouet/LayoutView::setSelection() to editing/LayoutSelection (Closed)
Patch Set: nit Created 3 years, 8 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
Index: third_party/WebKit/Source/core/editing/FrameSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.cpp b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
index ba35c21327c2446370d882ac6b0c8ecd5866fe96..6467d40158b462f9ef3272f1b678b2bd85edc4b7 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
@@ -435,9 +435,7 @@ void FrameSelection::DocumentAttached(Document* document) {
void FrameSelection::ContextDestroyed(Document* document) {
granularity_ = kCharacterGranularity;
- LayoutViewItem view = frame_->ContentLayoutItem();
- if (!view.IsNull())
- view.ClearSelection();
+ layout_selection_->OnDocumentShutdown();
frame_->GetEditor().ClearTypingStyle();
}
@@ -709,7 +707,7 @@ void FrameSelection::FocusedOrActiveStateChanged() {
// we have to update places those colors were painted.
LayoutViewItem view = GetDocument().GetLayoutViewItem();
if (!view.IsNull())
- view.InvalidatePaintForSelection();
+ layout_selection_->InvalidatePaintForSelection();
// Caret appears in the active frame.
if (active_and_focused)
@@ -886,7 +884,7 @@ LayoutRect FrameSelection::UnclippedBounds() const {
return LayoutRect();
view->UpdateLifecycleToLayoutClean();
- return LayoutRect(layout_view.SelectionBounds());
+ return LayoutRect(layout_selection_->SelectionBounds());
}
static inline HTMLFormElement* AssociatedFormElement(HTMLElement& element) {
@@ -1147,6 +1145,14 @@ void FrameSelection::ClearDocumentCachedRange() {
selection_editor_->ClearDocumentCachedRange();
}
+void FrameSelection::LayoutSelectionStartEnd(int& start_pos, int& end_pos) {
+ layout_selection_->SelectionStartEnd(start_pos, end_pos);
+}
+
+void FrameSelection::ClearLayoutSelection() {
+ layout_selection_->ClearSelection();
+}
+
} // namespace blink
#ifndef NDEBUG

Powered by Google App Engine
This is Rietveld 408576698