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

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

Issue 1885373005: [Layout API] Convert (most of) FrameSelection to use Document::layoutViewItem() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix null check Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/api/LayoutViewItem.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/FrameSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.cpp b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
index 5c00026178ea9d92bc11d976153b8ffb8b1906a8..61527e2754bba918221d4ff1e24372a57d0852af 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
@@ -470,7 +470,7 @@ void FrameSelection::respondToNodeModification(Node& node, bool baseRemoved, boo
}
if (clearLayoutTreeSelection)
- selection().start().document()->layoutView()->clearSelection();
+ selection().start().document()->layoutViewItem().clearSelection();
if (clearDOMTreeSelection)
setSelection(VisibleSelection(), DoNotSetFocus);
@@ -742,7 +742,7 @@ void FrameSelection::paintCaret(GraphicsContext& context, const LayoutPoint& pai
bool FrameSelection::contains(const LayoutPoint& point)
{
Document* document = m_frame->document();
- if (!document->layoutView())
+ if (document->layoutViewItem().isNull())
return false;
// Treat a collapsed selection like no selection.
@@ -752,7 +752,7 @@ bool FrameSelection::contains(const LayoutPoint& point)
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
HitTestResult result(request, point);
- document->layoutView()->hitTest(result);
+ document->layoutViewItem().hitTest(result);
Node* innerNode = result.innerNode();
if (!innerNode || !innerNode->layoutObject())
return false;
@@ -933,8 +933,9 @@ void FrameSelection::focusedOrActiveStateChanged()
// Because LayoutObject::selectionBackgroundColor() and
// LayoutObject::selectionForegroundColor() check if the frame is active,
// we have to update places those colors were painted.
- if (LayoutView* view = document->layoutView())
- view->invalidatePaintForSelection();
+ LayoutViewItem view = document->layoutViewItem();
+ if (!view.isNull())
+ view.invalidatePaintForSelection();
// Caret appears in the active frame.
if (activeAndFocused)
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/api/LayoutViewItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698