Reduce use of makeRefPtr() and use RefPtr { } directly
https://bugs.webkit.org/show_bug.cgi?id=230503

Reviewed by Geoffrey Garen.

Source/WebCore:

* Modules/async-clipboard/Clipboard.cpp:
(WebCore::Clipboard::readText):
(WebCore::Clipboard::writeText):
(WebCore::Clipboard::read):
(WebCore::Clipboard::getType):
(WebCore::Clipboard::write):
* Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
(WebCore::ClipboardItemBindingsDataSource::getType):
(WebCore::ClipboardItemBindingsDataSource::collectDataForWriting):
(WebCore::ClipboardItemBindingsDataSource::invokeCompletionHandler):
* Modules/async-clipboard/ClipboardItemPasteboardDataSource.cpp:
(WebCore::ClipboardItemPasteboardDataSource::getType):
* Modules/highlight/AppHighlightStorage.cpp:
(WebCore::findNodeStartingAtPathComponentIndex):
(WebCore::findNode):
(WebCore::AppHighlightStorage::attemptToRestoreHighlightAndScroll):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::deleteFunction):
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::showMediaControlsContextMenu):
* Modules/mediasession/MediaSession.cpp:
(WebCore::MediaSession::MediaSession):
* Modules/mediasession/MediaSessionCoordinator.cpp:
(WebCore::MediaSessionCoordinator::join):
(WebCore::MediaSessionCoordinator::seekTo):
(WebCore::MediaSessionCoordinator::play):
(WebCore::MediaSessionCoordinator::pause):
(WebCore::MediaSessionCoordinator::setTrack):
* Modules/mediasession/MediaSessionCoordinatorPrivate.cpp:
(WebCore::MediaSessionCoordinatorPrivate::setLogger):
* Modules/mediastream/MediaStream.cpp:
(WebCore::createTrackPrivateVector):
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::shippingAddressChanged):
* Modules/speech/SpeechRecognition.cpp:
(WebCore::SpeechRecognition::SpeechRecognition):
* Modules/webdatabase/Database.cpp:
(WebCore::Database::scheduleTransactionCallback):
* Modules/webxr/WebXRInputSource.cpp:
(WebCore::WebXRInputSource::update):
(WebCore::WebXRInputSource::pollEvents):
* Modules/webxr/WebXRInputSourceArray.cpp:
(WebCore::WebXRInputSourceArray::update):
* Modules/webxr/WebXRSession.cpp:
(WebCore::WebXRSession::didCompleteShutdown):
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::handleAriaExpandedChange):
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::treeForPageID):
* animation/DocumentTimelinesController.cpp:
(WebCore::DocumentTimelinesController::cacheCurrentTime):
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::setTarget):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::finishNotificationSteps):
* bridge/runtime_object.cpp:
(JSC::Bindings::JSC_DEFINE_HOST_FUNCTION):
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeSelfOrChildNodesForInsertion):
* dom/Document.cpp:
(WebCore::Document::updateTitle):
(WebCore::Document::implicitClose):
(WebCore::Document::didRemoveAllPendingStylesheet):
(WebCore::Document::prepareMouseEvent):
(WebCore::command):
* dom/Element.cpp:
(WebCore::Element::scrollTo):
(WebCore::Element::offsetLeftForBindings):
(WebCore::Element::offsetTopForBindings):
(WebCore::Element::focus):
* dom/EventContext.h:
(WebCore::EventContext::EventContext):
* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent):
* dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::requestFullscreenForElement):
(WebCore::FullscreenManager::exitFullscreen):
* dom/IdleDeadline.cpp:
(WebCore::IdleDeadline::timeRemaining const):
(WebCore::IdleDeadline::didTimeout const):
* dom/MutationObserver.cpp:
(WebCore::MutationObserver::disconnect):
* dom/Position.cpp:
(WebCore::Position::firstNode const):
(WebCore::makeBoundaryPoint):
* dom/SlotAssignment.cpp:
(WebCore::SlotAssignment::removeSlotElementByName):
(WebCore::SlotAssignment::didChangeSlot):
* dom/messageports/WorkerMessagePortChannelProvider.cpp:
(WebCore::WorkerMessagePortChannelProvider::takeAllMessagesForPort):
(WebCore::WorkerMessagePortChannelProvider::checkRemotePortForActivity):
* editing/ApplyBlockElementCommand.cpp:
(WebCore::ApplyBlockElementCommand::endOfNextParagraphSplittingTextNodesIfNeeded):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyBlockStyle):
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
(WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
(WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
(WebCore::highestEmbeddingAncestor):
(WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle):
(WebCore::containsNonEditableRegion):
(WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
(WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun):
(WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle):
(WebCore::ApplyStyleCommand::removeInlineStyle):
(WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
(WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
(WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
(WebCore::ApplyStyleCommand::joinChildTextNodes):
* editing/ChangeListTypeCommand.cpp:
(WebCore::ChangeListTypeCommand::listConversionType):
* editing/CompositeEditCommand.cpp:
(WebCore::postTextStateChangeNotification):
(WebCore::CompositeEditCommand::insertNodeBefore):
(WebCore::CompositeEditCommand::insertNodeAfter):
(WebCore::CompositeEditCommand::insertNodeAt):
(WebCore::CompositeEditCommand::removeChildrenInRange):
(WebCore::CompositeEditCommand::removeNodeAndPruneAncestors):
(WebCore::CompositeEditCommand::prune):
(WebCore::CompositeEditCommand::positionOutsideTabSpan):
(WebCore::CompositeEditCommand::textNodeForRebalance const):
(WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit):
(WebCore::CompositeEditCommand::cleanupAfterDeletion):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/DeleteSelectionCommand.cpp:
(WebCore::isTableRowEmpty):
(WebCore::firstInSpecialElement):
(WebCore::lastInSpecialElement):
(WebCore::DeleteSelectionCommand::initializePositionData):
(WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete):
(WebCore::firstEditablePositionInNode):
(WebCore::DeleteSelectionCommand::removeNode):
(WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
(WebCore::DeleteSelectionCommand::handleGeneralDelete):
(WebCore::DeleteSelectionCommand::mergeParagraphs):
(WebCore::DeleteSelectionCommand::removePreviouslySelectedEmptyTableRows):
(WebCore::DeleteSelectionCommand::removeRedundantBlocks):
(WebCore::DeleteSelectionCommand::doApply):
* editing/EditCommand.cpp:
(WebCore::EditCommand::postTextStateChangeNotification):
* editing/Editing.cpp:
(WebCore::highestNodeToRemoveInPruning):
* editing/Editor.cpp:
(WebCore::Editor::selectionForCommand):
(WebCore::Editor::shouldInsertFragment):
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::respondToChangedContents):
(WebCore::Editor::hasBidiSelection const):
(WebCore::Editor::selectionUnorderedListState const):
(WebCore::Editor::selectionOrderedListState const):
(WebCore::Editor::findEventTargetFrom const):
(WebCore::Editor::applyStyle):
(WebCore::Editor::applyParagraphStyle):
(WebCore::notifyTextFromControls):
(WebCore::Editor::willApplyEditing):
(WebCore::Editor::insertTextWithoutSendingTextEvent):
(WebCore::Editor::copyImage):
(WebCore::Editor::renderLayerDidScroll):
(WebCore::Editor::setBaseWritingDirection):
(WebCore::Editor::baseWritingDirectionForSelectionStart const):
(WebCore::Editor::confirmOrCancelCompositionAndNotifyClient):
(WebCore::Editor::setComposition):
(WebCore::Editor::advanceToNextMisspelling):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::isSpellCheckingEnabledFor const):
(WebCore::Editor::markAndReplaceFor):
(WebCore::Editor::removeTextPlaceholder):
(WebCore::Editor::applyEditingStyleToBodyElement const):
(WebCore::findFirstMarkable):
(WebCore::Editor::resolveTextCheckingTypeMask):
(WebCore::editableTextListsAtPositionInDescendingOrder):
(WebCore::Editor::fontAttributesAtSelectionStart):
(WebCore::Editor::styleForSelectionStart):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelection):
(WebCore::FrameSelection::selectFrameElementInParentIfFullySelected):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::fixOrphanedListChild):
(WebCore::InsertListCommand::unlistifyParagraph):
* editing/InsertNestedListCommand.cpp:
(WebCore::InsertNestedListCommand::doApply):
* editing/RemoveNodePreservingChildrenCommand.cpp:
(WebCore::RemoveNodePreservingChildrenCommand::doApply):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::positionAvoidingPrecedingNodes):
(WebCore::ReplacementFragment::ReplacementFragment):
(WebCore::ReplacementFragment::removeUnrenderedNodes):
(WebCore::ReplacementFragment::removeInterchangeNodes):
(WebCore::ReplaceSelectionCommand::shouldMerge):
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
(WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
(WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor):
(WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds):
(WebCore::ReplaceSelectionCommand::positionAtEndOfInsertedContent const):
(WebCore::handleStyleSpansBeforeInsertion):
(WebCore::ReplaceSelectionCommand::handleStyleSpans):
(WebCore::enclosingInline):
(WebCore::ReplaceSelectionCommand::doApply):
(WebCore::ReplaceSelectionCommand::shouldPerformSmartReplace const):
(WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
(WebCore::singleChildList):
(WebCore::deepestSingleChildList):
(WebCore::ReplaceSelectionCommand::insertAsListItems):
* editing/TextIterator.cpp:
(WebCore::TextIterator::handleReplacedElement):
* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::startObservingParagraphs):
(WebCore::tokenInfo):
(WebCore::isEnclosingItemBoundaryElement):
(WebCore::TextManipulationController::observeParagraphs):
(WebCore::TextManipulationController::scheduleObservationUpdate):
(WebCore::TextManipulationController::replace):
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::document const):
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::createElementForImageOverlay):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::replaceRichContentWithAttachments):
(WebCore::WebContentReader::readDataBuffer):
* editing/markup.cpp:
(WebCore::serializePreservingVisualAppearanceInternal):
(WebCore::sanitizedMarkupForFragmentInDocument):
* page/VisualViewport.cpp:
(WebCore::VisualViewport::update):
* platform/audio/cocoa/AudioSampleDataSource.mm:
(WebCore::AudioSampleDataSource::setupConverter):
(WebCore::AudioSampleDataSource::pushSamplesInternal):
(WebCore::AudioSampleDataSource::pullSamplesInternal):
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::enqueueSample):

