summaryrefslogtreecommitdiffstats
path: root/WebCore/editing/BreakBlockquoteCommand.cpp
diff options
context:
space:
mode:
authorFeng Qian <>2009-04-10 18:11:29 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-10 18:11:29 -0700
commit8f72e70a9fd78eec56623b3a62e68f16b7b27e28 (patch)
tree181bf9a400c30a1bf34ea6d72560e8d00111d549 /WebCore/editing/BreakBlockquoteCommand.cpp
parent7ed56f225e0ade046e1c2178977f72b2d896f196 (diff)
downloadexternal_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.zip
external_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.tar.gz
external_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.tar.bz2
AI 145796: Land the WebKit merge @r42026.
Automated import of CL 145796
Diffstat (limited to 'WebCore/editing/BreakBlockquoteCommand.cpp')
-rw-r--r--WebCore/editing/BreakBlockquoteCommand.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/WebCore/editing/BreakBlockquoteCommand.cpp b/WebCore/editing/BreakBlockquoteCommand.cpp
index 76a0890..2a513a5 100644
--- a/WebCore/editing/BreakBlockquoteCommand.cpp
+++ b/WebCore/editing/BreakBlockquoteCommand.cpp
@@ -72,7 +72,7 @@ void BreakBlockquoteCommand::doApply()
insertNodeAfter(breakNode.get(), topBlockquote);
if (isLastVisiblePositionInNode(visiblePos, topBlockquote)) {
- setEndingSelection(Selection(Position(breakNode.get(), 0), DOWNSTREAM));
+ setEndingSelection(VisibleSelection(Position(breakNode.get(), 0), DOWNSTREAM));
rebalanceWhitespace();
return;
}
@@ -85,19 +85,19 @@ void BreakBlockquoteCommand::doApply()
// Split at pos if in the middle of a text node.
if (startNode->isTextNode()) {
Text* textNode = static_cast<Text*>(startNode);
- if ((unsigned)pos.offset() >= textNode->length()) {
+ if ((unsigned)pos.m_offset >= textNode->length()) {
startNode = startNode->traverseNextNode();
ASSERT(startNode);
- } else if (pos.offset() > 0)
- splitTextNode(textNode, pos.offset());
- } else if (pos.offset() > 0) {
+ } else if (pos.m_offset > 0)
+ splitTextNode(textNode, pos.m_offset);
+ } else if (pos.m_offset > 0) {
startNode = startNode->traverseNextNode();
ASSERT(startNode);
}
// If there's nothing inside topBlockquote to move, we're finished.
if (!startNode->isDescendantOf(topBlockquote)) {
- setEndingSelection(Selection(VisiblePosition(Position(startNode, 0))));
+ setEndingSelection(VisibleSelection(VisiblePosition(Position(startNode, 0))));
return;
}
@@ -107,7 +107,7 @@ void BreakBlockquoteCommand::doApply()
ancestors.append(node);
// Insert a clone of the top blockquote after the break.
- RefPtr<Element> clonedBlockquote = topBlockquote->cloneElement();
+ RefPtr<Element> clonedBlockquote = topBlockquote->cloneElementWithoutChildren();
insertNodeAfter(clonedBlockquote.get(), breakNode.get());
// Clone startNode's ancestors into the cloned blockquote.
@@ -116,7 +116,7 @@ void BreakBlockquoteCommand::doApply()
// or clonedBlockquote if ancestors is empty).
RefPtr<Element> clonedAncestor = clonedBlockquote;
for (size_t i = ancestors.size(); i != 0; --i) {
- RefPtr<Element> clonedChild = ancestors[i - 1]->cloneElement(); // shallow clone
+ RefPtr<Element> clonedChild = ancestors[i - 1]->cloneElementWithoutChildren();
// Preserve list item numbering in cloned lists.
if (clonedChild->isElementNode() && clonedChild->hasTagName(olTag)) {
Node* listChildNode = i > 1 ? ancestors[i - 2] : startNode;
@@ -168,7 +168,7 @@ void BreakBlockquoteCommand::doApply()
addBlockPlaceholderIfNeeded(clonedBlockquote.get());
// Put the selection right before the break.
- setEndingSelection(Selection(Position(breakNode.get(), 0), DOWNSTREAM));
+ setEndingSelection(VisibleSelection(Position(breakNode.get(), 0), DOWNSTREAM));
rebalanceWhitespace();
}