Skip to content
  • kling@webkit.org's avatar
    Pass Attribute by const reference as much as possible. · 260fca8b
    kling@webkit.org authored
    <http://webkit.org/b/86487>
    
    Reviewed by Darin Adler.
    
    Switch to passing around "const Attribute&" instead of "Attribute*" wherever possible.
    This helps enforce the constness and non-nullity of these arguments at compile time.
    
    Also renamed 'attr' to 'attribute' in the touched code. Attr and Attribute are two
    different classes, so having "Attribute attr" just looks wrong.
    
    * bindings/js/ScriptEventListener.cpp:
    (WebCore::createAttributeEventListener):
    * bindings/js/ScriptEventListener.h:
    * bindings/v8/ScriptEventListener.cpp:
    (WebCore::createAttributeEventListener):
    * bindings/v8/ScriptEventListener.h:
    * dom/Attr.cpp:
    (WebCore::Attr::setPrefix):
    (WebCore::Attr::setValue):
    (WebCore::Attr::childrenChanged):
    (WebCore::Attr::style):
    (WebCore::Attr::elementAttribute):
    * dom/Attr.h:
    * dom/Element.cpp:
    (WebCore::Element::setAttributeInternal):
    (WebCore::Element::attributeChanged):
    (WebCore::Element::parserSetAttributes):
    (WebCore::Element::didAddAttribute):
    (WebCore::Element::didModifyAttribute):
    (WebCore::Element::didRemoveAttribute):
    * dom/Element.h:
    * dom/ElementAttributeData.cpp:
    (WebCore::ElementAttributeData::addAttribute):
    (WebCore::ElementAttributeData::setAttributes):
    (WebCore::ElementAttributeData::replaceAttribute):
    * dom/StyledElement.cpp:
    (WebCore::StyledElement::attributeChanged):
    (WebCore::StyledElement::parseAttribute):
    (WebCore::StyledElement::updateAttributeStyle):
    * dom/StyledElement.h:
    (WebCore::StyledElement::collectStyleForAttribute):
    * html/HTMLAnchorElement.cpp:
    (WebCore::HTMLAnchorElement::parseAttribute):
    * html/HTMLAnchorElement.h:
    * html/HTMLAppletElement.cpp:
    (WebCore::HTMLAppletElement::parseAttribute):
    * html/HTMLAppletElement.h:
    * html/HTMLAreaElement.cpp:
    (WebCore::HTMLAreaElement::parseAttribute):
    * html/HTMLAreaElement.h:
    * html/HTMLBRElement.cpp:
    (WebCore::HTMLBRElement::collectStyleForAttribute):
    * html/HTMLBRElement.h:
    * html/HTMLBaseElement.cpp:
    (WebCore::HTMLBaseElement::parseAttribute):
    * html/HTMLBaseElement.h:
    * html/HTMLBodyElement.cpp:
    (WebCore::HTMLBodyElement::collectStyleForAttribute):
    (WebCore::HTMLBodyElement::parseAttribute):
    * html/HTMLBodyElement.h:
    * html/HTMLButtonElement.cpp:
    (WebCore::HTMLButtonElement::parseAttribute):
    * html/HTMLButtonElement.h:
    * html/HTMLCanvasElement.cpp:
    (WebCore::HTMLCanvasElement::parseAttribute):
    * html/HTMLCanvasElement.h:
    * html/HTMLDetailsElement.cpp:
    (WebCore::HTMLDetailsElement::parseAttribute):
    * html/HTMLDetailsElement.h:
    * html/HTMLDivElement.cpp:
    (WebCore::HTMLDivElement::collectStyleForAttribute):
    * html/HTMLDivElement.h:
    * html/HTMLElement.cpp:
    (WebCore::parseBorderWidthAttribute):
    (WebCore::HTMLElement::applyBorderAttributeToStyle):
    (WebCore::HTMLElement::mapLanguageAttributeToLocale):
    (WebCore::HTMLElement::collectStyleForAttribute):
    (WebCore::HTMLElement::parseAttribute):
    (WebCore::HTMLElement::applyAlignmentAttributeToStyle):
    (WebCore::HTMLElement::dirAttributeChanged):
    * html/HTMLElement.h:
    * html/HTMLEmbedElement.cpp:
    (WebCore::HTMLEmbedElement::collectStyleForAttribute):
    (WebCore::HTMLEmbedElement::parseAttribute):
    * html/HTMLEmbedElement.h:
    * html/HTMLFontElement.cpp:
    (WebCore::HTMLFontElement::collectStyleForAttribute):
    * html/HTMLFontElement.h:
    * html/HTMLFormControlElement.cpp:
    (WebCore::HTMLFormControlElement::parseAttribute):
    * html/HTMLFormControlElement.h:
    * html/HTMLFormElement.cpp:
    (WebCore::HTMLFormElement::parseAttribute):
    * html/HTMLFormElement.h:
    * html/HTMLFrameElement.cpp:
    (WebCore::HTMLFrameElement::parseAttribute):
    * html/HTMLFrameElement.h:
    * html/HTMLFrameElementBase.cpp:
    (WebCore::HTMLFrameElementBase::parseAttribute):
    * html/HTMLFrameElementBase.h:
    (HTMLFrameElementBase):
    * html/HTMLFrameSetElement.cpp:
    (WebCore::HTMLFrameSetElement::collectStyleForAttribute):
    (WebCore::HTMLFrameSetElement::parseAttribute):
    * html/HTMLFrameSetElement.h:
    * html/HTMLHRElement.cpp:
    (WebCore::HTMLHRElement::collectStyleForAttribute):
    * html/HTMLHRElement.h:
    * html/HTMLIFrameElement.cpp:
    (WebCore::HTMLIFrameElement::collectStyleForAttribute):
    (WebCore::HTMLIFrameElement::parseAttribute):
    * html/HTMLIFrameElement.h:
    * html/HTMLImageElement.cpp:
    (WebCore::HTMLImageElement::collectStyleForAttribute):
    (WebCore::HTMLImageElement::parseAttribute):
    * html/HTMLImageElement.h:
    * html/HTMLInputElement.cpp:
    (WebCore::HTMLInputElement::updateType):
    (WebCore::HTMLInputElement::collectStyleForAttribute):
    (WebCore::HTMLInputElement::parseAttribute):
    (WebCore::HTMLInputElement::parseMaxLengthAttribute):
    * html/HTMLInputElement.h:
    * html/HTMLKeygenElement.cpp:
    (WebCore::HTMLKeygenElement::parseAttribute):
    * html/HTMLKeygenElement.h:
    * html/HTMLLIElement.cpp:
    (WebCore::HTMLLIElement::collectStyleForAttribute):
    (WebCore::HTMLLIElement::parseAttribute):
    * html/HTMLLIElement.h:
    * html/HTMLLinkElement.cpp:
    (WebCore::HTMLLinkElement::parseAttribute):
    * html/HTMLLinkElement.h:
    * html/HTMLMapElement.cpp:
    (WebCore::HTMLMapElement::parseAttribute):
    * html/HTMLMapElement.h:
    * html/HTMLMarqueeElement.cpp:
    (WebCore::HTMLMarqueeElement::collectStyleForAttribute):
    * html/HTMLMarqueeElement.h:
    * html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::parseAttribute):
    * html/HTMLMediaElement.h:
    * html/HTMLMetaElement.cpp:
    (WebCore::HTMLMetaElement::parseAttribute):
    * html/HTMLMetaElement.h:
    * html/HTMLMeterElement.cpp:
    (WebCore::HTMLMeterElement::parseAttribute):
    * html/HTMLMeterElement.h:
    * html/HTMLOListElement.cpp:
    (WebCore::HTMLOListElement::collectStyleForAttribute):
    (WebCore::HTMLOListElement::parseAttribute):
    * html/HTMLOListElement.h:
    * html/HTMLObjectElement.cpp:
    (WebCore::HTMLObjectElement::collectStyleForAttribute):
    (WebCore::HTMLObjectElement::parseAttribute):
    * html/HTMLObjectElement.h:
    * html/HTMLOptGroupElement.cpp:
    (WebCore::HTMLOptGroupElement::parseAttribute):
    * html/HTMLOptGroupElement.h:
    * html/HTMLOptionElement.cpp:
    (WebCore::HTMLOptionElement::parseAttribute):
    * html/HTMLOptionElement.h:
    * html/HTMLOutputElement.cpp:
    (WebCore::HTMLOutputElement::parseAttribute):
    * html/HTMLOutputElement.h:
    * html/HTMLParagraphElement.cpp:
    (WebCore::HTMLParagraphElement::collectStyleForAttribute):
    * html/HTMLParagraphElement.h:
    * html/HTMLPlugInElement.cpp:
    (WebCore::HTMLPlugInElement::collectStyleForAttribute):
    * html/HTMLPlugInElement.h:
    * html/HTMLPreElement.cpp:
    (WebCore::HTMLPreElement::collectStyleForAttribute):
    * html/HTMLPreElement.h:
    * html/HTMLProgressElement.cpp:
    (WebCore::HTMLProgressElement::parseAttribute):
    * html/HTMLProgressElement.h:
    * html/HTMLScriptElement.cpp:
    (WebCore::HTMLScriptElement::parseAttribute):
    * html/HTMLScriptElement.h:
    * html/HTMLSelectElement.cpp:
    (WebCore::HTMLSelectElement::parseAttribute):
    (WebCore::HTMLSelectElement::parseMultipleAttribute):
    * html/HTMLSelectElement.h:
    * html/HTMLStyleElement.cpp:
    (WebCore::HTMLStyleElement::parseAttribute):
    * html/HTMLStyleElement.h:
    * html/HTMLTableCaptionElement.cpp:
    (WebCore::HTMLTableCaptionElement::collectStyleForAttribute):
    * html/HTMLTableCaptionElement.h:
    * html/HTMLTableCellElement.cpp:
    (WebCore::HTMLTableCellElement::collectStyleForAttribute):
    (WebCore::HTMLTableCellElement::parseAttribute):
    * html/HTMLTableCellElement.h:
    * html/HTMLTableColElement.cpp:
    (WebCore::HTMLTableColElement::collectStyleForAttribute):
    (WebCore::HTMLTableColElement::parseAttribute):
    * html/HTMLTableColElement.h:
    * html/HTMLTableElement.cpp:
    (WebCore::HTMLTableElement::collectStyleForAttribute):
    (WebCore::HTMLTableElement::parseAttribute):
    * html/HTMLTableElement.h:
    * html/HTMLTablePartElement.cpp:
    (WebCore::HTMLTablePartElement::collectStyleForAttribute):
    * html/HTMLTablePartElement.h:
    * html/HTMLTextAreaElement.cpp:
    (WebCore::HTMLTextAreaElement::collectStyleForAttribute):
    (WebCore::HTMLTextAreaElement::parseAttribute):
    * html/HTMLTextAreaElement.h:
    * html/HTMLTextFormControlElement.cpp:
    (WebCore::HTMLTextFormControlElement::parseAttribute):
    * html/HTMLTextFormControlElement.h:
    * html/HTMLTrackElement.cpp:
    (WebCore::HTMLTrackElement::parseAttribute):
    * html/HTMLTrackElement.h:
    * html/HTMLUListElement.cpp:
    (WebCore::HTMLUListElement::collectStyleForAttribute):
    * html/HTMLUListElement.h:
    * html/HTMLVideoElement.cpp:
    (WebCore::HTMLVideoElement::collectStyleForAttribute):
    (WebCore::HTMLVideoElement::parseAttribute):
    * html/HTMLVideoElement.h:
    * html/shadow/HTMLContentElement.cpp:
    (WebCore::HTMLContentElement::parseAttribute):
    * html/shadow/HTMLContentElement.h:
    * mathml/MathMLElement.cpp:
    (WebCore::MathMLElement::collectStyleForAttribute):
    * mathml/MathMLElement.h:
    * svg/SVGAElement.cpp:
    (WebCore::SVGAElement::parseAttribute):
    * svg/SVGAElement.h:
    * svg/SVGAnimateMotionElement.cpp:
    (WebCore::SVGAnimateMotionElement::parseAttribute):
    * svg/SVGAnimateMotionElement.h:
    * svg/SVGAnimateTransformElement.cpp:
    (WebCore::SVGAnimateTransformElement::parseAttribute):
    * svg/SVGAnimateTransformElement.h:
    * svg/SVGAnimationElement.cpp:
    (WebCore::SVGAnimationElement::parseAttribute):
    * svg/SVGAnimationElement.h:
    * svg/SVGCircleElement.cpp:
    (WebCore::SVGCircleElement::parseAttribute):
    * svg/SVGCircleElement.h:
    * svg/SVGClipPathElement.cpp:
    (WebCore::SVGClipPathElement::parseAttribute):
    * svg/SVGClipPathElement.h:
    * svg/SVGComponentTransferFunctionElement.cpp:
    (WebCore::SVGComponentTransferFunctionElement::parseAttribute):
    * svg/SVGComponentTransferFunctionElement.h:
    * svg/SVGCursorElement.cpp:
    (WebCore::SVGCursorElement::parseAttribute):
    * svg/SVGCursorElement.h:
    * svg/SVGElement.cpp:
    (WebCore::SVGElement::reportAttributeParsingError):
    (WebCore::SVGElement::parseAttribute):
    (WebCore::SVGElement::attributeChanged):
    * svg/SVGElement.h:
    * svg/SVGEllipseElement.cpp:
    (WebCore::SVGEllipseElement::parseAttribute):
    * svg/SVGEllipseElement.h:
    * svg/SVGExternalResourcesRequired.cpp:
    (WebCore::SVGExternalResourcesRequired::parseAttribute):
    * svg/SVGExternalResourcesRequired.h:
    (SVGExternalResourcesRequired):
    * svg/SVGFEBlendElement.cpp:
    (WebCore::SVGFEBlendElement::parseAttribute):
    * svg/SVGFEBlendElement.h:
    * svg/SVGFEColorMatrixElement.cpp:
    (WebCore::SVGFEColorMatrixElement::parseAttribute):
    * svg/SVGFEColorMatrixElement.h:
    * svg/SVGFEComponentTransferElement.cpp:
    (WebCore::SVGFEComponentTransferElement::parseAttribute):
    * svg/SVGFEComponentTransferElement.h:
    * svg/SVGFECompositeElement.cpp:
    (WebCore::SVGFECompositeElement::parseAttribute):
    * svg/SVGFECompositeElement.h:
    * svg/SVGFEConvolveMatrixElement.cpp:
    (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
    * svg/SVGFEConvolveMatrixElement.h:
    * svg/SVGFEDiffuseLightingElement.cpp:
    (WebCore::SVGFEDiffuseLightingElement::parseAttribute):
    * svg/SVGFEDiffuseLightingElement.h:
    * svg/SVGFEDisplacementMapElement.cpp:
    (WebCore::SVGFEDisplacementMapElement::parseAttribute):
    * svg/SVGFEDisplacementMapElement.h:
    * svg/SVGFEDropShadowElement.cpp:
    (WebCore::SVGFEDropShadowElement::parseAttribute):
    * svg/SVGFEDropShadowElement.h:
    * svg/SVGFEGaussianBlurElement.cpp:
    (WebCore::SVGFEGaussianBlurElement::parseAttribute):
    * svg/SVGFEGaussianBlurElement.h:
    * svg/SVGFEImageElement.cpp:
    (WebCore::SVGFEImageElement::parseAttribute):
    * svg/SVGFEImageElement.h:
    * svg/SVGFELightElement.cpp:
    (WebCore::SVGFELightElement::parseAttribute):
    * svg/SVGFELightElement.h:
    * svg/SVGFEMergeNodeElement.cpp:
    (WebCore::SVGFEMergeNodeElement::parseAttribute):
    * svg/SVGFEMergeNodeElement.h:
    * svg/SVGFEMorphologyElement.cpp:
    (WebCore::SVGFEMorphologyElement::parseAttribute):
    * svg/SVGFEMorphologyElement.h:
    * svg/SVGFEOffsetElement.cpp:
    (WebCore::SVGFEOffsetElement::parseAttribute):
    * svg/SVGFEOffsetElement.h:
    * svg/SVGFESpecularLightingElement.cpp:
    (WebCore::SVGFESpecularLightingElement::parseAttribute):
    * svg/SVGFESpecularLightingElement.h:
    * svg/SVGFETileElement.cpp:
    (WebCore::SVGFETileElement::parseAttribute):
    * svg/SVGFETileElement.h:
    * svg/SVGFETurbulenceElement.cpp:
    (WebCore::SVGFETurbulenceElement::parseAttribute):
    * svg/SVGFETurbulenceElement.h:
    * svg/SVGFilterElement.cpp:
    (WebCore::SVGFilterElement::parseAttribute):
    * svg/SVGFilterElement.h:
    * svg/SVGFilterPrimitiveStandardAttributes.cpp:
    (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
    * svg/SVGFilterPrimitiveStandardAttributes.h:
    (SVGFilterPrimitiveStandardAttributes):
    * svg/SVGFitToViewBox.cpp:
    (WebCore::SVGFitToViewBox::parseAttribute):
    * svg/SVGFitToViewBox.h:
    (SVGFitToViewBox):
    * svg/SVGFontFaceElement.cpp:
    (WebCore::SVGFontFaceElement::parseAttribute):
    * svg/SVGFontFaceElement.h:
    * svg/SVGFontFaceUriElement.cpp:
    (WebCore::SVGFontFaceUriElement::parseAttribute):
    * svg/SVGFontFaceUriElement.h:
    * svg/SVGForeignObjectElement.cpp:
    (WebCore::SVGForeignObjectElement::parseAttribute):
    * svg/SVGForeignObjectElement.h:
    * svg/SVGGElement.cpp:
    (WebCore::SVGGElement::parseAttribute):
    * svg/SVGGElement.h:
    * svg/SVGGlyphElement.cpp:
    (WebCore::SVGGlyphElement::parseAttribute):
    * svg/SVGGlyphElement.h:
    * svg/SVGGlyphRefElement.cpp:
    (WebCore::SVGGlyphRefElement::parseAttribute):
    * svg/SVGGlyphRefElement.h:
    * svg/SVGGradientElement.cpp:
    (WebCore::SVGGradientElement::parseAttribute):
    * svg/SVGGradientElement.h:
    * svg/SVGImageElement.cpp:
    (WebCore::SVGImageElement::collectStyleForAttribute):
    (WebCore::SVGImageElement::parseAttribute):
    * svg/SVGImageElement.h:
    * svg/SVGImageLoader.cpp:
    (WebCore::SVGImageLoader::sourceURI):
    * svg/SVGLangSpace.cpp:
    (WebCore::SVGLangSpace::parseAttribute):
    * svg/SVGLangSpace.h:
    (SVGLangSpace):
    * svg/SVGLineElement.cpp:
    (WebCore::SVGLineElement::parseAttribute):
    * svg/SVGLineElement.h:
    * svg/SVGLinearGradientElement.cpp:
    (WebCore::SVGLinearGradientElement::parseAttribute):
    * svg/SVGLinearGradientElement.h:
    * svg/SVGMPathElement.cpp:
    (WebCore::SVGMPathElement::parseAttribute):
    * svg/SVGMPathElement.h:
    * svg/SVGMarkerElement.cpp:
    (WebCore::SVGMarkerElement::parseAttribute):
    * svg/SVGMarkerElement.h:
    * svg/SVGMaskElement.cpp:
    (WebCore::SVGMaskElement::parseAttribute):
    * svg/SVGMaskElement.h:
    * svg/SVGPathElement.cpp:
    (WebCore::SVGPathElement::parseAttribute):
    * svg/SVGPathElement.h:
    * svg/SVGPatternElement.cpp:
    (WebCore::SVGPatternElement::parseAttribute):
    * svg/SVGPatternElement.h:
    * svg/SVGPolyElement.cpp:
    (WebCore::SVGPolyElement::parseAttribute):
    * svg/SVGPolyElement.h:
    * svg/SVGRadialGradientElement.cpp:
    (WebCore::SVGRadialGradientElement::parseAttribute):
    * svg/SVGRadialGradientElement.h:
    * svg/SVGRectElement.cpp:
    (WebCore::SVGRectElement::parseAttribute):
    * svg/SVGRectElement.h:
    * svg/SVGSVGElement.cpp:
    (WebCore::SVGSVGElement::parseAttribute):
    * svg/SVGSVGElement.h:
    * svg/SVGScriptElement.cpp:
    (WebCore::SVGScriptElement::parseAttribute):
    * svg/SVGScriptElement.h:
    * svg/SVGStopElement.cpp:
    (WebCore::SVGStopElement::parseAttribute):
    * svg/SVGStopElement.h:
    * svg/SVGStyleElement.cpp:
    (WebCore::SVGStyleElement::parseAttribute):
    * svg/SVGStyleElement.h:
    * svg/SVGStyledElement.cpp:
    (WebCore::SVGStyledElement::collectStyleForAttribute):
    (WebCore::SVGStyledElement::parseAttribute):
    * svg/SVGStyledElement.h:
    * svg/SVGStyledTransformableElement.cpp:
    (WebCore::SVGStyledTransformableElement::parseAttribute):
    * svg/SVGStyledTransformableElement.h:
    * svg/SVGSymbolElement.cpp:
    (WebCore::SVGSymbolElement::parseAttribute):
    * svg/SVGSymbolElement.h:
    * svg/SVGTRefElement.cpp:
    (WebCore::SVGTRefElement::parseAttribute):
    * svg/SVGTRefElement.h:
    * svg/SVGTests.cpp:
    (WebCore::SVGTests::parseAttribute):
    * svg/SVGTests.h:
    (SVGTests):
    * svg/SVGTextContentElement.cpp:
    (WebCore::SVGTextContentElement::collectStyleForAttribute):
    (WebCore::SVGTextContentElement::parseAttribute):
    * svg/SVGTextContentElement.h:
    * svg/SVGTextElement.cpp:
    (WebCore::SVGTextElement::parseAttribute):
    * svg/SVGTextElement.h:
    * svg/SVGTextPathElement.cpp:
    (WebCore::SVGTextPathElement::parseAttribute):
    * svg/SVGTextPathElement.h:
    * svg/SVGTextPositioningElement.cpp:
    (WebCore::SVGTextPositioningElement::parseAttribute):
    * svg/SVGTextPositioningElement.h:
    * svg/SVGURIReference.cpp:
    (WebCore::SVGURIReference::parseAttribute):
    * svg/SVGURIReference.h:
    (SVGURIReference):
    * svg/SVGUseElement.cpp:
    (WebCore::SVGUseElement::parseAttribute):
    * svg/SVGUseElement.h:
    * svg/SVGViewElement.cpp:
    (WebCore::SVGViewElement::parseAttribute):
    * svg/SVGViewElement.h:
    * svg/SVGZoomAndPan.cpp:
    (WebCore::SVGZoomAndPan::parseAttribute):
    * svg/SVGZoomAndPan.h:
    (SVGZoomAndPan):
    * svg/animation/SVGSMILElement.cpp:
    (WebCore::SVGSMILElement::parseAttribute):
    * svg/animation/SVGSMILElement.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    260fca8b