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

Unified Diff: Source/core/editing/ReplaceSelectionCommand.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
« no previous file with comments | « Source/core/editing/ModifySelectionListLevel.cpp ('k') | Source/core/editing/TextIterator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/ReplaceSelectionCommand.cpp
diff --git a/Source/core/editing/ReplaceSelectionCommand.cpp b/Source/core/editing/ReplaceSelectionCommand.cpp
index 7e67bd6ac5936a5d34415c721257f7099becf847..49e490951fede650f8eca286a5c832a48adc7434 100644
--- a/Source/core/editing/ReplaceSelectionCommand.cpp
+++ b/Source/core/editing/ReplaceSelectionCommand.cpp
@@ -116,14 +116,14 @@ static bool isInterchangeConvertedSpaceSpan(const Node *node)
static Position positionAvoidingPrecedingNodes(Position pos)
{
// If we're already on a break, it's probably a placeholder and we shouldn't change our position.
- if (editingIgnoresContent(pos.deprecatedNode().handle().raw()))
+ if (editingIgnoresContent(pos.deprecatedNode()))
return pos;
// We also stop when changing block flow elements because even though the visual position is the
// same. E.g.,
// <div>foo^</div>^
// The two positions above are the same visual position, but we want to stay in the same block.
- Handle<Node> enclosingBlockNode = enclosingBlock(pos.containerNode().handle().raw());
+ Handle<Node> enclosingBlockNode = enclosingBlock(pos.containerNode());
for (Position nextPosition = pos; nextPosition.containerNode() != enclosingBlockNode; pos = nextPosition) {
HandleScope scope;
if (lineBreakExistsAtPosition(pos))
@@ -133,7 +133,7 @@ static Position positionAvoidingPrecedingNodes(Position pos)
nextPosition = positionInParentAfterNode(pos.containerNode());
if (nextPosition == pos
- || enclosingBlock(nextPosition.containerNode().handle().raw()) != enclosingBlockNode
+ || enclosingBlock(nextPosition.containerNode()) != enclosingBlockNode
|| VisiblePosition(pos) != VisiblePosition(nextPosition))
break;
}
@@ -281,7 +281,7 @@ void ReplacementFragment::removeUnrenderedNodes(Node* holder)
for (Handle<Node> node = holder->firstChild(); node; node = NodeTraversal::next(node, adoptRawResult(holder))) {
HandleScope scope;
- if (!isNodeRendered(node.raw()) && !isTableStructureNode(node.raw()))
+ if (!isNodeRendered(node) && !isTableStructureNode(node))
unrendered.append(node.raw());
}
@@ -432,12 +432,12 @@ bool ReplaceSelectionCommand::shouldMergeEnd(bool selectionEndWasEndOfParagraph)
&& shouldMerge(endOfInsertedContent, next);
}
-static bool isMailPasteAsQuotationNode(const Node* node)
+static bool isMailPasteAsQuotationNode(const Handle<const Node>& node)
{
- return node && node->hasTagName(blockquoteTag) && node->isElementNode() && toElement(node)->getAttribute(classAttr) == ApplePasteAsQuotation;
+ return node && node->hasTagName(blockquoteTag) && node->isElementNode() && toConstElement(node)->getAttribute(classAttr) == ApplePasteAsQuotation;
}
-static bool isHeaderElement(const Node* a)
+static bool isHeaderElement(const Handle<const Node>& a)
{
if (!a)
return false;
@@ -462,16 +462,16 @@ bool ReplaceSelectionCommand::shouldMerge(const VisiblePosition& source, const V
Handle<Node> sourceNode = source.deepEquivalent().deprecatedNode();
Handle<Node> destinationNode = destination.deepEquivalent().deprecatedNode();
- Handle<Node> sourceBlock = enclosingBlock(sourceNode.raw());
- Handle<Node> destinationBlock = enclosingBlock(destinationNode.raw());
+ Handle<Node> sourceBlock = enclosingBlock(sourceNode);
+ Handle<Node> destinationBlock = enclosingBlock(destinationNode);
return !enclosingNodeOfType(source.deepEquivalent(), &isMailPasteAsQuotationNode)
- && sourceBlock && (!sourceBlock->hasTagName(blockquoteTag) || isMailBlockquote(sourceBlock.raw()))
- && enclosingListChild(sourceBlock.raw()) == enclosingListChild(destinationNode.raw())
+ && sourceBlock && (!sourceBlock->hasTagName(blockquoteTag) || isMailBlockquote(sourceBlock))
+ && enclosingListChild(sourceBlock) == enclosingListChild(destinationNode)
&& enclosingTableCell(source.deepEquivalent()) == enclosingTableCell(destination.deepEquivalent())
- && (!isHeaderElement(sourceBlock.raw()) || haveSameTagName(sourceBlock.raw(), destinationBlock.raw()))
+ && (!isHeaderElement(sourceBlock) || haveSameTagName(sourceBlock.raw(), destinationBlock.raw()))
// Don't merge to or from a position before or after a block because it would
// be a no-op and cause infinite recursion.
- && !isBlock(sourceNode.raw()) && !isBlock(destinationNode.raw());
+ && !isBlock(sourceNode) && !isBlock(destinationNode);
}
// Style rules that match just inserted elements could change their appearance, like
@@ -513,7 +513,7 @@ void ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline(Insert
// If Mail wraps the fragment with a Paste as Quotation blockquote, or if you're pasting into a quoted region,
// styles from blockquoteNode are allowed to override those from the source document, see <rdar://problem/4930986> and <rdar://problem/5089327>.
- Node* blockquoteNode = isMailPasteAsQuotationNode(context.raw()) ? context.raw() : enclosingNodeOfType(firstPositionInNode(context), isMailBlockquote, CanCrossEditingBoundary);
+ Handle<Node> blockquoteNode = isMailPasteAsQuotationNode(context) ? Handle<Node>(context) : Handle<Node>(enclosingNodeOfType(firstPositionInNode(context), isMailBlockquote, CanCrossEditingBoundary));
if (blockquoteNode)
newInlineStyle->removeStyleFromRulesAndContext(element, document()->documentElement());
@@ -531,7 +531,7 @@ void ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline(Insert
setNodeAttribute(element, styleAttr, newInlineStyle->style()->asText());
// FIXME: Tolerate differences in id, class, and style attributes.
- if (isNonTableCellHTMLBlockElement(element.raw()) && areIdenticalElements(element.raw(), element->parentNode().handle().raw())
+ if (isNonTableCellHTMLBlockElement(element) && areIdenticalElements(element, element->parentNode())
&& VisiblePosition(firstPositionInNode(element->parentNode())) == VisiblePosition(firstPositionInNode(element))
&& VisiblePosition(lastPositionInNode(element->parentNode())) == VisiblePosition(lastPositionInNode(element))) {
insertedNodes.willRemoveNodePreservingChildren(element.raw());
@@ -558,7 +558,7 @@ void ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline(Insert
// in quirks mode (which Mail.app is always in). We should look for an alternative.
// Mutate using the CSSOM wrapper so we get the same event behavior as a script.
- if (isBlock(element.raw()))
+ if (isBlock(element))
element->style()->setPropertyInternal(CSSPropertyDisplay, "inline", false, IGNORE_EXCEPTION);
if (element->renderer() && element->renderer()->style()->isFloating())
element->style()->setPropertyInternal(CSSPropertyFloat, "none", false, IGNORE_EXCEPTION);
@@ -634,12 +634,12 @@ void ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuild
continue;
if (isProhibitedParagraphChild(toHTMLElement(adoptRawResult(node.get()))->localName())) {
- if (Handle<HTMLElement> paragraphElement = toHTMLElement(adoptRawResult(enclosingNodeWithTag(positionInParentBeforeNode(adoptRawResult(node.get())), pTag))))
+ if (Handle<HTMLElement> paragraphElement = toHTMLElement(enclosingNodeWithTag(positionInParentBeforeNode(adoptRawResult(node.get())), pTag)))
moveNodeOutOfAncestor(node, paragraphElement.passRefPtr());
}
- if (isHeaderElement(node.get())) {
- if (Handle<HTMLElement> headerElement = toHTMLElement(adoptRawResult(highestEnclosingNodeOfType(positionInParentBeforeNode(adoptRawResult(node.get())), isHeaderElement))))
+ if (isHeaderElement(adoptRawResult(node.get()))) {
+ if (Handle<HTMLElement> headerElement = toHTMLElement(highestEnclosingNodeOfType(positionInParentBeforeNode(adoptRawResult(node.get())), isHeaderElement)))
moveNodeOutOfAncestor(node, headerElement.passRefPtr());
}
}
@@ -650,7 +650,7 @@ void ReplaceSelectionCommand::moveNodeOutOfAncestor(PassRefPtr<Node> prpNode, Pa
Handle<Node> node = adoptRawResult(prpNode.get());
Handle<Node> ancestor = adoptRawResult(prpAncestor.get());
- VisiblePosition positionAtEndOfNode = lastPositionInOrAfterNode(node.raw());
+ VisiblePosition positionAtEndOfNode = lastPositionInOrAfterNode(node);
VisiblePosition lastPositionInParagraph = lastPositionInNode(ancestor);
if (positionAtEndOfNode == lastPositionInParagraph) {
removeNode(node);
@@ -678,8 +678,8 @@ void ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds(InsertedNodes& ins
Handle<Node> lastLeafInserted = adoptRawResult(insertedNodes.lastLeafInserted());
if (lastLeafInserted && lastLeafInserted->isTextNode() && !nodeHasVisibleRenderText(toText(lastLeafInserted))
- && !enclosingNodeWithTag(firstPositionInOrBeforeNode(lastLeafInserted.raw()), selectTag)
- && !enclosingNodeWithTag(firstPositionInOrBeforeNode(lastLeafInserted.raw()), scriptTag)) {
+ && !enclosingNodeWithTag(firstPositionInOrBeforeNode(lastLeafInserted), selectTag)
+ && !enclosingNodeWithTag(firstPositionInOrBeforeNode(lastLeafInserted), scriptTag)) {
insertedNodes.willRemoveNode(lastLeafInserted.raw());
removeNode(lastLeafInserted);
}
@@ -697,7 +697,7 @@ void ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds(InsertedNodes& ins
VisiblePosition ReplaceSelectionCommand::positionAtEndOfInsertedContent() const
{
// FIXME: Why is this hack here? What's special about <select> tags?
- Node* enclosingSelect = enclosingNodeWithTag(m_endOfInsertedContent, selectTag);
+ Handle<Node> enclosingSelect = enclosingNodeWithTag(m_endOfInsertedContent, selectTag);
return enclosingSelect ? lastPositionInOrAfterNode(enclosingSelect) : m_endOfInsertedContent;
}
@@ -731,7 +731,7 @@ static bool handleStyleSpansBeforeInsertion(ReplacementFragment& fragment, const
// Handling the case where we are doing Paste as Quotation or pasting into quoted content is more complicated (see handleStyleSpans)
// and doesn't receive the optimization.
- if (isMailPasteAsQuotationNode(topNode.raw()) || enclosingNodeOfType(firstPositionInOrBeforeNode(topNode.raw()), isMailBlockquote, CanCrossEditingBoundary))
+ if (isMailPasteAsQuotationNode(topNode) || enclosingNodeOfType(firstPositionInOrBeforeNode(topNode), isMailBlockquote, CanCrossEditingBoundary))
return false;
// Either there are no style spans in the fragment or a WebKit client has added content to the fragment
@@ -784,7 +784,7 @@ void ReplaceSelectionCommand::handleStyleSpans(InsertedNodes& insertedNodes)
// If Mail wraps the fragment with a Paste as Quotation blockquote, or if you're pasting into a quoted region,
// styles from blockquoteNode are allowed to override those from the source document, see <rdar://problem/4930986> and <rdar://problem/5089327>.
- Node* blockquoteNode = isMailPasteAsQuotationNode(context.raw()) ? context.raw() : enclosingNodeOfType(firstPositionInNode(context), isMailBlockquote, CanCrossEditingBoundary);
+ Handle<Node> blockquoteNode = isMailPasteAsQuotationNode(context) ? Handle<Node>(context) : Handle<Node>(enclosingNodeOfType(firstPositionInNode(context), isMailBlockquote, CanCrossEditingBoundary));
if (blockquoteNode)
context = document()->documentElement();
@@ -865,7 +865,7 @@ static Node* enclosingInline(Node* node)
return node;
}
-static bool isInlineNodeWithStyle(const Node* node)
+static bool isInlineNodeWithStyle(const Handle<const Node>& node)
{
// We don't want to skip over any block elements.
if (isBlock(node))
@@ -876,7 +876,7 @@ static bool isInlineNodeWithStyle(const Node* node)
// We can skip over elements whose class attribute is
// one of our internal classes.
- Handle<const HTMLElement> element = toConstHTMLElement(adoptRawResult(node));
+ Handle<const HTMLElement> element = toConstHTMLElement(node);
const AtomicString& classAttributeValue = element->getAttribute(classAttr);
if (classAttributeValue == AppleTabSpanClass
|| classAttributeValue == AppleConvertedSpace
@@ -888,8 +888,8 @@ static bool isInlineNodeWithStyle(const Node* node)
inline Node* nodeToSplitToAvoidPastingIntoInlineNodesWithStyle(const Position& insertionPos)
Mads Ager (chromium) 2013/09/24 06:36:20 I believe this is only used in a couple of places
{
- Handle<Node> containgBlock = enclosingBlock(insertionPos.containerNode().handle().raw());
- return highestEnclosingNodeOfType(insertionPos, isInlineNodeWithStyle, CannotCrossEditingBoundary, containgBlock.raw());
+ Handle<Node> containgBlock = enclosingBlock(insertionPos.containerNode());
+ return highestEnclosingNodeOfType(insertionPos, isInlineNodeWithStyle, CannotCrossEditingBoundary, containgBlock).handle().raw();
}
void ReplaceSelectionCommand::doApply()
@@ -923,7 +923,7 @@ void ReplaceSelectionCommand::doApply()
bool selectionEndWasEndOfParagraph = isEndOfParagraph(visibleEnd);
bool selectionStartWasStartOfParagraph = isStartOfParagraph(visibleStart);
- Handle<Node> startBlock = enclosingBlock(visibleStart.deepEquivalent().deprecatedNode().handle().raw());
+ Handle<Node> startBlock = enclosingBlock(visibleStart.deepEquivalent().deprecatedNode());
Position insertionPos = selection.start();
bool startIsInsideMailBlockquote = enclosingNodeOfType(insertionPos, isMailBlockquote, CanCrossEditingBoundary);
@@ -931,7 +931,7 @@ void ReplaceSelectionCommand::doApply()
Handle<Element> currentRoot = selection.rootEditableElement();
if ((selectionStartWasStartOfParagraph && selectionEndWasEndOfParagraph && !startIsInsideMailBlockquote) ||
- startBlock == currentRoot || isListItem(startBlock.raw()) || selectionIsPlainText)
+ startBlock == currentRoot || isListItem(startBlock) || selectionIsPlainText)
m_preventNesting = false;
if (selection.isRange()) {
@@ -1005,11 +1005,11 @@ void ReplaceSelectionCommand::doApply()
if (endBR)
originalVisPosBeforeEndBR = VisiblePosition(positionBeforeNode(endBR), DOWNSTREAM).previous();
- startBlock = enclosingBlock(insertionPos.deprecatedNode().handle().raw());
+ startBlock = enclosingBlock(insertionPos.deprecatedNode());
// Adjust insertionPos to prevent nesting.
// If the start was in a Mail blockquote, we will have already handled adjusting insertionPos above.
- if (m_preventNesting && startBlock && !isTableCell(startBlock.raw()) && !startIsInsideMailBlockquote) {
+ if (m_preventNesting && startBlock && !isTableCell(startBlock) && !startIsInsideMailBlockquote) {
ASSERT(startBlock != currentRoot);
VisiblePosition visibleInsertionPos(insertionPos);
if (isEndOfBlock(visibleInsertionPos) && !(isStartOfBlock(visibleInsertionPos) && fragment.hasInterchangeNewlineAtEnd()))
@@ -1048,7 +1048,7 @@ void ReplaceSelectionCommand::doApply()
// We can skip this optimization for fragments not wrapped in one of
// our style spans and for positions inside list items
// since insertAsListItems already does the right thing.
- if (!m_matchStyle && !enclosingList(insertionPos.containerNode().handle().raw())) {
+ if (!m_matchStyle && !enclosingList(insertionPos.containerNode())) {
if (insertionPos.containerNode()->isTextNode() && insertionPos.offsetInContainerNode() && !insertionPos.atLastEditingPositionForNode()) {
splitTextNode(insertionPos.containerText(), insertionPos.offsetInContainerNode());
insertionPos = firstPositionInNode(insertionPos.containerNode());
@@ -1084,8 +1084,8 @@ void ReplaceSelectionCommand::doApply()
fragment.removeNode(refNode.raw());
- Handle<Node> blockStart = enclosingBlock(insertionPos.deprecatedNode().handle().raw());
- if ((isListElement(refNode.raw()) || (isLegacyAppleStyleSpan(refNode) && isListElement(refNode->firstChild().handle().raw())))
+ Handle<Node> blockStart = enclosingBlock(insertionPos.deprecatedNode());
+ if ((isListElement(refNode) || (isLegacyAppleStyleSpan(refNode) && isListElement(refNode->firstChild())))
&& blockStart && blockStart->renderer()->isListItem())
refNode = adoptRawResult(insertAsListItems(toHTMLElement(refNode), blockStart.raw(), insertionPos, insertedNodes));
else {
@@ -1125,7 +1125,7 @@ void ReplaceSelectionCommand::doApply()
if (!insertedNodes.firstNodeInserted() || !insertedNodes.firstNodeInserted()->inDocument())
return;
- VisiblePosition startOfInsertedContent = firstPositionInOrBeforeNode(insertedNodes.firstNodeInserted());
+ VisiblePosition startOfInsertedContent = firstPositionInOrBeforeNode(adoptRawResult(insertedNodes.firstNodeInserted()));
// We inserted before the startBlock to prevent nesting, and the content before the startBlock wasn't in its own block and
// didn't have a br after it, so the inserted content ended up in the same paragraph.
@@ -1133,10 +1133,10 @@ void ReplaceSelectionCommand::doApply()
insertNodeAt(createBreakElement(document()), startOfInsertedContent.deepEquivalent());
if (endBR && (plainTextFragment || shouldRemoveEndBR(endBR.raw(), originalVisPosBeforeEndBR))) {
- RefPtr<Node> parent = endBR->parentNode().passRefPtr();
+ Handle<Node> parent = endBR->parentNode();
insertedNodes.willRemoveNode(endBR.raw());
removeNode(endBR);
- if (Handle<Node> nodeToRemove = adoptRawResult(highestNodeToRemoveInPruning(parent.get()))) {
+ if (Handle<Node> nodeToRemove = highestNodeToRemoveInPruning(parent)) {
insertedNodes.willRemoveNode(nodeToRemove.raw());
removeNode(nodeToRemove);
}
@@ -1150,8 +1150,8 @@ void ReplaceSelectionCommand::doApply()
applyCommandToComposite(SimplifyMarkupCommand::create(document(), insertedNodes.firstNodeInserted(), insertedNodes.pastLastLeaf()));
// Setup m_startOfInsertedContent and m_endOfInsertedContent. This should be the last two lines of code that access insertedNodes.
- m_startOfInsertedContent = firstPositionInOrBeforeNode(insertedNodes.firstNodeInserted());
- m_endOfInsertedContent = lastPositionInOrAfterNode(insertedNodes.lastLeafInserted());
+ m_startOfInsertedContent = firstPositionInOrBeforeNode(adoptRawResult(insertedNodes.firstNodeInserted()));
+ m_endOfInsertedContent = lastPositionInOrAfterNode(adoptRawResult(insertedNodes.lastLeafInserted()));
// Determine whether or not we should merge the end of inserted content with what's after it before we do
// the start merge so that the start merge doesn't effect our decision.
@@ -1198,8 +1198,8 @@ void ReplaceSelectionCommand::doApply()
if (selectionEndWasEndOfParagraph || !isEndOfParagraph(endOfInsertedContent) || next.isNull()) {
if (!isStartOfParagraph(endOfInsertedContent)) {
setEndingSelection(endOfInsertedContent);
- Handle<Node> enclosingNode = enclosingBlock(endOfInsertedContent.deepEquivalent().deprecatedNode().handle().raw());
- if (isListItem(enclosingNode.raw())) {
+ Handle<Node> enclosingNode = enclosingBlock(endOfInsertedContent.deepEquivalent().deprecatedNode());
+ if (isListItem(enclosingNode)) {
Handle<Node> newListItem = createListItemElement(document());
insertNodeAfter(newListItem, enclosingNode);
setEndingSelection(VisiblePosition(firstPositionInNode(newListItem)));
@@ -1207,7 +1207,7 @@ void ReplaceSelectionCommand::doApply()
// Use a default paragraph element (a plain div) for the empty paragraph, using the last paragraph
// block's style seems to annoy users.
insertParagraphSeparator(true, !startIsInsideMailBlockquote && highestEnclosingNodeOfType(endOfInsertedContent.deepEquivalent(),
- isMailBlockquote, CannotCrossEditingBoundary, insertedNodes.firstNodeInserted()->parentNode().handle().raw()));
+ isMailBlockquote, CannotCrossEditingBoundary, insertedNodes.firstNodeInserted()->parentNode()));
}
// Select up to the paragraph separator that was added.
@@ -1222,8 +1222,8 @@ void ReplaceSelectionCommand::doApply()
} else
mergeEndIfNeeded();
- if (Node* mailBlockquote = enclosingNodeOfType(positionAtStartOfInsertedContent().deepEquivalent(), isMailPasteAsQuotationNode))
- removeNodeAttribute(adoptRawResult(toElement(mailBlockquote)), classAttr);
+ if (Handle<Node> mailBlockquote = enclosingNodeOfType(positionAtStartOfInsertedContent().deepEquivalent(), isMailPasteAsQuotationNode))
+ removeNodeAttribute(toElement(mailBlockquote), classAttr);
if (shouldPerformSmartReplace())
addSpacesForSmartReplace();
@@ -1385,7 +1385,7 @@ void ReplaceSelectionCommand::mergeTextNodesAroundPosition(Position& position, P
if (positionIsOffsetInAnchor)
position.moveToOffset(previous->length() + position.offsetInContainerNode());
else
- updatePositionForNodeRemoval(position, previous.raw());
+ updatePositionForNodeRemoval(position, previous);
if (positionOnlyToBeUpdatedIsOffsetInAnchor) {
if (positionOnlyToBeUpdated.containerNode() == text)
@@ -1393,7 +1393,7 @@ void ReplaceSelectionCommand::mergeTextNodesAroundPosition(Position& position, P
else if (positionOnlyToBeUpdated.containerNode() == previous)
positionOnlyToBeUpdated.moveToPosition(text, positionOnlyToBeUpdated.offsetInContainerNode());
} else
- updatePositionForNodeRemoval(positionOnlyToBeUpdated, previous.raw());
+ updatePositionForNodeRemoval(positionOnlyToBeUpdated, previous);
removeNode(previous);
}
@@ -1403,12 +1403,12 @@ void ReplaceSelectionCommand::mergeTextNodesAroundPosition(Position& position, P
insertTextIntoNode(text, originalLength, next->data());
if (!positionIsOffsetInAnchor)
- updatePositionForNodeRemoval(position, next.raw());
+ updatePositionForNodeRemoval(position, next);
if (positionOnlyToBeUpdatedIsOffsetInAnchor && positionOnlyToBeUpdated.containerNode() == next)
positionOnlyToBeUpdated.moveToPosition(text, originalLength + positionOnlyToBeUpdated.offsetInContainerNode());
else
- updatePositionForNodeRemoval(positionOnlyToBeUpdated, next.raw());
+ updatePositionForNodeRemoval(positionOnlyToBeUpdated, next);
removeNode(next);
}
@@ -1425,7 +1425,7 @@ Node* ReplaceSelectionCommand::insertAsListItems(const Handle<HTMLElement>& prpL
{
Handle<HTMLElement> listElement = prpListElement;
- while (listElement->hasChildNodes() && isListElement(listElement->firstChild().handle().raw()) && listElement->childNodeCount() == 1)
+ while (listElement->hasChildNodes() && isListElement(listElement->firstChild()) && listElement->childNodeCount() == 1)
listElement = toHTMLElement(listElement->firstChild());
bool isStart = isStartOfParagraph(insertPos);
@@ -1466,9 +1466,9 @@ void ReplaceSelectionCommand::updateNodesInserted(Node *node)
return;
if (m_startOfInsertedContent.isNull())
- m_startOfInsertedContent = firstPositionInOrBeforeNode(node);
+ m_startOfInsertedContent = firstPositionInOrBeforeNode(adoptRawResult(node));
- m_endOfInsertedContent = lastPositionInOrAfterNode(node->lastDescendant().handle().raw());
+ m_endOfInsertedContent = lastPositionInOrAfterNode(node->lastDescendant());
}
// During simple pastes, where we're just pasting a text node into a run of text, we insert the text node
« no previous file with comments | « Source/core/editing/ModifySelectionListLevel.cpp ('k') | Source/core/editing/TextIterator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698