Replace some auto* with RefPtr within WebCore/html
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Nov 2017 09:32:05 +0000 (09:32 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Nov 2017 09:32:05 +0000 (09:32 +0000)
commitef5029232a8b412de38e5e4a191bc850ad135b6c
tree3566179eff0df7ed25b5a944326fea37ccf560e5
parent338a35ea7902343101609d0ebfac06c4aafe799c
Replace some auto* with RefPtr within WebCore/html
https://bugs.webkit.org/show_bug.cgi?id=179218
<rdar://problem/35102567>

Reviewed by Ryosuke Niwa.

No changes in behaviors.

In this patch, it replace some auto* pointers with RefPtrs. The way it achieves this goal is to wrap
the RHS with makeRefPtr(). Also, some methods have been modified to return RefPtrs directly. Those
include:
    HTMLInputElement::list,
    HTMLInputElement::dataList,
    HTMLLabelElement::control,
    HTMLLegendElement::associatedControl,
    HTMLSummaryElement::detailsElement,
    HTMLTableElement::tHead,
    HTMLTableElement::tFoot,
    HTMLTablePartElement::findParentTable,
    HTMLTableRowElement.cpp::findTable, local function
    RadioNodeList.cpp::toRadioButtonInputElement, local function
    CanvasStyle::canvasGradient,
    CanvasStyle::canvasPattern,
    WebGLRenderingContextBase::validateTextureBinding,
    GraphicsContext::strokeGradient,
    GraphicsContext::fillGradient.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::labelChanged):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::correspondingControlForLabelElement const):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::addChildren):
