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

Unified Diff: Source/core/editing/IndentOutdentCommand.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/IndentOutdentCommand.cpp
diff --git a/Source/core/editing/IndentOutdentCommand.cpp b/Source/core/editing/IndentOutdentCommand.cpp
index 1d3f0f1b7f8efa1ef05bfa2cf6666aae9e9e06c6..d7da04406a4d9b27edb235ccc9e18854f4e3edec 100644
--- a/Source/core/editing/IndentOutdentCommand.cpp
+++ b/Source/core/editing/IndentOutdentCommand.cpp
@@ -44,7 +44,7 @@ namespace WebCore {
using namespace HTMLNames;
-static bool isListOrIndentBlockquote(const Node* node)
+static bool isListOrIndentBlockquote(const Handle<const Node>& node)
{
return node && (node->hasTagName(ulTag) || node->hasTagName(olTag) || node->hasTagName(blockquoteTag));
}
@@ -60,12 +60,12 @@ bool IndentOutdentCommand::tryIndentingAsListItem(const Position& start, const P
{
// If our selection is not inside a list, bail out.
Handle<Node> lastNodeInSelectedParagraph = start.deprecatedNode();
- Handle<Element> listNode = enclosingList(lastNodeInSelectedParagraph.raw());
+ Handle<Element> listNode = enclosingList(lastNodeInSelectedParagraph);
if (!listNode)
return false;
// Find the block that we want to indent. If it's not a list item (e.g., a div inside a list item), we bail out.
- Handle<Element> selectedListItem = enclosingBlock(lastNodeInSelectedParagraph.raw());
+ Handle<Element> selectedListItem = enclosingBlock(lastNodeInSelectedParagraph);
// FIXME: we need to deal with the case where there is no li (malformed HTML)
if (!selectedListItem->hasTagName(liTag))
@@ -90,12 +90,12 @@ bool IndentOutdentCommand::tryIndentingAsListItem(const Position& start, const P
void IndentOutdentCommand::indentIntoBlockquote(const Position& start, const Position& end, Handle<Element>& targetBlockquote)
{
- Node* enclosingCell = enclosingNodeOfType(start, &isTableCell);
+ Handle<Node> enclosingCell = enclosingNodeOfType(start, &isTableCell);
Handle<Node> nodeToSplitTo;
if (enclosingCell)
- nodeToSplitTo = adoptRawResult(enclosingCell);
- else if (enclosingList(start.containerNode().handle().raw()))
- nodeToSplitTo = enclosingBlock(start.containerNode().handle().raw());
+ nodeToSplitTo = enclosingCell;
+ else if (enclosingList(start.containerNode()))
+ nodeToSplitTo = enclosingBlock(start.containerNode());
else
nodeToSplitTo = editableRootForPosition(start);
@@ -125,7 +125,7 @@ void IndentOutdentCommand::outdentParagraph()
VisiblePosition visibleStartOfParagraph = startOfParagraph(endingSelection().visibleStart());
VisiblePosition visibleEndOfParagraph = endOfParagraph(visibleStartOfParagraph);
- Handle<Node> enclosingNode = adoptRawResult(enclosingNodeOfType(visibleStartOfParagraph.deepEquivalent(), &isListOrIndentBlockquote));
+ Handle<Node> enclosingNode = enclosingNodeOfType(visibleStartOfParagraph.deepEquivalent(), &isListOrIndentBlockquote);
if (!enclosingNode || !enclosingNode->parentNode()->rendererIsEditable()) // We can't outdent if there is no place to go!
return;
@@ -172,13 +172,13 @@ void IndentOutdentCommand::outdentParagraph()
return;
}
- Handle<Node> enclosingBlockFlow = enclosingBlock(visibleStartOfParagraph.deepEquivalent().deprecatedNode().handle().raw());
+ Handle<Node> enclosingBlockFlow = enclosingBlock(visibleStartOfParagraph.deepEquivalent().deprecatedNode());
Handle<Node> splitBlockquoteNode = enclosingNode;
if (enclosingBlockFlow != enclosingNode)
splitBlockquoteNode = splitTreeToNode(enclosingBlockFlow, enclosingNode, true);
else {
// We split the blockquote at where we start outdenting.
- Handle<Node> highestInlineNode = adoptRawResult(highestEnclosingNodeOfType(visibleStartOfParagraph.deepEquivalent(), isInline, CannotCrossEditingBoundary, enclosingBlockFlow.raw()));
+ Handle<Node> highestInlineNode = highestEnclosingNodeOfType(visibleStartOfParagraph.deepEquivalent(), isInline, CannotCrossEditingBoundary, enclosingBlockFlow);
splitElement(toElement(enclosingNode), highestInlineNode ? highestInlineNode : visibleStartOfParagraph.deepEquivalent().deprecatedNode().handle());
}
Handle<Node> placeholder = createBreakElement(document());

Powered by Google App Engine
This is Rietveld 408576698