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

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

Issue 24278008: [oilpan] Handlify Nodes in htmlediting (Closed) Base URL: svn://svn.chromium.org/blink/branches/oilpan
Patch Set: Created 7 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
Index: Source/core/editing/FrameSelection.cpp
diff --git a/Source/core/editing/FrameSelection.cpp b/Source/core/editing/FrameSelection.cpp
index 5e9921c3e8a36810b4342abffaf0d0dc2ca982e8..0b5645aa98de67569e9a1e83f6586db9cd750997 100644
--- a/Source/core/editing/FrameSelection.cpp
+++ b/Source/core/editing/FrameSelection.cpp
@@ -394,9 +394,9 @@ void FrameSelection::respondToNodeModification(Node* node, bool baseRemoved, boo
Position start = m_selection.start();
Position end = m_selection.end();
if (startRemoved)
- updatePositionForNodeRemoval(start, node);
+ updatePositionForNodeRemoval(start, adoptRawResult(node));
if (endRemoved)
- updatePositionForNodeRemoval(end, node);
+ updatePositionForNodeRemoval(end, adoptRawResult(node));
if (start.isNotNull() && end.isNotNull()) {
if (m_selection.isBaseFirst())
@@ -1226,7 +1226,7 @@ void CaretBase::clearCaretRect()
m_caretLocalRect = LayoutRect();
}
-static inline bool caretRendersInsideNode(Node* node)
+static inline bool caretRendersInsideNode(const Handle<Node>& node)
{
return node && !isTableElement(node) && !editingIgnoresContent(node);
}
@@ -1241,7 +1241,7 @@ static RenderObject* caretRenderer(Node* node)
return 0;
// if caretNode is a block and caret is inside it then caret should be painted by that block
- bool paintedByBlock = renderer->isBlockFlow() && caretRendersInsideNode(node);
+ bool paintedByBlock = renderer->isBlockFlow() && caretRendersInsideNode(adoptRawResult(node));
return paintedByBlock ? renderer : renderer->containingBlock();
}
@@ -1608,7 +1608,7 @@ void FrameSelection::selectAll()
Handle<Node> root;
Handle<Node> selectStartTarget;
if (isContentEditable()) {
- root = adoptRawResult(highestEditableRoot(m_selection.start()));
+ root = highestEditableRoot(m_selection.start());
if (Node* shadowRoot = m_selection.nonBoundaryShadowTreeRootNode())
selectStartTarget = shadowRoot->shadowHost();
else
@@ -1849,8 +1849,8 @@ void FrameSelection::setFocusedNodeIfNeeded()
bool caretBrowsing = m_frame->settings() && m_frame->settings()->caretBrowsingEnabled();
if (caretBrowsing) {
- if (Node* anchor = enclosingAnchorElement(base())) {
- m_frame->page()->focusController()->setFocusedNode(adoptRawResult(anchor), m_frame);
+ if (Handle<Node> anchor = enclosingAnchorElement(base())) {
+ m_frame->page()->focusController()->setFocusedNode(anchor, m_frame);
return;
}
}
@@ -2007,7 +2007,7 @@ void FrameSelection::setSelectionFromNone()
node = NodeTraversal::next(node);
}
if (node)
- setSelection(VisibleSelection(firstPositionInOrBeforeNode(node.raw()), DOWNSTREAM));
+ setSelection(VisibleSelection(firstPositionInOrBeforeNode(node), DOWNSTREAM));
}
bool FrameSelection::shouldChangeSelection(const VisibleSelection& newSelection) const

Powered by Google App Engine
This is Rietveld 408576698