Index: Source/core/editing/CompositeEditCommand.cpp |
diff --git a/Source/core/editing/CompositeEditCommand.cpp b/Source/core/editing/CompositeEditCommand.cpp |
index 0d1079292aac91956df0635200139c303d742ff9..b049591423e2fdb76766f90956b54f5b7d56defe 100644 |
--- a/Source/core/editing/CompositeEditCommand.cpp |
+++ b/Source/core/editing/CompositeEditCommand.cpp |
@@ -834,7 +834,7 @@ PassRefPtr<Node> CompositeEditCommand::appendBlockPlaceholder(PassRefPtr<Element |
// Should assert isBlockFlow || isInlineFlow when deletion improves. See 4244964. |
ASSERT(container->renderer()); |
- RefPtr<Node> placeholder = createBlockPlaceholderElement(&document()); |
+ RefPtr<Node> placeholder = createBlockPlaceholderElement(document()); |
appendNode(placeholder, container); |
return placeholder.release(); |
} |
@@ -847,7 +847,7 @@ PassRefPtr<Node> CompositeEditCommand::insertBlockPlaceholder(const Position& po |
// Should assert isBlockFlow || isInlineFlow when deletion improves. See 4244964. |
ASSERT(pos.deprecatedNode()->renderer()); |
- RefPtr<Node> placeholder = createBlockPlaceholderElement(&document()); |
+ RefPtr<Node> placeholder = createBlockPlaceholderElement(document()); |
insertNodeAt(placeholder, pos); |
return placeholder.release(); |
} |
@@ -888,8 +888,8 @@ void CompositeEditCommand::removePlaceholderAt(const Position& p) |
PassRefPtr<Node> CompositeEditCommand::insertNewDefaultParagraphElementAt(const Position& position) |
{ |
- RefPtr<Element> paragraphElement = createDefaultParagraphElement(&document()); |
- paragraphElement->appendChild(createBreakElement(&document())); |
+ RefPtr<Element> paragraphElement = createDefaultParagraphElement(document()); |
+ paragraphElement->appendChild(createBreakElement(document())); |
insertNodeAt(paragraphElement, position); |
return paragraphElement.release(); |
} |
@@ -1126,7 +1126,7 @@ void CompositeEditCommand::moveParagraphWithClones(const VisiblePosition& startO |
if (beforeParagraph.isNotNull() && !isTableElement(beforeParagraph.deepEquivalent().deprecatedNode()) |
&& ((!isEndOfParagraph(beforeParagraph) && !isStartOfParagraph(beforeParagraph)) || beforeParagraph == afterParagraph)) { |
// FIXME: Trim text between beforeParagraph and afterParagraph if they aren't equal. |
- insertNodeAt(createBreakElement(&document()), beforeParagraph.deepEquivalent()); |
+ insertNodeAt(createBreakElement(document()), beforeParagraph.deepEquivalent()); |
} |
} |
@@ -1221,7 +1221,7 @@ void CompositeEditCommand::moveParagraphs(const VisiblePosition& startOfParagrap |
afterParagraph = VisiblePosition(afterParagraph.deepEquivalent()); |
if (beforeParagraph.isNotNull() && (!isEndOfParagraph(beforeParagraph) || beforeParagraph == afterParagraph)) { |
// FIXME: Trim text between beforeParagraph and afterParagraph if they aren't equal. |
- insertNodeAt(createBreakElement(&document()), beforeParagraph.deepEquivalent()); |
+ insertNodeAt(createBreakElement(document()), beforeParagraph.deepEquivalent()); |
// Need an updateLayout here in case inserting the br has split a text node. |
document().updateLayoutIgnorePendingStylesheets(); |
} |
@@ -1284,15 +1284,15 @@ bool CompositeEditCommand::breakOutOfEmptyListItem() |
// e.g. <ul><li> <ul><li><br></li></ul> hello</li></ul> should become <ul><li> <div><br></div> hello</li></ul> at the end |
splitElement(toElement(blockEnclosingList), listNode); |
removeNodePreservingChildren(listNode->parentNode()); |
- newBlock = createListItemElement(&document()); |
+ newBlock = createListItemElement(document()); |
} |
// If listNode does NOT appear at the end of the outer list item, then behave as if in a regular paragraph. |
} else if (blockEnclosingList->hasTagName(olTag) || blockEnclosingList->hasTagName(ulTag)) { |
- newBlock = createListItemElement(&document()); |
+ newBlock = createListItemElement(document()); |
} |
} |
if (!newBlock) |
- newBlock = createDefaultParagraphElement(&document()); |
+ newBlock = createDefaultParagraphElement(document()); |
RefPtr<Node> previousListNode = emptyListItem->isElementNode() ? toElement(emptyListItem.get())->previousElementSibling(): emptyListItem->previousSibling(); |
RefPtr<Node> nextListNode = emptyListItem->isElementNode() ? toElement(emptyListItem.get())->nextElementSibling(): emptyListItem->nextSibling(); |
@@ -1343,7 +1343,7 @@ bool CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph() |
if (enclosingNodeOfType(previous.deepEquivalent(), &isMailBlockquote)) |
return false; |
- RefPtr<Node> br = createBreakElement(&document()); |
+ RefPtr<Node> br = createBreakElement(document()); |
// We want to replace this quoted paragraph with an unquoted one, so insert a br |
// to hold the caret before the highest blockquote. |
insertNodeBefore(br, highestBlockquote); |
@@ -1351,7 +1351,7 @@ bool CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph() |
// If the br we inserted collapsed, for example foo<br><blockquote>...</blockquote>, insert |
// a second one. |
if (!isStartOfParagraph(atBR)) |
- insertNodeBefore(createBreakElement(&document()), br); |
+ insertNodeBefore(createBreakElement(document()), br); |
setEndingSelection(VisibleSelection(atBR, endingSelection().isDirectional())); |
// If this is an empty paragraph there must be a line break here. |
@@ -1464,9 +1464,9 @@ PassRefPtr<Node> CompositeEditCommand::splitTreeToNode(Node* start, Node* end, b |
return node.release(); |
} |
-PassRefPtr<Element> createBlockPlaceholderElement(Document* document) |
+PassRefPtr<Element> createBlockPlaceholderElement(Document& document) |
{ |
- RefPtr<Element> breakNode = document->createElement(brTag, false); |
+ RefPtr<Element> breakNode = document.createElement(brTag, false); |
return breakNode.release(); |
} |