Source/WTF:

* wtf/CrossThreadTask.h:
(WTF::createCrossThreadTask):

Tools:

* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptControllerIOS::singleTapAtPointWithModifiers):
(WTR::UIScriptControllerIOS::sendEventStream):
(WTR::UIScriptControllerIOS::dragFromPointToPoint):
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptControllerMac::activateDataListSuggestion):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@282784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/editing/DeleteSelectionCommand.cpp b/Source/WebCore/editing/DeleteSelectionCommand.cpp
index 46c467f..329ac32 100644
--- a/Source/WebCore/editing/DeleteSelectionCommand.cpp
+++ b/Source/WebCore/editing/DeleteSelectionCommand.cpp
@@ -67,7 +67,7 @@
     if (!isTableRow(row))
         return false;
 
-    for (auto child = makeRefPtr(row->firstChild()); child; child = child->nextSibling()) {
+    for (RefPtr child = row->firstChild(); child; child = child->nextSibling()) {
         if (isTableCell(child.get()) && !isTableCellEmpty(child.get()))
             return false;
     }
@@ -103,8 +103,8 @@
 
 static RefPtr<HTMLElement> firstInSpecialElement(const Position& position)
 {
-    auto rootEditableElement = makeRefPtr(position.rootEditableElement());
-    for (auto node = makeRefPtr(position.deprecatedNode()); node && node->rootEditableElement() == rootEditableElement; node = node->parentNode()) {
+    RefPtr rootEditableElement { position.rootEditableElement() };
+    for (RefPtr node = position.deprecatedNode(); node && node->rootEditableElement() == rootEditableElement; node = node->parentNode()) {
         if (!isSpecialHTMLElement(*node))
             continue;
         VisiblePosition visiblePosition = position;
@@ -119,8 +119,8 @@
 
 static RefPtr<HTMLElement> lastInSpecialElement(const Position& position)
 {
-    auto rootEditableElement = makeRefPtr(position.rootEditableElement());
-    for (auto node = makeRefPtr(position.deprecatedNode()); node && node->rootEditableElement() == rootEditableElement; node = node->parentNode()) {
+    RefPtr rootEditableElement { position.rootEditableElement() };
+    for (RefPtr node = position.deprecatedNode(); node && node->rootEditableElement() == rootEditableElement; node = node->parentNode()) {
         if (!isSpecialHTMLElement(*node))
             continue;
         VisiblePosition visiblePosition = position;
@@ -321,8 +321,8 @@
     // Don't move content out of a table cell.
     // If the cell is non-editable, enclosingNodeOfType won't return it by default, so
     // tell that function that we don't care if it returns non-editable nodes.
-    auto startCell = makeRefPtr(enclosingNodeOfType(m_upstreamStart, &isTableCell, CanCrossEditingBoundary));
-    auto endCell = makeRefPtr(enclosingNodeOfType(m_downstreamEnd, &isTableCell, CanCrossEditingBoundary));
+    RefPtr startCell { enclosingNodeOfType(m_upstreamStart, &isTableCell, CanCrossEditingBoundary) };
+    RefPtr endCell { enclosingNodeOfType(m_downstreamEnd, &isTableCell, CanCrossEditingBoundary) };
     // FIXME: This isn't right.  A borderless table with two rows and a single column would appear as two paragraphs.
     if (endCell && endCell != startCell)
         m_mergeBlocksAfterDelete = false;
@@ -434,10 +434,10 @@
 
 bool DeleteSelectionCommand::handleSpecialCaseBRDelete()
 {
-    auto nodeAfterUpstreamStart = makeRefPtr(m_upstreamStart.computeNodeAfterPosition());
-    auto nodeAfterDownstreamStart = makeRefPtr(m_downstreamStart.computeNodeAfterPosition());
+    RefPtr nodeAfterUpstreamStart { m_upstreamStart.computeNodeAfterPosition() };
+    RefPtr nodeAfterDownstreamStart { m_downstreamStart.computeNodeAfterPosition() };
     // Upstream end will appear before BR due to canonicalization
-    auto nodeAfterUpstreamEnd = makeRefPtr(m_upstreamEnd.computeNodeAfterPosition());
+    RefPtr nodeAfterUpstreamEnd { m_upstreamEnd.computeNodeAfterPosition() };
 
     if (!nodeAfterUpstreamStart || !nodeAfterDownstreamStart)
         return false;
@@ -469,7 +469,7 @@
 static Position firstEditablePositionInNode(Node* node)
 {
     ASSERT(node);
-    auto next = makeRefPtr(node);
+    RefPtr next { node };
     while (next && !next->hasEditableStyle())
         next = NodeTraversal::next(*next, node);
     return next ? firstPositionInOrBeforeNode(next.get()) : Position();
@@ -527,9 +527,9 @@
             if (!node.firstChild())
                 return;
             // Search this non-editable region for editable regions to empty.
-            auto child = makeRefPtr(node.firstChild());
+            RefPtr child { node.firstChild() };
             while (child) {
-                auto nextChild = makeRefPtr(child->nextSibling());
+                RefPtr nextChild { child->nextSibling() };
                 removeNode(*child, shouldAssumeContentIsAlwaysEditable);
                 // Bail if nextChild is no longer node's child.
                 if (nextChild && nextChild->parentNode() != &node)
@@ -545,13 +545,13 @@
     if (shouldRemoveContentOnly(node)) {
         // Do not remove an element of table structure; remove its contents.
         // Likewise for the root editable element.
-        auto child = makeRefPtr(NodeTraversal::next(node, &node));
+        RefPtr child { NodeTraversal::next(node, &node) };
         while (child) {
             if (shouldRemoveContentOnly(*child)) {
                 child = NodeTraversal::next(*child, &node);
                 continue;
             }
-            auto nextChild = makeRefPtr(NodeTraversal::nextSkippingChildren(*child, &node));
+            RefPtr nextChild { NodeTraversal::nextSkippingChildren(*child, &node) };
             removeNodeUpdatingStates(*child, shouldAssumeContentIsAlwaysEditable);
             child = WTFMove(nextChild);
         }
@@ -560,9 +560,9 @@
         auto& element = downcast<Element>(node);
         document().updateLayoutIgnorePendingStylesheets();
         // Check if we need to insert a placeholder for descendant table cells.
-        auto descendant = makeRefPtr(ElementTraversal::next(element, &element));
+        RefPtr descendant { ElementTraversal::next(element, &element) };
         while (descendant) {
-            auto nextDescendant = makeRefPtr(ElementTraversal::next(*descendant, &element));
+            RefPtr nextDescendant { ElementTraversal::next(*descendant, &element) };
             insertBlockPlaceholderForTableCellIfNeeded(*descendant);
             descendant = WTFMove(nextDescendant);
         }
@@ -608,7 +608,7 @@
             nodes.advance();
         else {
             nodes.advanceSkippingChildren();
-            if (auto rootEditableElement = makeRefPtr(node->rootEditableElement())) {
+            if (RefPtr rootEditableElement = node->rootEditableElement()) {
                 removeNode(node.get());
                 appendNode(node.get(), *rootEditableElement);
             }
@@ -622,7 +622,7 @@
         return;
 
     int startOffset = m_upstreamStart.deprecatedEditingOffset();
-    auto startNode = makeRefPtr(m_upstreamStart.deprecatedNode());
+    RefPtr startNode { m_upstreamStart.deprecatedNode() };
 
     makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss();
 
@@ -698,7 +698,7 @@
                 removeNode(*node);
                 node = nextNode.get();
             } else {
-                auto lastDescendant = makeRefPtr(node->lastDescendant());
+                RefPtr lastDescendant { node->lastDescendant() };
                 if (m_downstreamEnd.deprecatedNode() == lastDescendant && m_downstreamEnd.deprecatedEditingOffset() >= caretMaxOffset(*lastDescendant)) {
                     removeNode(*node);
                     node = nullptr;
@@ -728,7 +728,7 @@
                 } else if (!(startNodeWasDescendantOfEndNode && !m_upstreamStart.anchorNode()->isConnected())) {
                     unsigned offset = 0;
                     if (m_upstreamStart.deprecatedNode()->isDescendantOf(m_downstreamEnd.deprecatedNode())) {
-                        auto n = makeRefPtr(m_upstreamStart.deprecatedNode());
+                        RefPtr n { m_upstreamStart.deprecatedNode() };
                         while (n && n->parentNode() != m_downstreamEnd.deprecatedNode())
                             n = n->parentNode();
                         if (n)
@@ -788,7 +788,7 @@
     
     // m_downstreamEnd's block has been emptied out by deletion.  There is no content inside of it to
     // move, so just remove it.
-    auto endBlock = makeRefPtr(enclosingBlock(m_downstreamEnd.deprecatedNode()));
+    RefPtr endBlock { enclosingBlock(m_downstreamEnd.deprecatedNode()) };
     if (!endBlock)
         return;
 
@@ -815,7 +815,7 @@
     // FIXME: Consider RTL.
     if (!m_startsAtEmptyLine && isStartOfParagraph(mergeDestination) && startOfParagraphToMove.absoluteCaretBounds().x() > mergeDestination.absoluteCaretBounds().x()) {
         if (mergeDestination.deepEquivalent().downstream().deprecatedNode()->hasTagName(brTag)) {
-            auto nodeToRemove = makeRefPtr(mergeDestination.deepEquivalent().downstream().deprecatedNode());
+            RefPtr nodeToRemove { mergeDestination.deepEquivalent().downstream().deprecatedNode() };
             removeNodeAndPruneAncestors(*nodeToRemove);
             m_endingPosition = startOfParagraphToMove.deepEquivalent();
             return;
@@ -857,9 +857,9 @@
     // DeleteSelectionCommand::removeNode does not remove rows but only empties them in preparation for this function.
     // Instead, DeleteSelectionCommand::removeNodeUpdatingStates is used below, which calls a raw CompositeEditCommand::removeNode and adjusts selection.
     if (m_endTableRow && m_endTableRow->isConnected() && m_endTableRow != m_startTableRow) {
-        auto row = makeRefPtr(m_endTableRow->previousSibling());
+        RefPtr row { m_endTableRow->previousSibling() };
         while (row && row != m_startTableRow) {
-            auto previousRow = makeRefPtr(row->previousSibling());
+            RefPtr previousRow { row->previousSibling() };
             if (isTableRowEmpty(row.get()))
                 removeNodeUpdatingStates(*row, DoNotAssumeContentIsAlwaysEditable);
             row = WTFMove(previousRow);
@@ -868,9 +868,9 @@
     
     // Remove empty rows after the start row.
     if (m_startTableRow && m_startTableRow->isConnected() && m_startTableRow != m_endTableRow) {
-        auto row = makeRefPtr(m_startTableRow->nextSibling());
+        RefPtr row { m_startTableRow->nextSibling() };
         while (row && row != m_endTableRow) {
-            auto nextRow = makeRefPtr(row->nextSibling());
+            RefPtr nextRow { row->nextSibling() };
             if (isTableRowEmpty(row.get()))
                 removeNodeUpdatingStates(*row, DoNotAssumeContentIsAlwaysEditable);
             row = WTFMove(nextRow);
@@ -953,10 +953,10 @@
 // This method removes div elements with no attributes that have only one child or no children at all.
 void DeleteSelectionCommand::removeRedundantBlocks()
 {
-    auto node = makeRefPtr(m_endingPosition.containerNode());
+    RefPtr node { m_endingPosition.containerNode() };
     if (!node)
         return;
-    auto rootNode = makeRefPtr(node->rootEditableElement());
+    RefPtr rootNode { node->rootEditableElement() };
    
     while (node && node != rootNode) {
         if (isRemovableBlock(node.get())) {
@@ -984,7 +984,7 @@
 
     // If the deletion is occurring in a text field, and we're not deleting to replace the selection, then let the frame call across the bridge to notify the form delegate. 
     if (!m_replace) {
-        if (auto textControl = makeRefPtr(enclosingTextFormControl(m_selectionToDelete.start())); textControl && textControl->focused())
+        if (RefPtr textControl = enclosingTextFormControl(m_selectionToDelete.start()); textControl && textControl->focused())
             document().editor().textWillBeDeletedInTextField(textControl.get());
     }
 
@@ -999,7 +999,7 @@
         // Don't need a placeholder when deleting a selection that starts just before a table
         // and ends inside it (we do need placeholders to hold open empty cells, but that's
         // handled elsewhere).
-        if (auto table = makeRefPtr(isLastPositionBeforeTable(m_selectionToDelete.visibleStart()))) {
+        if (RefPtr table = isLastPositionBeforeTable(m_selectionToDelete.visibleStart())) {
             if (m_selectionToDelete.end().deprecatedNode()->isDescendantOf(*table))
                 m_needPlaceholder = false;
         }
@@ -1048,7 +1048,7 @@
 
     bool shouldRebalaceWhiteSpace = true;
     if (!document().editor().behavior().shouldRebalanceWhiteSpacesInSecureField()) {
-        if (auto endNode = makeRefPtr(m_endingPosition.deprecatedNode()); is<Text>(endNode)) {
+        if (RefPtr endNode = m_endingPosition.deprecatedNode(); is<Text>(endNode)) {
             auto& textNode = downcast<Text>(*endNode);
             ScriptDisallowedScope scriptDisallowedScope;
             if (textNode.length() && textNode.renderer())