Pass Attribute by const reference as much as possible.
<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
diff --git a/Source/WebCore/html/HTMLTableElement.cpp b/Source/WebCore/html/HTMLTableElement.cpp
index 98f76bd..a6fa17d 100644
--- a/Source/WebCore/html/HTMLTableElement.cpp
+++ b/Source/WebCore/html/HTMLTableElement.cpp
@@ -304,54 +304,54 @@
return true;
}
-void HTMLTableElement::collectStyleForAttribute(Attribute* attr, StylePropertySet* style)
+void HTMLTableElement::collectStyleForAttribute(const Attribute& attribute, StylePropertySet* style)
{
- if (attr->name() == widthAttr)
- addHTMLLengthToStyle(style, CSSPropertyWidth, attr->value());
- else if (attr->name() == heightAttr)
- addHTMLLengthToStyle(style, CSSPropertyHeight, attr->value());
- else if (attr->name() == borderAttr) {
- int borderWidth = attr->isEmpty() ? 1 : attr->value().toInt();
+ if (attribute.name() == widthAttr)
+ addHTMLLengthToStyle(style, CSSPropertyWidth, attribute.value());
+ else if (attribute.name() == heightAttr)
+ addHTMLLengthToStyle(style, CSSPropertyHeight, attribute.value());
+ else if (attribute.name() == borderAttr) {
+ int borderWidth = attribute.isEmpty() ? 1 : attribute.value().toInt();
addPropertyToAttributeStyle(style, CSSPropertyBorderWidth, borderWidth, CSSPrimitiveValue::CSS_PX);
- } else if (attr->name() == bordercolorAttr) {
- if (!attr->isEmpty())
- addHTMLColorToStyle(style, CSSPropertyBorderColor, attr->value());
- } else if (attr->name() == bgcolorAttr)
- addHTMLColorToStyle(style, CSSPropertyBackgroundColor, attr->value());
- else if (attr->name() == backgroundAttr) {
- String url = stripLeadingAndTrailingHTMLSpaces(attr->value());
+ } else if (attribute.name() == bordercolorAttr) {
+ if (!attribute.isEmpty())
+ addHTMLColorToStyle(style, CSSPropertyBorderColor, attribute.value());
+ } else if (attribute.name() == bgcolorAttr)
+ addHTMLColorToStyle(style, CSSPropertyBackgroundColor, attribute.value());
+ else if (attribute.name() == backgroundAttr) {
+ String url = stripLeadingAndTrailingHTMLSpaces(attribute.value());
if (!url.isEmpty())
style->setProperty(CSSProperty(CSSPropertyBackgroundImage, CSSImageValue::create(document()->completeURL(url).string())));
- } else if (attr->name() == valignAttr) {
- if (!attr->isEmpty())
- addPropertyToAttributeStyle(style, CSSPropertyVerticalAlign, attr->value());
- } else if (attr->name() == cellspacingAttr) {
- if (!attr->isEmpty())
- addHTMLLengthToStyle(style, CSSPropertyBorderSpacing, attr->value());
- } else if (attr->name() == vspaceAttr) {
- addHTMLLengthToStyle(style, CSSPropertyMarginTop, attr->value());
- addHTMLLengthToStyle(style, CSSPropertyMarginBottom, attr->value());
- } else if (attr->name() == hspaceAttr) {
- addHTMLLengthToStyle(style, CSSPropertyMarginLeft, attr->value());
- addHTMLLengthToStyle(style, CSSPropertyMarginRight, attr->value());
- } else if (attr->name() == alignAttr) {
- if (!attr->value().isEmpty()) {
- if (equalIgnoringCase(attr->value(), "center")) {
+ } else if (attribute.name() == valignAttr) {
+ if (!attribute.isEmpty())
+ addPropertyToAttributeStyle(style, CSSPropertyVerticalAlign, attribute.value());
+ } else if (attribute.name() == cellspacingAttr) {
+ if (!attribute.isEmpty())
+ addHTMLLengthToStyle(style, CSSPropertyBorderSpacing, attribute.value());
+ } else if (attribute.name() == vspaceAttr) {
+ addHTMLLengthToStyle(style, CSSPropertyMarginTop, attribute.value());
+ addHTMLLengthToStyle(style, CSSPropertyMarginBottom, attribute.value());
+ } else if (attribute.name() == hspaceAttr) {
+ addHTMLLengthToStyle(style, CSSPropertyMarginLeft, attribute.value());
+ addHTMLLengthToStyle(style, CSSPropertyMarginRight, attribute.value());
+ } else if (attribute.name() == alignAttr) {
+ if (!attribute.value().isEmpty()) {
+ if (equalIgnoringCase(attribute.value(), "center")) {
addPropertyToAttributeStyle(style, CSSPropertyWebkitMarginStart, CSSValueAuto);
addPropertyToAttributeStyle(style, CSSPropertyWebkitMarginEnd, CSSValueAuto);
} else
- addPropertyToAttributeStyle(style, CSSPropertyFloat, attr->value());
+ addPropertyToAttributeStyle(style, CSSPropertyFloat, attribute.value());
}
- } else if (attr->name() == rulesAttr) {
+ } else if (attribute.name() == rulesAttr) {
// The presence of a valid rules attribute causes border collapsing to be enabled.
if (m_rulesAttr != UnsetRules)
addPropertyToAttributeStyle(style, CSSPropertyBorderCollapse, CSSValueCollapse);
- } else if (attr->name() == frameAttr) {
+ } else if (attribute.name() == frameAttr) {
bool borderTop;
bool borderRight;
bool borderBottom;
bool borderLeft;
- if (getBordersFromFrameAttributeValue(attr->value(), borderTop, borderRight, borderBottom, borderLeft)) {
+ if (getBordersFromFrameAttributeValue(attribute.value(), borderTop, borderRight, borderBottom, borderLeft)) {
addPropertyToAttributeStyle(style, CSSPropertyBorderWidth, CSSValueThin);
addPropertyToAttributeStyle(style, CSSPropertyBorderTopStyle, borderTop ? CSSValueSolid : CSSValueHidden);
addPropertyToAttributeStyle(style, CSSPropertyBorderBottomStyle, borderBottom ? CSSValueSolid : CSSValueHidden);
@@ -359,7 +359,7 @@
addPropertyToAttributeStyle(style, CSSPropertyBorderRightStyle, borderRight ? CSSValueSolid : CSSValueHidden);
}
} else
- HTMLElement::collectStyleForAttribute(attr, style);
+ HTMLElement::collectStyleForAttribute(attribute, style);
}
bool HTMLTableElement::isPresentationAttribute(const QualifiedName& name) const
@@ -369,48 +369,48 @@
return HTMLElement::isPresentationAttribute(name);
}
-void HTMLTableElement::parseAttribute(Attribute* attr)
+void HTMLTableElement::parseAttribute(const Attribute& attribute)
{
CellBorders bordersBefore = cellBorders();
unsigned short oldPadding = m_padding;
- if (attr->name() == borderAttr) {
+ if (attribute.name() == borderAttr) {
// FIXME: This attribute is a mess.
m_borderAttr = true;
- if (!attr->isNull()) {
- int border = attr->isEmpty() ? 1 : attr->value().toInt();
+ if (!attribute.isNull()) {
+ int border = attribute.isEmpty() ? 1 : attribute.value().toInt();
m_borderAttr = border;
}
- } else if (attr->name() == bordercolorAttr) {
- m_borderColorAttr = !attr->isEmpty();
- } else if (attr->name() == frameAttr) {
+ } else if (attribute.name() == bordercolorAttr) {
+ m_borderColorAttr = !attribute.isEmpty();
+ } else if (attribute.name() == frameAttr) {
// FIXME: This attribute is a mess.
bool borderTop;
bool borderRight;
bool borderBottom;
bool borderLeft;
- m_frameAttr = getBordersFromFrameAttributeValue(attr->value(), borderTop, borderRight, borderBottom, borderLeft);
- } else if (attr->name() == rulesAttr) {
+ m_frameAttr = getBordersFromFrameAttributeValue(attribute.value(), borderTop, borderRight, borderBottom, borderLeft);
+ } else if (attribute.name() == rulesAttr) {
m_rulesAttr = UnsetRules;
- if (equalIgnoringCase(attr->value(), "none"))
+ if (equalIgnoringCase(attribute.value(), "none"))
m_rulesAttr = NoneRules;
- else if (equalIgnoringCase(attr->value(), "groups"))
+ else if (equalIgnoringCase(attribute.value(), "groups"))
m_rulesAttr = GroupsRules;
- else if (equalIgnoringCase(attr->value(), "rows"))
+ else if (equalIgnoringCase(attribute.value(), "rows"))
m_rulesAttr = RowsRules;
- if (equalIgnoringCase(attr->value(), "cols"))
+ if (equalIgnoringCase(attribute.value(), "cols"))
m_rulesAttr = ColsRules;
- if (equalIgnoringCase(attr->value(), "all"))
+ if (equalIgnoringCase(attribute.value(), "all"))
m_rulesAttr = AllRules;
- } else if (attr->name() == cellpaddingAttr) {
- if (!attr->value().isEmpty())
- m_padding = max(0, attr->value().toInt());
+ } else if (attribute.name() == cellpaddingAttr) {
+ if (!attribute.value().isEmpty())
+ m_padding = max(0, attribute.value().toInt());
else
m_padding = 1;
- } else if (attr->name() == colsAttr) {
+ } else if (attribute.name() == colsAttr) {
// ###
} else
- HTMLElement::parseAttribute(attr);
+ HTMLElement::parseAttribute(attribute);
if (bordersBefore != cellBorders() || oldPadding != m_padding) {
m_sharedCellStyle = 0;