| Index: third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
|
| index 404efc734fdefed17b44bc82568e29c7a5edc04c..e2e2b265313212ce823668da6396a63a3cedfe2a 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
|
| @@ -52,16 +52,16 @@ static Node* enclosingListChild(Node* node, Node* listNode)
|
|
|
| HTMLUListElement* InsertListCommand::fixOrphanedListChild(Node* node)
|
| {
|
| - RefPtrWillBeRawPtr<HTMLUListElement> listElement = HTMLUListElement::create(document());
|
| + RawPtr<HTMLUListElement> listElement = HTMLUListElement::create(document());
|
| insertNodeBefore(listElement, node);
|
| removeNode(node);
|
| appendNode(node, listElement);
|
| return listElement.get();
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<HTMLElement> InsertListCommand::mergeWithNeighboringLists(PassRefPtrWillBeRawPtr<HTMLElement> passedList)
|
| +RawPtr<HTMLElement> InsertListCommand::mergeWithNeighboringLists(RawPtr<HTMLElement> passedList)
|
| {
|
| - RefPtrWillBeRawPtr<HTMLElement> list = passedList;
|
| + RawPtr<HTMLElement> list = passedList;
|
| Element* previousList = ElementTraversal::previousSibling(*list);
|
| if (canMergeLists(previousList, list.get()))
|
| mergeIdenticalElements(previousList, list);
|
| @@ -73,7 +73,7 @@ PassRefPtrWillBeRawPtr<HTMLElement> InsertListCommand::mergeWithNeighboringLists
|
| if (!nextSibling || !nextSibling->isHTMLElement())
|
| return list.release();
|
|
|
| - RefPtrWillBeRawPtr<HTMLElement> nextList = toHTMLElement(nextSibling);
|
| + RawPtr<HTMLElement> nextList = toHTMLElement(nextSibling);
|
| if (canMergeLists(list.get(), nextList.get())) {
|
| mergeIdenticalElements(list, nextList);
|
| return nextList.release();
|
| @@ -144,9 +144,9 @@ void InsertListCommand::doApply()
|
| VisiblePosition endOfSelection = selection.visibleEnd();
|
| VisiblePosition startOfLastParagraph = startOfParagraph(endOfSelection, CanSkipOverEditingBoundary);
|
|
|
| - RefPtrWillBeRawPtr<Range> currentSelection = firstRangeOf(endingSelection());
|
| - RefPtrWillBeRawPtr<ContainerNode> scopeForStartOfSelection = nullptr;
|
| - RefPtrWillBeRawPtr<ContainerNode> scopeForEndOfSelection = nullptr;
|
| + RawPtr<Range> currentSelection = firstRangeOf(endingSelection());
|
| + RawPtr<ContainerNode> scopeForStartOfSelection = nullptr;
|
| + RawPtr<ContainerNode> scopeForEndOfSelection = nullptr;
|
| // FIXME: This is an inefficient way to keep selection alive because
|
| // indexForVisiblePosition walks from the beginning of the document to the
|
| // endOfSelection everytime this code is executed. But not using index is hard
|
| @@ -218,7 +218,7 @@ bool InsertListCommand::doApplyForSingleParagraph(bool forceCreateList, const HT
|
| if (!listChildNode->parentNode()->hasEditableStyle())
|
| return false;
|
| // Remove the list child.
|
| - RefPtrWillBeRawPtr<HTMLElement> listElement = enclosingList(listChildNode);
|
| + RawPtr<HTMLElement> listElement = enclosingList(listChildNode);
|
| if (listElement) {
|
| if (!listElement->hasEditableStyle()) {
|
| // Since, |listElement| is uneditable, we can't move |listChild|
|
| @@ -253,7 +253,7 @@ bool InsertListCommand::doApplyForSingleParagraph(bool forceCreateList, const HT
|
| bool rangeStartIsInList = visiblePositionBeforeNode(*listElement).deepEquivalent() == createVisiblePosition(currentSelection.startPosition()).deepEquivalent();
|
| bool rangeEndIsInList = visiblePositionAfterNode(*listElement).deepEquivalent() == createVisiblePosition(currentSelection.endPosition()).deepEquivalent();
|
|
|
| - RefPtrWillBeRawPtr<HTMLElement> newList = createHTMLElement(document(), listTag);
|
| + RawPtr<HTMLElement> newList = createHTMLElement(document(), listTag);
|
| insertNodeBefore(newList, listElement);
|
|
|
| Node* firstChildInList = enclosingListChild(createVisiblePosition(firstPositionInNode(listElement.get())).deepEquivalent().anchorNode(), listElement.get());
|
| @@ -316,8 +316,8 @@ void InsertListCommand::unlistifyParagraph(const VisiblePosition& originalStart,
|
| }
|
| // When removing a list, we must always create a placeholder to act as a point of insertion
|
| // for the list content being removed.
|
| - RefPtrWillBeRawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document());
|
| - RefPtrWillBeRawPtr<HTMLElement> elementToInsert = placeholder;
|
| + RawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document());
|
| + RawPtr<HTMLElement> elementToInsert = placeholder;
|
| // If the content of the list item will be moved into another list, put it in a list item
|
| // so that we don't create an orphaned list child.
|
| if (enclosingList(listElement)) {
|
| @@ -383,7 +383,7 @@ void InsertListCommand::listifyParagraph(const VisiblePosition& originalStart, c
|
| HTMLElement* const nextList = adjacentEnclosingList(start, nextPositionOf(end, CannotCrossEditingBoundary), listTag);
|
| if (previousList || nextList) {
|
| // Place list item into adjoining lists.
|
| - const RefPtrWillBeRawPtr<HTMLLIElement> listItemElement = HTMLLIElement::create(document());
|
| + const RawPtr<HTMLLIElement> listItemElement = HTMLLIElement::create(document());
|
| if (previousList)
|
| appendNode(listItemElement, previousList);
|
| else
|
| @@ -404,7 +404,7 @@ void InsertListCommand::listifyParagraph(const VisiblePosition& originalStart, c
|
| // a placeholder and then recompute start and end.
|
| Position startPos = start.deepEquivalent();
|
| if (start.deepEquivalent() == end.deepEquivalent() && isEnclosingBlock(start.deepEquivalent().anchorNode())) {
|
| - const RefPtrWillBeRawPtr<HTMLBRElement> placeholder = insertBlockPlaceholder(startPos);
|
| + const RawPtr<HTMLBRElement> placeholder = insertBlockPlaceholder(startPos);
|
| startPos = Position::beforeNode(placeholder.get());
|
| }
|
|
|
| @@ -419,9 +419,9 @@ void InsertListCommand::listifyParagraph(const VisiblePosition& originalStart, c
|
| if (isHTMLLIElement(listChild))
|
| insertionPos = positionInParentBeforeNode(*listChild);
|
|
|
| - const RefPtrWillBeRawPtr<HTMLElement> listElement = createHTMLElement(document(), listTag);
|
| + const RawPtr<HTMLElement> listElement = createHTMLElement(document(), listTag);
|
| insertNodeAt(listElement, insertionPos);
|
| - const RefPtrWillBeRawPtr<HTMLLIElement> listItemElement = HTMLLIElement::create(document());
|
| + const RawPtr<HTMLLIElement> listItemElement = HTMLLIElement::create(document());
|
| appendNode(listItemElement, listElement);
|
|
|
| // We inserted the list at the start of the content we're about to move
|
| @@ -436,10 +436,10 @@ void InsertListCommand::listifyParagraph(const VisiblePosition& originalStart, c
|
| mergeWithNeighboringLists(listElement);
|
| }
|
|
|
| -void InsertListCommand::moveParagraphOverPositionIntoEmptyListItem(const VisiblePosition& pos, PassRefPtrWillBeRawPtr<HTMLLIElement> listItemElement)
|
| +void InsertListCommand::moveParagraphOverPositionIntoEmptyListItem(const VisiblePosition& pos, RawPtr<HTMLLIElement> listItemElement)
|
| {
|
| ASSERT(!listItemElement->hasChildren());
|
| - const RefPtrWillBeRawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document());
|
| + const RawPtr<HTMLBRElement> placeholder = HTMLBRElement::create(document());
|
| appendNode(placeholder, listItemElement);
|
| // Inserting list element and list item list may change start of pargraph
|
| // to move. We calculate start of paragraph again.
|
|
|