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

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

Issue 299353004: Oilpan: move editing objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make test wrapper class finalized Created 6 years, 7 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/ApplyBlockElementCommand.h ('k') | Source/core/editing/ApplyStyleCommand.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/ApplyBlockElementCommand.cpp
diff --git a/Source/core/editing/ApplyBlockElementCommand.cpp b/Source/core/editing/ApplyBlockElementCommand.cpp
index cf782cbd3db95e8961b4400037ba809abe60b654..074f42fd5b77e7ea4e3d060dfae7cf93b5023f89 100644
--- a/Source/core/editing/ApplyBlockElementCommand.cpp
+++ b/Source/core/editing/ApplyBlockElementCommand.cpp
@@ -111,15 +111,15 @@ void ApplyBlockElementCommand::formatSelection(const VisiblePosition& startOfSel
// and there's nothing to move.
Position start = startOfSelection.deepEquivalent().downstream();
if (isAtUnsplittableElement(start)) {
- RefPtr<Element> blockquote = createBlockElement();
+ RefPtrWillBeRawPtr<Element> blockquote = createBlockElement();
insertNodeAt(blockquote, start);
- RefPtr<Element> placeholder = createBreakElement(document());
+ RefPtrWillBeRawPtr<Element> placeholder = createBreakElement(document());
appendNode(placeholder, blockquote);
setEndingSelection(VisibleSelection(positionBeforeNode(placeholder.get()), DOWNSTREAM, endingSelection().isDirectional()));
return;
}
- RefPtr<Element> blockquoteForNextIndent;
+ RefPtrWillBeRawPtr<Element> blockquoteForNextIndent = nullptr;
VisiblePosition endOfCurrentParagraph = endOfParagraph(startOfSelection);
VisiblePosition endOfLastParagraph = endOfParagraph(endOfSelection);
VisiblePosition endAfterSelection = endOfParagraph(endOfLastParagraph.next());
@@ -280,12 +280,18 @@ VisiblePosition ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfN
return VisiblePosition(Position(text.get(), position.offsetInContainerNode() - 1));
}
-PassRefPtr<Element> ApplyBlockElementCommand::createBlockElement() const
+PassRefPtrWillBeRawPtr<Element> ApplyBlockElementCommand::createBlockElement() const
{
- RefPtr<Element> element = createHTMLElement(document(), m_tagName);
+ RefPtrWillBeRawPtr<Element> element = createHTMLElement(document(), m_tagName);
if (m_inlineStyle.length())
element->setAttribute(styleAttr, m_inlineStyle);
return element.release();
}
+void ApplyBlockElementCommand::trace(Visitor* visitor)
+{
+ visitor->trace(m_endOfLastParagraph);
+ CompositeEditCommand::trace(visitor);
+}
+
}
« no previous file with comments | « Source/core/editing/ApplyBlockElementCommand.h ('k') | Source/core/editing/ApplyStyleCommand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698