(WebCore::AccessibilityTable::title const):
* accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
(webkitAccessibleTableGetCaption):
* html/ColorInputType.cpp:
(WebCore::ColorInputType::suggestions const):
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
* html/FileInputType.cpp:
(WebCore::FileInputType::appendFormData const):
(WebCore::FileInputType::disabledAttributeChanged):
(WebCore::FileInputType::multipleAttributeChanged):
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::formOwnerRemovedFromTree):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::insertedIntoAncestor):
(WebCore::HTMLBodyElement::didFinishInsertingNode):
(WebCore::HTMLBodyElement::scrollTo):
* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::isActiveSummary const):
(WebCore::HTMLDetailsElement::parseAttribute):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::namedItem):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::editabilityFromContentEditableAttr):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::didAttachRenderers):
* html/HTMLFrameOwnerElement.cpp:
(WebCore:: const):
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::namedItem):
* html/HTMLHtmlElement.cpp:
(WebCore::HTMLHtmlElement::insertedByParser):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::defaultEventHandler):
(WebCore::HTMLInputElement::list const):
(WebCore::HTMLInputElement::dataList const):
(WebCore::HTMLInputElement::setupDateTimeChooserParameters):
* html/HTMLInputElement.h:
* html/HTMLLabelElement.cpp:
(WebCore::firstElementWithIdIfLabelable):
(WebCore::HTMLLabelElement::control const):
(WebCore::HTMLLabelElement::form const):
(WebCore::HTMLLabelElement::setActive):
(WebCore::HTMLLabelElement::setHovered):
(WebCore::HTMLLabelElement::willRespondToMouseClickEvents):
(WebCore::HTMLLabelElement::focus):
(WebCore::HTMLLabelElement::accessKeyAction):
* html/HTMLLabelElement.h:
* html/HTMLLegendElement.cpp:
(WebCore::HTMLLegendElement::associatedControl):
(WebCore::HTMLLegendElement::focus):
(WebCore::HTMLLegendElement::accessKeyAction):
(WebCore::HTMLLegendElement::form const):
* html/HTMLLegendElement.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::setCSSStyleSheet):
(WebCore::HTMLLinkElement::addSubresourceAttributeURLs const):
* html/HTMLMediaElement.cpp:
(WebCore::needsAutoplayPlayPauseEventsQuirk):
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::updateActiveTextTrackCues):
(WebCore::HTMLMediaElement::removeTextTrack):
(WebCore::HTMLMediaElement::layoutSizeChanged):
* html/HTMLObjectElement.cpp:
(WebCore::shouldBeExposed):
(WebCore::HTMLObjectElement::appendFormData):
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::recalcSelectOptions):
* html/HTMLPictureElement.cpp:
(WebCore::HTMLPictureElement::viewportChangeAffectedPicture const):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::bindingsInstance):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::isImageType):
(WebCore::HTMLPlugInImageElement::willDetachRenderers):
(WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay const):
(WebCore::HTMLPlugInImageElement::checkSizeChangeForSnapshotting):
* html/HTMLSlotElement.cpp:
(WebCore::HTMLSlotElement::attributeChanged):
(WebCore:: const):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::parseAttribute):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::addSubresourceAttributeURLs const):
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::detailsElement const):
* html/HTMLSummaryElement.h:
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::caption const):
(WebCore::HTMLTableElement::tHead const):
(WebCore::HTMLTableElement::tFoot const):
(WebCore::HTMLTableElement::createTHead):
(WebCore::HTMLTableElement::deleteTHead):
(WebCore::HTMLTableElement::createTFoot):
(WebCore::HTMLTableElement::deleteTFoot):
(WebCore::HTMLTableElement::createCaption):
(WebCore::HTMLTableElement::deleteCaption):
* html/HTMLTableElement.h:
* html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::findParentTable const):
* html/HTMLTablePartElement.h:
* html/HTMLTableRowElement.cpp:
(WebCore::findTable):
(WebCore::HTMLTableRowElement::rowIndex const):
(WebCore::findRows):
* html/HTMLTableSectionElement.cpp:
(WebCore::HTMLTableSectionElement::additionalPresentationAttributeStyle const):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::mediaElement const):
* html/LinkIconCollector.cpp:
(WebCore::LinkIconCollector::iconsOfTypes):
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
(WebCore::MediaDocument::replaceMediaElementTimerFired):
* html/MediaElementSession.cpp:
(WebCore::needsArbitraryUserGestureAutoplayQuirk):
(WebCore::isElementRectMostlyInMainFrame):
(WebCore::isElementLargeRelativeToMainFrame):
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure):
(WebCore::PluginDocumentParser::appendBytes):
* html/RadioNodeList.cpp:
(WebCore::toRadioButtonInputElement):
(WebCore::RadioNodeList::value const):
(WebCore::RadioNodeList::setValue):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::updateTickMarkValues):
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::wouldTaintOrigin):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setStrokeStyle):
(WebCore::CanvasRenderingContext2D::setFillStyle):
(WebCore::CanvasRenderingContext2D::fillInternal):
(WebCore::CanvasRenderingContext2D::strokeInternal):
(WebCore::CanvasRenderingContext2D::fillRect):
(WebCore::CanvasRenderingContext2D::strokeRect):
(WebCore::toStyle):
(WebCore::CanvasRenderingContext2D::drawTextInternal):
* html/canvas/CanvasStyle.h:
(WebCore::CanvasStyle::canvasGradient const):
(WebCore::CanvasStyle::canvasPattern const):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::texStorage2D):
(WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
(WebCore::WebGL2RenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLBuffer.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
(WebCore::WebGLRenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::compressedTexImage2D):
(WebCore::WebGLRenderingContextBase::compressedTexSubImage2D):
(WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
(WebCore::WebGLRenderingContextBase::generateMipmap):
(WebCore::WebGLRenderingContextBase::getTexParameter):
(WebCore::WebGLRenderingContextBase::texImage2DBase):
(WebCore::WebGLRenderingContextBase::validateTexFunc):
(WebCore::WebGLRenderingContextBase::texSubImage2D):
(WebCore::WebGLRenderingContextBase::texSubImage2DBase):
(WebCore::WebGLRenderingContextBase::copyTexImage2D):
(WebCore::WebGLRenderingContextBase::texImage2D):
(WebCore::WebGLRenderingContextBase::texParameter):
(WebCore::WebGLRenderingContextBase::validateTextureBinding):
* html/canvas/WebGLRenderingContextBase.h:
* html/parser/HTMLConstructionSite.cpp:
(WebCore::executeReparentTask):
(WebCore::executeTakeAllChildrenAndReparentTask):
(WebCore::HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded):
(WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
(WebCore::HTMLConstructionSite::findFosterSite):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
* html/parser/XSSAuditorDelegate.cpp:
(WebCore::XSSAuditorDelegate::generateViolationReport):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::updateGenericCue):
(WebCore::InbandGenericTextTrack::removeGenericCue):
* html/track/InbandTextTrack.cpp:
(WebCore::InbandTextTrack::willRemove):
* html/track/TextTrack.cpp:
(WebCore::TextTrack::addCue):
(WebCore::TextTrack::addRegion):
* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::willRemove):
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildInitialState):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::strokeGradient const):
(WebCore::GraphicsContext::fillGradient const):
* rendering/svg/RenderSVGPath.cpp:
(WebCore::useStrokeStyleToFill):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
68 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityTable.cpp
Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTable.cpp
Source/WebCore/html/ColorInputType.cpp
Source/WebCore/html/FTPDirectoryDocument.cpp
Source/WebCore/html/FileInputType.cpp
Source/WebCore/html/FormAssociatedElement.cpp
Source/WebCore/html/HTMLBodyElement.cpp
Source/WebCore/html/HTMLDetailsElement.cpp
Source/WebCore/html/HTMLDocument.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLFrameOwnerElement.cpp
Source/WebCore/html/HTMLFrameSetElement.cpp
Source/WebCore/html/HTMLHtmlElement.cpp
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/HTMLLabelElement.cpp
Source/WebCore/html/HTMLLabelElement.h
Source/WebCore/html/HTMLLegendElement.cpp
Source/WebCore/html/HTMLLegendElement.h
Source/WebCore/html/HTMLLinkElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLObjectElement.cpp
Source/WebCore/html/HTMLOptGroupElement.cpp
Source/WebCore/html/HTMLPictureElement.cpp
Source/WebCore/html/HTMLPlugInElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/HTMLSlotElement.cpp
Source/WebCore/html/HTMLSourceElement.cpp
Source/WebCore/html/HTMLStyleElement.cpp
Source/WebCore/html/HTMLSummaryElement.cpp
Source/WebCore/html/HTMLSummaryElement.h
Source/WebCore/html/HTMLTableElement.cpp
Source/WebCore/html/HTMLTableElement.h
Source/WebCore/html/HTMLTablePartElement.cpp
Source/WebCore/html/HTMLTablePartElement.h
Source/WebCore/html/HTMLTableRowElement.cpp
Source/WebCore/html/HTMLTableSectionElement.cpp
Source/WebCore/html/HTMLTrackElement.cpp
Source/WebCore/html/LinkIconCollector.cpp
Source/WebCore/html/MediaDocument.cpp
Source/WebCore/html/MediaElementSession.cpp
Source/WebCore/html/PluginDocument.cpp
Source/WebCore/html/RadioNodeList.cpp
Source/WebCore/html/RangeInputType.cpp
Source/WebCore/html/canvas/CanvasRenderingContext.cpp
Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
Source/WebCore/html/canvas/CanvasStyle.h
Source/WebCore/html/canvas/WebGL2RenderingContext.cpp
Source/WebCore/html/canvas/WebGLBuffer.h
Source/WebCore/html/canvas/WebGLRenderingContext.cpp
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/html/canvas/WebGLRenderingContextBase.h
Source/WebCore/html/parser/HTMLConstructionSite.cpp
Source/WebCore/html/parser/HTMLPreloadScanner.cpp
Source/WebCore/html/parser/XSSAuditorDelegate.cpp
Source/WebCore/html/shadow/TextControlInnerElements.cpp
Source/WebCore/html/track/InbandGenericTextTrack.cpp
Source/WebCore/html/track/InbandTextTrack.cpp
Source/WebCore/html/track/TextTrack.cpp
Source/WebCore/html/track/VideoTrack.cpp
Source/WebCore/inspector/InspectorCanvas.cpp
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/rendering/svg/RenderSVGPath.cpp