Element::parseAttribute() should take name & value as separate arguments.
<http://webkit.org/b/102608>
Reviewed by Antti Koivisto.
Update the signature of parseAttribute() to take a QualifiedName/AtomicString combo instead
of an Attribute. This lets us pass avoid refcount churn in Element::attributeChanged() since
creating a temporary Attribute is no longer necessary.
This was surprisingly hot (~1%) on the DOM/CreateNodes performance test.
* bindings/js/ScriptEventListener.cpp:
(WebCore::createAttributeEventListener):
* bindings/js/ScriptEventListener.h:
(WebCore):
* bindings/v8/ScriptEventListener.cpp:
(WebCore::createAttributeEventListener):
* bindings/v8/ScriptEventListener.h:
(WebCore):
* dom/Element.cpp:
(WebCore::Element::attributeChanged):
(WebCore::Element::parseAttribute):
* dom/Element.h:
(Element):
* dom/StyledElement.cpp:
(WebCore::StyledElement::parseAttribute):
* dom/StyledElement.h:
(StyledElement):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
* html/HTMLAnchorElement.h:
(HTMLAnchorElement):
* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::parseAttribute):
* html/HTMLAppletElement.h:
(HTMLAppletElement):
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::parseAttribute):
* html/HTMLAreaElement.h:
(HTMLAreaElement):
* html/HTMLBaseElement.cpp:
(WebCore::HTMLBaseElement::parseAttribute):
* html/HTMLBaseElement.h:
(HTMLBaseElement):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::parseAttribute):
* html/HTMLBodyElement.h:
(HTMLBodyElement):
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::parseAttribute):
* html/HTMLButtonElement.h:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::parseAttribute):
* html/HTMLCanvasElement.h:
(HTMLCanvasElement):
* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::parseAttribute):
* html/HTMLDetailsElement.h:
(HTMLDetailsElement):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::parseAttribute):
(WebCore::HTMLElement::dirAttributeChanged):
* html/HTMLElement.h:
(HTMLElement):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::parseAttribute):
* html/HTMLEmbedElement.h:
(HTMLEmbedElement):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::parseAttribute):
* html/HTMLFormControlElement.h:
(HTMLFormControlElement):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::parseAttribute):
* html/HTMLFormElement.h:
(HTMLFormElement):
* html/HTMLFrameElement.cpp:
(WebCore::HTMLFrameElement::parseAttribute):
* html/HTMLFrameElement.h:
(HTMLFrameElement):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::parseAttribute):
* html/HTMLFrameElementBase.h:
(HTMLFrameElementBase):
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::parseAttribute):
* html/HTMLFrameSetElement.h:
(HTMLFrameSetElement):
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::parseAttribute):
* html/HTMLIFrameElement.h:
(HTMLIFrameElement):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
* html/HTMLImageElement.h:
(HTMLImageElement):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseAttribute):
(WebCore::HTMLInputElement::parseMaxLengthAttribute):
* html/HTMLInputElement.h:
(HTMLInputElement):
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::parseAttribute):
* html/HTMLKeygenElement.h:
(HTMLKeygenElement):
* html/HTMLLIElement.cpp:
(WebCore::HTMLLIElement::parseAttribute):
* html/HTMLLIElement.h:
(HTMLLIElement):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::parseAttribute):
* html/HTMLLinkElement.h:
(HTMLLinkElement):
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::parseAttribute):
* html/HTMLMapElement.h:
(HTMLMapElement):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* html/HTMLMediaElement.h:
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::parseAttribute):
* html/HTMLMetaElement.h:
(HTMLMetaElement):
* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::parseAttribute):
* html/HTMLMeterElement.h:
(HTMLMeterElement):
* html/HTMLOListElement.cpp:
(WebCore::HTMLOListElement::parseAttribute):
* html/HTMLOListElement.h:
(HTMLOListElement):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parseAttribute):
* html/HTMLObjectElement.h:
(HTMLObjectElement):
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::parseAttribute):
* html/HTMLOptGroupElement.h:
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::parseAttribute):
* html/HTMLOptionElement.h:
(HTMLOptionElement):
* html/HTMLOutputElement.cpp:
(WebCore::HTMLOutputElement::parseAttribute):
* html/HTMLOutputElement.h:
(HTMLOutputElement):
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::parseAttribute):
* html/HTMLProgressElement.h:
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::parseAttribute):
* html/HTMLScriptElement.h:
(HTMLScriptElement):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::parseAttribute):
(WebCore::HTMLSelectElement::parseMultipleAttribute):
* html/HTMLSelectElement.h:
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute):
* html/HTMLStyleElement.h:
(HTMLStyleElement):
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::parseAttribute):
* html/HTMLTableCellElement.h:
(HTMLTableCellElement):
* html/HTMLTableColElement.cpp:
(WebCore::HTMLTableColElement::parseAttribute):
* html/HTMLTableColElement.h:
(HTMLTableColElement):
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::parseAttribute):
* html/HTMLTableElement.h:
(HTMLTableElement):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::parseAttribute):
* html/HTMLTextAreaElement.h:
(HTMLTextAreaElement):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::parseAttribute):
* html/HTMLTextFormControlElement.h:
(HTMLTextFormControlElement):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::parseAttribute):
* html/HTMLTrackElement.h:
(HTMLTrackElement):
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::parseAttribute):
* html/HTMLVideoElement.h:
(HTMLVideoElement):
* html/shadow/HTMLContentElement.cpp:
(WebCore::HTMLContentElement::parseAttribute):
* html/shadow/HTMLContentElement.h:
(HTMLContentElement):
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::parseAttribute):
* mathml/MathMLElement.h:
(MathMLElement):
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::parseAttribute):
* svg/SVGAElement.h:
(SVGAElement):
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::parseAttribute):
* svg/SVGAnimateMotionElement.h:
(SVGAnimateMotionElement):
* svg/SVGAnimateTransformElement.cpp:
(WebCore::SVGAnimateTransformElement::parseAttribute):
* svg/SVGAnimateTransformElement.h:
(SVGAnimateTransformElement):
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::parseAttribute):
* svg/SVGAnimationElement.h:
(SVGAnimationElement):
* svg/SVGCircleElement.cpp:
(WebCore::SVGCircleElement::parseAttribute):
* svg/SVGCircleElement.h:
(SVGCircleElement):
* svg/SVGClipPathElement.cpp:
(WebCore::SVGClipPathElement::parseAttribute):
* svg/SVGClipPathElement.h:
(SVGClipPathElement):
* svg/SVGComponentTransferFunctionElement.cpp:
(WebCore::SVGComponentTransferFunctionElement::parseAttribute):
* svg/SVGComponentTransferFunctionElement.h:
(SVGComponentTransferFunctionElement):
* svg/SVGCursorElement.cpp:
(WebCore::SVGCursorElement::parseAttribute):
* svg/SVGCursorElement.h:
(SVGCursorElement):
* svg/SVGElement.cpp:
(WebCore::SVGElement::reportAttributeParsingError):
(WebCore::SVGElement::parseAttribute):
* svg/SVGElement.h:
(SVGElement):
* svg/SVGEllipseElement.cpp:
(WebCore::SVGEllipseElement::parseAttribute):
* svg/SVGEllipseElement.h:
(SVGEllipseElement):
* svg/SVGExternalResourcesRequired.cpp:
(WebCore::SVGExternalResourcesRequired::parseAttribute):
* svg/SVGExternalResourcesRequired.h:
(SVGExternalResourcesRequired):
* svg/SVGFEBlendElement.cpp:
(WebCore::SVGFEBlendElement::parseAttribute):
* svg/SVGFEBlendElement.h:
(SVGFEBlendElement):
* svg/SVGFEColorMatrixElement.cpp:
(WebCore::SVGFEColorMatrixElement::parseAttribute):
* svg/SVGFEColorMatrixElement.h:
(SVGFEColorMatrixElement):
* svg/SVGFEComponentTransferElement.cpp:
(WebCore::SVGFEComponentTransferElement::parseAttribute):
* svg/SVGFEComponentTransferElement.h:
(SVGFEComponentTransferElement):
* svg/SVGFECompositeElement.cpp:
(WebCore::SVGFECompositeElement::parseAttribute):
* svg/SVGFECompositeElement.h:
(SVGFECompositeElement):
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::parseAttribute):
* svg/SVGFEConvolveMatrixElement.h:
(SVGFEConvolveMatrixElement):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::parseAttribute):
* svg/SVGFEDiffuseLightingElement.h:
(SVGFEDiffuseLightingElement):
* svg/SVGFEDisplacementMapElement.cpp:
(WebCore::SVGFEDisplacementMapElement::parseAttribute):
* svg/SVGFEDisplacementMapElement.h:
(SVGFEDisplacementMapElement):
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::parseAttribute):
* svg/SVGFEDropShadowElement.h:
(SVGFEDropShadowElement):
* svg/SVGFEGaussianBlurElement.cpp:
(WebCore::SVGFEGaussianBlurElement::parseAttribute):
* svg/SVGFEGaussianBlurElement.h:
(SVGFEGaussianBlurElement):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::parseAttribute):
* svg/SVGFEImageElement.h:
(SVGFEImageElement):
* svg/SVGFELightElement.cpp:
(WebCore::SVGFELightElement::parseAttribute):
* svg/SVGFELightElement.h:
(SVGFELightElement):
* svg/SVGFEMergeNodeElement.cpp:
(WebCore::SVGFEMergeNodeElement::parseAttribute):
* svg/SVGFEMergeNodeElement.h:
(SVGFEMergeNodeElement):
* svg/SVGFEMorphologyElement.cpp:
(WebCore::SVGFEMorphologyElement::parseAttribute):
* svg/SVGFEMorphologyElement.h:
(SVGFEMorphologyElement):
* svg/SVGFEOffsetElement.cpp:
(WebCore::SVGFEOffsetElement::parseAttribute):
* svg/SVGFEOffsetElement.h:
(SVGFEOffsetElement):
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::parseAttribute):
* svg/SVGFESpecularLightingElement.h:
(SVGFESpecularLightingElement):
* svg/SVGFETileElement.cpp:
(WebCore::SVGFETileElement::parseAttribute):
* svg/SVGFETileElement.h:
(SVGFETileElement):
* svg/SVGFETurbulenceElement.cpp:
(WebCore::SVGFETurbulenceElement::parseAttribute):
* svg/SVGFETurbulenceElement.h:
(SVGFETurbulenceElement):
* svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::parseAttribute):
* svg/SVGFilterElement.h:
(SVGFilterElement):
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
* svg/SVGFilterPrimitiveStandardAttributes.h:
(SVGFilterPrimitiveStandardAttributes):
* svg/SVGFitToViewBox.h:
(WebCore::SVGFitToViewBox::parseAttribute):
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::parseAttribute):
* svg/SVGFontFaceElement.h:
(SVGFontFaceElement):
* svg/SVGFontFaceUriElement.cpp:
(WebCore::SVGFontFaceUriElement::parseAttribute):
* svg/SVGFontFaceUriElement.h:
(SVGFontFaceUriElement):
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::parseAttribute):
* svg/SVGForeignObjectElement.h:
(SVGForeignObjectElement):
* svg/SVGGElement.cpp:
(WebCore::SVGGElement::parseAttribute):
* svg/SVGGElement.h:
(SVGGElement):
* svg/SVGGlyphElement.cpp:
(WebCore::SVGGlyphElement::parseAttribute):
* svg/SVGGlyphElement.h:
(SVGGlyphElement):
* svg/SVGGlyphRefElement.cpp:
(WebCore::SVGGlyphRefElement::parseAttribute):
* svg/SVGGlyphRefElement.h:
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::parseAttribute):
* svg/SVGGradientElement.h:
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::parseAttribute):
* svg/SVGImageElement.h:
(SVGImageElement):
* svg/SVGLangSpace.cpp:
(WebCore::SVGLangSpace::parseAttribute):
* svg/SVGLangSpace.h:
(SVGLangSpace):
* svg/SVGLineElement.cpp:
(WebCore::SVGLineElement::parseAttribute):
* svg/SVGLineElement.h:
(SVGLineElement):
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::parseAttribute):
* svg/SVGLinearGradientElement.h:
(SVGLinearGradientElement):
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::parseAttribute):
* svg/SVGMPathElement.h:
(SVGMPathElement):
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::parseAttribute):
* svg/SVGMarkerElement.h:
(SVGMarkerElement):
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::parseAttribute):
* svg/SVGMaskElement.h:
(SVGMaskElement):
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::parseAttribute):
* svg/SVGPathElement.h:
(SVGPathElement):
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::parseAttribute):
* svg/SVGPatternElement.h:
(SVGPatternElement):
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::parseAttribute):
* svg/SVGPolyElement.h:
(SVGPolyElement):
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::parseAttribute):
* svg/SVGRadialGradientElement.h:
(SVGRadialGradientElement):
* svg/SVGRectElement.cpp:
(WebCore::SVGRectElement::parseAttribute):
* svg/SVGRectElement.h:
(SVGRectElement):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::parseAttribute):
* svg/SVGSVGElement.h:
(SVGSVGElement):
* svg/SVGScriptElement.cpp:
(WebCore::SVGScriptElement::parseAttribute):
* svg/SVGScriptElement.h:
(SVGScriptElement):
* svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::parseAttribute):
* svg/SVGStopElement.h:
(SVGStopElement):
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::parseAttribute):
* svg/SVGStyleElement.h:
(SVGStyleElement):
* svg/SVGStyledElement.cpp:
(WebCore::SVGStyledElement::parseAttribute):
* svg/SVGStyledElement.h:
(SVGStyledElement):
* svg/SVGStyledTransformableElement.cpp:
(WebCore::SVGStyledTransformableElement::parseAttribute):
* svg/SVGStyledTransformableElement.h:
(SVGStyledTransformableElement):
* svg/SVGSymbolElement.cpp:
(WebCore::SVGSymbolElement::parseAttribute):
* svg/SVGSymbolElement.h:
(SVGSymbolElement):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::parseAttribute):
* svg/SVGTRefElement.h:
(SVGTRefElement):
* svg/SVGTests.cpp:
(WebCore::SVGTests::parseAttribute):
* svg/SVGTests.h:
(SVGTests):
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::parseAttribute):
* svg/SVGTextContentElement.h:
(SVGTextContentElement):
* svg/SVGTextElement.cpp:
(WebCore::SVGTextElement::parseAttribute):
* svg/SVGTextElement.h:
(SVGTextElement):
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::parseAttribute):
* svg/SVGTextPathElement.h:
* svg/SVGTextPositioningElement.cpp:
(WebCore::SVGTextPositioningElement::parseAttribute):
* svg/SVGTextPositioningElement.h:
(SVGTextPositioningElement):
* svg/SVGURIReference.cpp:
(WebCore::SVGURIReference::parseAttribute):
* svg/SVGURIReference.h:
(SVGURIReference):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::parseAttribute):
* svg/SVGUseElement.h:
(SVGUseElement):
* svg/SVGViewElement.cpp:
(WebCore::SVGViewElement::parseAttribute):
* svg/SVGViewElement.h:
(SVGViewElement):
* svg/SVGZoomAndPan.h:
(WebCore::SVGZoomAndPan::parseAttribute):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::parseAttribute):
* svg/animation/SVGSMILElement.h:
(SVGSMILElement):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/html/HTMLAnchorElement.cpp b/Source/WebCore/html/HTMLAnchorElement.cpp
index fbed632..d60e359 100644
--- a/Source/WebCore/html/HTMLAnchorElement.cpp
+++ b/Source/WebCore/html/HTMLAnchorElement.cpp
@@ -214,29 +214,29 @@
ContainerNode::setActive(down, pause);
}
-void HTMLAnchorElement::parseAttribute(const Attribute& attribute)
+void HTMLAnchorElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == hrefAttr) {
+ if (name == hrefAttr) {
bool wasLink = isLink();
- setIsLink(!attribute.isNull());
+ setIsLink(!value.isNull());
if (wasLink != isLink()) {
setNeedsStyleRecalc();
invalidateParentDistributionIfNecessary(this, SelectRuleFeatureSet::RuleFeatureLink | SelectRuleFeatureSet::RuleFeatureVisited | SelectRuleFeatureSet::RuleFeatureEnabled);
}
if (isLink()) {
- String parsedURL = stripLeadingAndTrailingHTMLSpaces(attribute.value());
+ String parsedURL = stripLeadingAndTrailingHTMLSpaces(value);
if (document()->isDNSPrefetchEnabled()) {
if (protocolIs(parsedURL, "http") || protocolIs(parsedURL, "https") || parsedURL.startsWith("//"))
prefetchDNS(document()->completeURL(parsedURL).host());
}
}
invalidateCachedVisitedLinkHash();
- } else if (attribute.name() == nameAttr || attribute.name() == titleAttr) {
+ } else if (name == nameAttr || name == titleAttr) {
// Do nothing.
- } else if (attribute.name() == relAttr)
- setRel(attribute.value());
+ } else if (name == relAttr)
+ setRel(value);
else
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
void HTMLAnchorElement::accessKeyAction(bool sendMouseEvents)
diff --git a/Source/WebCore/html/HTMLAnchorElement.h b/Source/WebCore/html/HTMLAnchorElement.h
index 6afe5a5..033e9c2 100644
--- a/Source/WebCore/html/HTMLAnchorElement.h
+++ b/Source/WebCore/html/HTMLAnchorElement.h
@@ -105,7 +105,7 @@
protected:
HTMLAnchorElement(const QualifiedName&, Document*);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
private:
virtual bool supportsFocus() const;
diff --git a/Source/WebCore/html/HTMLAppletElement.cpp b/Source/WebCore/html/HTMLAppletElement.cpp
index afc7268..7e0bba4 100644
--- a/Source/WebCore/html/HTMLAppletElement.cpp
+++ b/Source/WebCore/html/HTMLAppletElement.cpp
@@ -51,19 +51,19 @@
return adoptRef(new HTMLAppletElement(tagName, document, createdByParser));
}
-void HTMLAppletElement::parseAttribute(const Attribute& attribute)
+void HTMLAppletElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == altAttr
- || attribute.name() == archiveAttr
- || attribute.name() == codeAttr
- || attribute.name() == codebaseAttr
- || attribute.name() == mayscriptAttr
- || attribute.name() == objectAttr) {
+ if (name == altAttr
+ || name == archiveAttr
+ || name == codeAttr
+ || name == codebaseAttr
+ || name == mayscriptAttr
+ || name == objectAttr) {
// Do nothing.
return;
}
- HTMLPlugInImageElement::parseAttribute(attribute);
+ HTMLPlugInImageElement::parseAttribute(name, value);
}
bool HTMLAppletElement::rendererIsNeeded(const NodeRenderingContext& context)
diff --git a/Source/WebCore/html/HTMLAppletElement.h b/Source/WebCore/html/HTMLAppletElement.h
index 4c7275c..ac88a20 100644
--- a/Source/WebCore/html/HTMLAppletElement.h
+++ b/Source/WebCore/html/HTMLAppletElement.h
@@ -34,7 +34,7 @@
private:
HTMLAppletElement(const QualifiedName&, Document*, bool createdByParser);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool rendererIsNeeded(const NodeRenderingContext&) OVERRIDE;
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE;
diff --git a/Source/WebCore/html/HTMLAreaElement.cpp b/Source/WebCore/html/HTMLAreaElement.cpp
index 6e7f99d..3261b95 100644
--- a/Source/WebCore/html/HTMLAreaElement.cpp
+++ b/Source/WebCore/html/HTMLAreaElement.cpp
@@ -53,25 +53,25 @@
return adoptRef(new HTMLAreaElement(tagName, document));
}
-void HTMLAreaElement::parseAttribute(const Attribute& attribute)
+void HTMLAreaElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == shapeAttr) {
- if (equalIgnoringCase(attribute.value(), "default"))
+ if (name == shapeAttr) {
+ if (equalIgnoringCase(value, "default"))
m_shape = Default;
- else if (equalIgnoringCase(attribute.value(), "circle"))
+ else if (equalIgnoringCase(value, "circle"))
m_shape = Circle;
- else if (equalIgnoringCase(attribute.value(), "poly"))
+ else if (equalIgnoringCase(value, "poly"))
m_shape = Poly;
- else if (equalIgnoringCase(attribute.value(), "rect"))
+ else if (equalIgnoringCase(value, "rect"))
m_shape = Rect;
invalidateCachedRegion();
- } else if (attribute.name() == coordsAttr) {
- m_coords = newCoordsArray(attribute.value().string(), m_coordsLen);
+ } else if (name == coordsAttr) {
+ m_coords = newCoordsArray(value.string(), m_coordsLen);
invalidateCachedRegion();
- } else if (attribute.name() == altAttr || attribute.name() == accesskeyAttr) {
+ } else if (name == altAttr || name == accesskeyAttr) {
// Do nothing.
} else
- HTMLAnchorElement::parseAttribute(attribute);
+ HTMLAnchorElement::parseAttribute(name, value);
}
void HTMLAreaElement::invalidateCachedRegion()
diff --git a/Source/WebCore/html/HTMLAreaElement.h b/Source/WebCore/html/HTMLAreaElement.h
index 0caf354..865b865 100644
--- a/Source/WebCore/html/HTMLAreaElement.h
+++ b/Source/WebCore/html/HTMLAreaElement.h
@@ -50,7 +50,7 @@
private:
HTMLAreaElement(const QualifiedName&, Document*);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool supportsFocus() const;
virtual String target() const;
virtual bool isKeyboardFocusable(KeyboardEvent*) const;
diff --git a/Source/WebCore/html/HTMLBaseElement.cpp b/Source/WebCore/html/HTMLBaseElement.cpp
index b58035e..bb5bc8c 100644
--- a/Source/WebCore/html/HTMLBaseElement.cpp
+++ b/Source/WebCore/html/HTMLBaseElement.cpp
@@ -44,12 +44,12 @@
return adoptRef(new HTMLBaseElement(tagName, document));
}
-void HTMLBaseElement::parseAttribute(const Attribute& attribute)
+void HTMLBaseElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == hrefAttr || attribute.name() == targetAttr)
+ if (name == hrefAttr || name == targetAttr)
document()->processBaseElement();
else
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
Node::InsertionNotificationRequest HTMLBaseElement::insertedInto(ContainerNode* insertionPoint)
diff --git a/Source/WebCore/html/HTMLBaseElement.h b/Source/WebCore/html/HTMLBaseElement.h
index e6b0a41..434776d 100644
--- a/Source/WebCore/html/HTMLBaseElement.h
+++ b/Source/WebCore/html/HTMLBaseElement.h
@@ -39,7 +39,7 @@
virtual String target() const;
virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
virtual void removedFrom(ContainerNode*) OVERRIDE;
};
diff --git a/Source/WebCore/html/HTMLBodyElement.cpp b/Source/WebCore/html/HTMLBodyElement.cpp
index 6b25458..d45df45 100644
--- a/Source/WebCore/html/HTMLBodyElement.cpp
+++ b/Source/WebCore/html/HTMLBodyElement.cpp
@@ -91,22 +91,22 @@
HTMLElement::collectStyleForPresentationAttribute(attribute, style);
}
-void HTMLBodyElement::parseAttribute(const Attribute& attribute)
+void HTMLBodyElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == vlinkAttr || attribute.name() == alinkAttr || attribute.name() == linkAttr) {
- if (attribute.isNull()) {
- if (attribute.name() == linkAttr)
+ if (name == vlinkAttr || name == alinkAttr || name == linkAttr) {
+ if (value.isNull()) {
+ if (name == linkAttr)
document()->resetLinkColor();
- else if (attribute.name() == vlinkAttr)
+ else if (name == vlinkAttr)
document()->resetVisitedLinkColor();
else
document()->resetActiveLinkColor();
} else {
RGBA32 color;
- if (CSSParser::parseColor(color, attribute.value(), !document()->inQuirksMode())) {
- if (attribute.name() == linkAttr)
+ if (CSSParser::parseColor(color, value, !document()->inQuirksMode())) {
+ if (name == linkAttr)
document()->setLinkColor(color);
- else if (attribute.name() == vlinkAttr)
+ else if (name == vlinkAttr)
document()->setVisitedLinkColor(color);
else
document()->setActiveLinkColor(color);
@@ -114,42 +114,42 @@
}
setNeedsStyleRecalc();
- } else if (attribute.name() == onloadAttr)
- document()->setWindowAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onbeforeunloadAttr)
- document()->setWindowAttributeEventListener(eventNames().beforeunloadEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onunloadAttr)
- document()->setWindowAttributeEventListener(eventNames().unloadEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onpagehideAttr)
- document()->setWindowAttributeEventListener(eventNames().pagehideEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onpageshowAttr)
- document()->setWindowAttributeEventListener(eventNames().pageshowEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onpopstateAttr)
- document()->setWindowAttributeEventListener(eventNames().popstateEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onblurAttr)
- document()->setWindowAttributeEventListener(eventNames().blurEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onfocusAttr)
- document()->setWindowAttributeEventListener(eventNames().focusEvent, createAttributeEventListener(document()->frame(), attribute));
+ } else if (name == onloadAttr)
+ document()->setWindowAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onbeforeunloadAttr)
+ document()->setWindowAttributeEventListener(eventNames().beforeunloadEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onunloadAttr)
+ document()->setWindowAttributeEventListener(eventNames().unloadEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onpagehideAttr)
+ document()->setWindowAttributeEventListener(eventNames().pagehideEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onpageshowAttr)
+ document()->setWindowAttributeEventListener(eventNames().pageshowEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onpopstateAttr)
+ document()->setWindowAttributeEventListener(eventNames().popstateEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onblurAttr)
+ document()->setWindowAttributeEventListener(eventNames().blurEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onfocusAttr)
+ document()->setWindowAttributeEventListener(eventNames().focusEvent, createAttributeEventListener(document()->frame(), name, value));
#if ENABLE(ORIENTATION_EVENTS)
- else if (attribute.name() == onorientationchangeAttr)
- document()->setWindowAttributeEventListener(eventNames().orientationchangeEvent, createAttributeEventListener(document()->frame(), attribute));
+ else if (name == onorientationchangeAttr)
+ document()->setWindowAttributeEventListener(eventNames().orientationchangeEvent, createAttributeEventListener(document()->frame(), name, value));
#endif
- else if (attribute.name() == onhashchangeAttr)
- document()->setWindowAttributeEventListener(eventNames().hashchangeEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onresizeAttr)
- document()->setWindowAttributeEventListener(eventNames().resizeEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onscrollAttr)
- document()->setWindowAttributeEventListener(eventNames().scrollEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onselectionchangeAttr)
- document()->setAttributeEventListener(eventNames().selectionchangeEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onstorageAttr)
- document()->setWindowAttributeEventListener(eventNames().storageEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == ononlineAttr)
- document()->setWindowAttributeEventListener(eventNames().onlineEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onofflineAttr)
- document()->setWindowAttributeEventListener(eventNames().offlineEvent, createAttributeEventListener(document()->frame(), attribute));
+ else if (name == onhashchangeAttr)
+ document()->setWindowAttributeEventListener(eventNames().hashchangeEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onresizeAttr)
+ document()->setWindowAttributeEventListener(eventNames().resizeEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onscrollAttr)
+ document()->setWindowAttributeEventListener(eventNames().scrollEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onselectionchangeAttr)
+ document()->setAttributeEventListener(eventNames().selectionchangeEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onstorageAttr)
+ document()->setWindowAttributeEventListener(eventNames().storageEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == ononlineAttr)
+ document()->setWindowAttributeEventListener(eventNames().onlineEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onofflineAttr)
+ document()->setWindowAttributeEventListener(eventNames().offlineEvent, createAttributeEventListener(document()->frame(), name, value));
else
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
Node::InsertionNotificationRequest HTMLBodyElement::insertedInto(ContainerNode* insertionPoint)
diff --git a/Source/WebCore/html/HTMLBodyElement.h b/Source/WebCore/html/HTMLBodyElement.h
index 1395d8b..1ece73d 100644
--- a/Source/WebCore/html/HTMLBodyElement.h
+++ b/Source/WebCore/html/HTMLBodyElement.h
@@ -70,7 +70,7 @@
private:
HTMLBodyElement(const QualifiedName&, Document*);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
diff --git a/Source/WebCore/html/HTMLButtonElement.cpp b/Source/WebCore/html/HTMLButtonElement.cpp
index 205e962..1c9d53d 100644
--- a/Source/WebCore/html/HTMLButtonElement.cpp
+++ b/Source/WebCore/html/HTMLButtonElement.cpp
@@ -99,18 +99,18 @@
return HTMLFormControlElement::isPresentationAttribute(name);
}
-void HTMLButtonElement::parseAttribute(const Attribute& attribute)
+void HTMLButtonElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == typeAttr) {
- if (equalIgnoringCase(attribute.value(), "reset"))
+ if (name == typeAttr) {
+ if (equalIgnoringCase(value, "reset"))
m_type = RESET;
- else if (equalIgnoringCase(attribute.value(), "button"))
+ else if (equalIgnoringCase(value, "button"))
m_type = BUTTON;
else
m_type = SUBMIT;
setNeedsWillValidateCheck();
} else
- HTMLFormControlElement::parseAttribute(attribute);
+ HTMLFormControlElement::parseAttribute(name, value);
}
void HTMLButtonElement::defaultEventHandler(Event* event)
diff --git a/Source/WebCore/html/HTMLButtonElement.h b/Source/WebCore/html/HTMLButtonElement.h
index 74a5735..44731ea 100644
--- a/Source/WebCore/html/HTMLButtonElement.h
+++ b/Source/WebCore/html/HTMLButtonElement.h
@@ -49,7 +49,7 @@
virtual void willAddAuthorShadowRoot() OVERRIDE;
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void defaultEventHandler(Event*);
diff --git a/Source/WebCore/html/HTMLCanvasElement.cpp b/Source/WebCore/html/HTMLCanvasElement.cpp
index 0bc366e..006f9ab 100644
--- a/Source/WebCore/html/HTMLCanvasElement.cpp
+++ b/Source/WebCore/html/HTMLCanvasElement.cpp
@@ -111,11 +111,11 @@
m_context.clear(); // Ensure this goes away before the ImageBuffer.
}
-void HTMLCanvasElement::parseAttribute(const Attribute& attribute)
+void HTMLCanvasElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == widthAttr || attribute.name() == heightAttr)
+ if (name == widthAttr || name == heightAttr)
reset();
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
RenderObject* HTMLCanvasElement::createRenderer(RenderArena* arena, RenderStyle* style)
diff --git a/Source/WebCore/html/HTMLCanvasElement.h b/Source/WebCore/html/HTMLCanvasElement.h
index 486ae66..2fd5d48 100644
--- a/Source/WebCore/html/HTMLCanvasElement.h
+++ b/Source/WebCore/html/HTMLCanvasElement.h
@@ -143,7 +143,7 @@
private:
HTMLCanvasElement(const QualifiedName&, Document*);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
virtual void attach();
virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; }
diff --git a/Source/WebCore/html/HTMLDetailsElement.cpp b/Source/WebCore/html/HTMLDetailsElement.cpp
index ce53ce1..464733c 100644
--- a/Source/WebCore/html/HTMLDetailsElement.cpp
+++ b/Source/WebCore/html/HTMLDetailsElement.cpp
@@ -126,15 +126,15 @@
return static_cast<DetailsSummaryElement*>(userAgentShadowRoot()->firstChild())->fallbackSummary();
}
-void HTMLDetailsElement::parseAttribute(const Attribute& attribute)
+void HTMLDetailsElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == openAttr) {
+ if (name == openAttr) {
bool oldValue = m_isOpen;
- m_isOpen = !attribute.isNull();
+ m_isOpen = !value.isNull();
if (oldValue != m_isOpen)
reattachIfAttached();
} else
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
bool HTMLDetailsElement::childShouldCreateRenderer(const NodeRenderingContext& childContext) const
diff --git a/Source/WebCore/html/HTMLDetailsElement.h b/Source/WebCore/html/HTMLDetailsElement.h
index ca6397c..9da9698 100644
--- a/Source/WebCore/html/HTMLDetailsElement.h
+++ b/Source/WebCore/html/HTMLDetailsElement.h
@@ -37,7 +37,7 @@
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const OVERRIDE;
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
void createShadowSubtree();
diff --git a/Source/WebCore/html/HTMLElement.cpp b/Source/WebCore/html/HTMLElement.cpp
index 9c664ab..5716532 100644
--- a/Source/WebCore/html/HTMLElement.cpp
+++ b/Source/WebCore/html/HTMLElement.cpp
@@ -211,122 +211,122 @@
StyledElement::collectStyleForPresentationAttribute(attribute, style);
}
-void HTMLElement::parseAttribute(const Attribute& attribute)
+void HTMLElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (isIdAttributeName(attribute.name()) || attribute.name() == classAttr || attribute.name() == styleAttr)
- return StyledElement::parseAttribute(attribute);
+ if (isIdAttributeName(name) || name == classAttr || name == styleAttr)
+ return StyledElement::parseAttribute(name, value);
- if (attribute.name() == dirAttr)
- dirAttributeChanged(attribute);
- else if (attribute.name() == tabindexAttr) {
+ if (name == dirAttr)
+ dirAttributeChanged(value);
+ else if (name == tabindexAttr) {
int tabindex = 0;
- if (attribute.isEmpty())
+ if (value.isEmpty())
clearTabIndexExplicitly();
- else if (parseHTMLInteger(attribute.value(), tabindex)) {
+ else if (parseHTMLInteger(value, tabindex)) {
// Clamp tabindex to the range of 'short' to match Firefox's behavior.
setTabIndexExplicitly(max(static_cast<int>(std::numeric_limits<short>::min()), min(tabindex, static_cast<int>(std::numeric_limits<short>::max()))));
}
#if ENABLE(MICRODATA)
- } else if (attribute.name() == itempropAttr) {
- setItemProp(attribute.value());
- } else if (attribute.name() == itemrefAttr) {
- setItemRef(attribute.value());
- } else if (attribute.name() == itemtypeAttr) {
- setItemType(attribute.value());
+ } else if (name == itempropAttr) {
+ setItemProp(value);
+ } else if (name == itemrefAttr) {
+ setItemRef(value);
+ } else if (name == itemtypeAttr) {
+ setItemType(value);
#endif
}
// standard events
- else if (attribute.name() == onclickAttr) {
- setAttributeEventListener(eventNames().clickEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == oncontextmenuAttr) {
- setAttributeEventListener(eventNames().contextmenuEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == ondblclickAttr) {
- setAttributeEventListener(eventNames().dblclickEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onmousedownAttr) {
- setAttributeEventListener(eventNames().mousedownEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onmousemoveAttr) {
- setAttributeEventListener(eventNames().mousemoveEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onmouseoutAttr) {
- setAttributeEventListener(eventNames().mouseoutEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onmouseoverAttr) {
- setAttributeEventListener(eventNames().mouseoverEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onmouseupAttr) {
- setAttributeEventListener(eventNames().mouseupEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onmousewheelAttr) {
- setAttributeEventListener(eventNames().mousewheelEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onfocusAttr) {
- setAttributeEventListener(eventNames().focusEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onfocusinAttr) {
- setAttributeEventListener(eventNames().focusinEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onfocusoutAttr) {
- setAttributeEventListener(eventNames().focusoutEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onblurAttr) {
- setAttributeEventListener(eventNames().blurEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onkeydownAttr) {
- setAttributeEventListener(eventNames().keydownEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onkeypressAttr) {
- setAttributeEventListener(eventNames().keypressEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onkeyupAttr) {
- setAttributeEventListener(eventNames().keyupEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onscrollAttr) {
- setAttributeEventListener(eventNames().scrollEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onbeforecutAttr) {
- setAttributeEventListener(eventNames().beforecutEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == oncutAttr) {
- setAttributeEventListener(eventNames().cutEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onbeforecopyAttr) {
- setAttributeEventListener(eventNames().beforecopyEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == oncopyAttr) {
- setAttributeEventListener(eventNames().copyEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onbeforepasteAttr) {
- setAttributeEventListener(eventNames().beforepasteEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onpasteAttr) {
- setAttributeEventListener(eventNames().pasteEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == ondragenterAttr) {
- setAttributeEventListener(eventNames().dragenterEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == ondragoverAttr) {
- setAttributeEventListener(eventNames().dragoverEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == ondragleaveAttr) {
- setAttributeEventListener(eventNames().dragleaveEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == ondropAttr) {
- setAttributeEventListener(eventNames().dropEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == ondragstartAttr) {
- setAttributeEventListener(eventNames().dragstartEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == ondragAttr) {
- setAttributeEventListener(eventNames().dragEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == ondragendAttr) {
- setAttributeEventListener(eventNames().dragendEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onselectstartAttr) {
- setAttributeEventListener(eventNames().selectstartEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onsubmitAttr) {
- setAttributeEventListener(eventNames().submitEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onerrorAttr) {
- setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onwebkitanimationstartAttr) {
- setAttributeEventListener(eventNames().webkitAnimationStartEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onwebkitanimationiterationAttr) {
- setAttributeEventListener(eventNames().webkitAnimationIterationEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onwebkitanimationendAttr) {
- setAttributeEventListener(eventNames().webkitAnimationEndEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onwebkittransitionendAttr) {
- setAttributeEventListener(eventNames().webkitTransitionEndEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == oninputAttr) {
- setAttributeEventListener(eventNames().inputEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == oninvalidAttr) {
- setAttributeEventListener(eventNames().invalidEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == ontouchstartAttr) {
- setAttributeEventListener(eventNames().touchstartEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == ontouchmoveAttr) {
- setAttributeEventListener(eventNames().touchmoveEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == ontouchendAttr) {
- setAttributeEventListener(eventNames().touchendEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == ontouchcancelAttr) {
- setAttributeEventListener(eventNames().touchcancelEvent, createAttributeEventListener(this, attribute));
+ else if (name == onclickAttr) {
+ setAttributeEventListener(eventNames().clickEvent, createAttributeEventListener(this, name, value));
+ } else if (name == oncontextmenuAttr) {
+ setAttributeEventListener(eventNames().contextmenuEvent, createAttributeEventListener(this, name, value));
+ } else if (name == ondblclickAttr) {
+ setAttributeEventListener(eventNames().dblclickEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onmousedownAttr) {
+ setAttributeEventListener(eventNames().mousedownEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onmousemoveAttr) {
+ setAttributeEventListener(eventNames().mousemoveEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onmouseoutAttr) {
+ setAttributeEventListener(eventNames().mouseoutEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onmouseoverAttr) {
+ setAttributeEventListener(eventNames().mouseoverEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onmouseupAttr) {
+ setAttributeEventListener(eventNames().mouseupEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onmousewheelAttr) {
+ setAttributeEventListener(eventNames().mousewheelEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onfocusAttr) {
+ setAttributeEventListener(eventNames().focusEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onfocusinAttr) {
+ setAttributeEventListener(eventNames().focusinEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onfocusoutAttr) {
+ setAttributeEventListener(eventNames().focusoutEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onblurAttr) {
+ setAttributeEventListener(eventNames().blurEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onkeydownAttr) {
+ setAttributeEventListener(eventNames().keydownEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onkeypressAttr) {
+ setAttributeEventListener(eventNames().keypressEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onkeyupAttr) {
+ setAttributeEventListener(eventNames().keyupEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onscrollAttr) {
+ setAttributeEventListener(eventNames().scrollEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onbeforecutAttr) {
+ setAttributeEventListener(eventNames().beforecutEvent, createAttributeEventListener(this, name, value));
+ } else if (name == oncutAttr) {
+ setAttributeEventListener(eventNames().cutEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onbeforecopyAttr) {
+ setAttributeEventListener(eventNames().beforecopyEvent, createAttributeEventListener(this, name, value));
+ } else if (name == oncopyAttr) {
+ setAttributeEventListener(eventNames().copyEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onbeforepasteAttr) {
+ setAttributeEventListener(eventNames().beforepasteEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onpasteAttr) {
+ setAttributeEventListener(eventNames().pasteEvent, createAttributeEventListener(this, name, value));
+ } else if (name == ondragenterAttr) {
+ setAttributeEventListener(eventNames().dragenterEvent, createAttributeEventListener(this, name, value));
+ } else if (name == ondragoverAttr) {
+ setAttributeEventListener(eventNames().dragoverEvent, createAttributeEventListener(this, name, value));
+ } else if (name == ondragleaveAttr) {
+ setAttributeEventListener(eventNames().dragleaveEvent, createAttributeEventListener(this, name, value));
+ } else if (name == ondropAttr) {
+ setAttributeEventListener(eventNames().dropEvent, createAttributeEventListener(this, name, value));
+ } else if (name == ondragstartAttr) {
+ setAttributeEventListener(eventNames().dragstartEvent, createAttributeEventListener(this, name, value));
+ } else if (name == ondragAttr) {
+ setAttributeEventListener(eventNames().dragEvent, createAttributeEventListener(this, name, value));
+ } else if (name == ondragendAttr) {
+ setAttributeEventListener(eventNames().dragendEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onselectstartAttr) {
+ setAttributeEventListener(eventNames().selectstartEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onsubmitAttr) {
+ setAttributeEventListener(eventNames().submitEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onerrorAttr) {
+ setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onwebkitanimationstartAttr) {
+ setAttributeEventListener(eventNames().webkitAnimationStartEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onwebkitanimationiterationAttr) {
+ setAttributeEventListener(eventNames().webkitAnimationIterationEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onwebkitanimationendAttr) {
+ setAttributeEventListener(eventNames().webkitAnimationEndEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onwebkittransitionendAttr) {
+ setAttributeEventListener(eventNames().webkitTransitionEndEvent, createAttributeEventListener(this, name, value));
+ } else if (name == oninputAttr) {
+ setAttributeEventListener(eventNames().inputEvent, createAttributeEventListener(this, name, value));
+ } else if (name == oninvalidAttr) {
+ setAttributeEventListener(eventNames().invalidEvent, createAttributeEventListener(this, name, value));
+ } else if (name == ontouchstartAttr) {
+ setAttributeEventListener(eventNames().touchstartEvent, createAttributeEventListener(this, name, value));
+ } else if (name == ontouchmoveAttr) {
+ setAttributeEventListener(eventNames().touchmoveEvent, createAttributeEventListener(this, name, value));
+ } else if (name == ontouchendAttr) {
+ setAttributeEventListener(eventNames().touchendEvent, createAttributeEventListener(this, name, value));
+ } else if (name == ontouchcancelAttr) {
+ setAttributeEventListener(eventNames().touchcancelEvent, createAttributeEventListener(this, name, value));
#if ENABLE(FULLSCREEN_API)
- } else if (attribute.name() == onwebkitfullscreenchangeAttr) {
- setAttributeEventListener(eventNames().webkitfullscreenchangeEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == onwebkitfullscreenerrorAttr) {
- setAttributeEventListener(eventNames().webkitfullscreenerrorEvent, createAttributeEventListener(this, attribute));
+ } else if (name == onwebkitfullscreenchangeAttr) {
+ setAttributeEventListener(eventNames().webkitfullscreenchangeEvent, createAttributeEventListener(this, name, value));
+ } else if (name == onwebkitfullscreenerrorAttr) {
+ setAttributeEventListener(eventNames().webkitfullscreenerrorEvent, createAttributeEventListener(this, name, value));
#endif
}
}
@@ -886,14 +886,14 @@
return LTR;
}
-void HTMLElement::dirAttributeChanged(const Attribute& attribute)
+void HTMLElement::dirAttributeChanged(const AtomicString& value)
{
Element* parent = parentElement();
if (parent && parent->isHTMLElement() && parent->selfOrAncestorHasDirAutoAttribute())
toHTMLElement(parent)->adjustDirectionalityIfNeededAfterChildAttributeChanged(this);
- if (equalIgnoringCase(attribute.value(), "auto"))
+ if (equalIgnoringCase(value, "auto"))
calculateAndAdjustDirectionality();
}
diff --git a/Source/WebCore/html/HTMLElement.h b/Source/WebCore/html/HTMLElement.h
index 2b01d6e..e837df4 100644
--- a/Source/WebCore/html/HTMLElement.h
+++ b/Source/WebCore/html/HTMLElement.h
@@ -118,7 +118,7 @@
void applyAlignmentAttributeToStyle(const Attribute&, StylePropertySet*);
void applyBorderAttributeToStyle(const Attribute&, StylePropertySet*);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
@@ -137,7 +137,7 @@
Node* insertAdjacent(const String& where, Node* newChild, ExceptionCode&);
PassRefPtr<DocumentFragment> textToFragment(const String&, ExceptionCode&);
- void dirAttributeChanged(const Attribute&);
+ void dirAttributeChanged(const AtomicString&);
void adjustDirectionalityIfNeededAfterChildAttributeChanged(Element* child);
void adjustDirectionalityIfNeededAfterChildrenChanged(Node* beforeChange, int childCountDelta);
TextDirection directionality(Node** strongDirectionalityTextNode= 0) const;
diff --git a/Source/WebCore/html/HTMLEmbedElement.cpp b/Source/WebCore/html/HTMLEmbedElement.cpp
index 14d44b6..9176d95 100644
--- a/Source/WebCore/html/HTMLEmbedElement.cpp
+++ b/Source/WebCore/html/HTMLEmbedElement.cpp
@@ -92,24 +92,24 @@
HTMLPlugInImageElement::collectStyleForPresentationAttribute(attribute, style);
}
-void HTMLEmbedElement::parseAttribute(const Attribute& attribute)
+void HTMLEmbedElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == typeAttr) {
- m_serviceType = attribute.value().string().lower();
+ if (name == typeAttr) {
+ m_serviceType = value.string().lower();
size_t pos = m_serviceType.find(";");
if (pos != notFound)
m_serviceType = m_serviceType.left(pos);
- } else if (attribute.name() == codeAttr)
- m_url = stripLeadingAndTrailingHTMLSpaces(attribute.value());
- else if (attribute.name() == srcAttr) {
- m_url = stripLeadingAndTrailingHTMLSpaces(attribute.value());
+ } else if (name == codeAttr)
+ m_url = stripLeadingAndTrailingHTMLSpaces(value);
+ else if (name == srcAttr) {
+ m_url = stripLeadingAndTrailingHTMLSpaces(value);
if (renderer() && isImageType()) {
if (!m_imageLoader)
m_imageLoader = adoptPtr(new HTMLImageLoader(this));
m_imageLoader->updateFromElementIgnoringPreviousError();
}
} else
- HTMLPlugInImageElement::parseAttribute(attribute);
+ HTMLPlugInImageElement::parseAttribute(name, value);
}
void HTMLEmbedElement::parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramValues)
diff --git a/Source/WebCore/html/HTMLEmbedElement.h b/Source/WebCore/html/HTMLEmbedElement.h
index 65ed0ab..8288c42 100644
--- a/Source/WebCore/html/HTMLEmbedElement.h
+++ b/Source/WebCore/html/HTMLEmbedElement.h
@@ -34,7 +34,7 @@
private:
HTMLEmbedElement(const QualifiedName&, Document*, bool createdByParser);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
diff --git a/Source/WebCore/html/HTMLFormControlElement.cpp b/Source/WebCore/html/HTMLFormControlElement.cpp
index 0062a18..9b19f8c 100644
--- a/Source/WebCore/html/HTMLFormControlElement.cpp
+++ b/Source/WebCore/html/HTMLFormControlElement.cpp
@@ -120,31 +120,31 @@
disabledAttributeChanged();
}
-void HTMLFormControlElement::parseAttribute(const Attribute& attribute)
+void HTMLFormControlElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == formAttr)
+ if (name == formAttr)
formAttributeChanged();
- else if (attribute.name() == disabledAttr) {
+ else if (name == disabledAttr) {
bool oldDisabled = m_disabled;
- m_disabled = !attribute.isNull();
+ m_disabled = !value.isNull();
if (oldDisabled != m_disabled)
disabledAttributeChanged();
- } else if (attribute.name() == readonlyAttr) {
+ } else if (name == readonlyAttr) {
bool oldReadOnly = m_readOnly;
- m_readOnly = !attribute.isNull();
+ m_readOnly = !value.isNull();
if (oldReadOnly != m_readOnly) {
setNeedsWillValidateCheck();
setNeedsStyleRecalc();
if (renderer() && renderer()->style()->hasAppearance())
renderer()->theme()->stateChanged(renderer(), ReadOnlyState);
}
- } else if (attribute.name() == requiredAttr) {
+ } else if (name == requiredAttr) {
bool oldRequired = m_required;
- m_required = !attribute.isNull();
+ m_required = !value.isNull();
if (oldRequired != m_required)
requiredAttributeChanged();
} else
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
void HTMLFormControlElement::disabledAttributeChanged()
diff --git a/Source/WebCore/html/HTMLFormControlElement.h b/Source/WebCore/html/HTMLFormControlElement.h
index b88b1b0..ec6e885 100644
--- a/Source/WebCore/html/HTMLFormControlElement.h
+++ b/Source/WebCore/html/HTMLFormControlElement.h
@@ -117,7 +117,7 @@
protected:
HTMLFormControlElement(const QualifiedName& tagName, Document*, HTMLFormElement*);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual void requiredAttributeChanged();
virtual void disabledAttributeChanged();
virtual void attach();
diff --git a/Source/WebCore/html/HTMLFormElement.cpp b/Source/WebCore/html/HTMLFormElement.cpp
index 18ac709..0519ecbf 100644
--- a/Source/WebCore/html/HTMLFormElement.cpp
+++ b/Source/WebCore/html/HTMLFormElement.cpp
@@ -428,35 +428,35 @@
}
#endif
-void HTMLFormElement::parseAttribute(const Attribute& attribute)
+void HTMLFormElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == actionAttr)
- m_attributes.parseAction(attribute.value());
- else if (attribute.name() == targetAttr)
- m_attributes.setTarget(attribute.value());
- else if (attribute.name() == methodAttr)
- m_attributes.updateMethodType(attribute.value());
- else if (attribute.name() == enctypeAttr)
- m_attributes.updateEncodingType(attribute.value());
- else if (attribute.name() == accept_charsetAttr)
- m_attributes.setAcceptCharset(attribute.value());
- else if (attribute.name() == autocompleteAttr) {
+ if (name == actionAttr)
+ m_attributes.parseAction(value);
+ else if (name == targetAttr)
+ m_attributes.setTarget(value);
+ else if (name == methodAttr)
+ m_attributes.updateMethodType(value);
+ else if (name == enctypeAttr)
+ m_attributes.updateEncodingType(value);
+ else if (name == accept_charsetAttr)
+ m_attributes.setAcceptCharset(value);
+ else if (name == autocompleteAttr) {
if (!shouldAutocomplete())
document()->registerForPageCacheSuspensionCallbacks(this);
else
document()->unregisterForPageCacheSuspensionCallbacks(this);
- } else if (attribute.name() == onsubmitAttr)
- setAttributeEventListener(eventNames().submitEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onresetAttr)
- setAttributeEventListener(eventNames().resetEvent, createAttributeEventListener(this, attribute));
+ } else if (name == onsubmitAttr)
+ setAttributeEventListener(eventNames().submitEvent, createAttributeEventListener(this, name, value));
+ else if (name == onresetAttr)
+ setAttributeEventListener(eventNames().resetEvent, createAttributeEventListener(this, name, value));
#if ENABLE(REQUEST_AUTOCOMPLETE)
- else if (attribute.name() == onautocompleteAttr)
- setAttributeEventListener(eventNames().autocompleteEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onautocompleteerrorAttr)
- setAttributeEventListener(eventNames().autocompleteerrorEvent, createAttributeEventListener(this, attribute));
+ else if (name == onautocompleteAttr)
+ setAttributeEventListener(eventNames().autocompleteEvent, createAttributeEventListener(this, name, value));
+ else if (name == onautocompleteerrorAttr)
+ setAttributeEventListener(eventNames().autocompleteerrorEvent, createAttributeEventListener(this, name, value));
#endif
else
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
template<class T, size_t n> static void removeFromVector(Vector<T*, n> & vec, T* item)
diff --git a/Source/WebCore/html/HTMLFormElement.h b/Source/WebCore/html/HTMLFormElement.h
index a8c2bee..a56a739 100644
--- a/Source/WebCore/html/HTMLFormElement.h
+++ b/Source/WebCore/html/HTMLFormElement.h
@@ -129,7 +129,7 @@
virtual void handleLocalEvents(Event*);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual void documentDidResumeFromPageCache();
diff --git a/Source/WebCore/html/HTMLFrameElement.cpp b/Source/WebCore/html/HTMLFrameElement.cpp
index 3d15c8b..1b28c21 100644
--- a/Source/WebCore/html/HTMLFrameElement.cpp
+++ b/Source/WebCore/html/HTMLFrameElement.cpp
@@ -82,17 +82,17 @@
}
}
-void HTMLFrameElement::parseAttribute(const Attribute& attribute)
+void HTMLFrameElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == frameborderAttr) {
- m_frameBorder = attribute.value().toInt();
- m_frameBorderSet = !attribute.isNull();
+ if (name == frameborderAttr) {
+ m_frameBorder = value.toInt();
+ m_frameBorderSet = !value.isNull();
// FIXME: If we are already attached, this has no effect.
- } else if (attribute.name() == noresizeAttr) {
+ } else if (name == noresizeAttr) {
if (renderer())
renderer()->updateFromElement();
} else
- HTMLFrameElementBase::parseAttribute(attribute);
+ HTMLFrameElementBase::parseAttribute(name, value);
}
} // namespace WebCore
diff --git a/Source/WebCore/html/HTMLFrameElement.h b/Source/WebCore/html/HTMLFrameElement.h
index 86e608d..0fad00d 100644
--- a/Source/WebCore/html/HTMLFrameElement.h
+++ b/Source/WebCore/html/HTMLFrameElement.h
@@ -44,7 +44,7 @@
virtual bool rendererIsNeeded(const NodeRenderingContext&);
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
#if ENABLE(FULLSCREEN_API)
virtual bool allowFullScreen() const { return false; }
diff --git a/Source/WebCore/html/HTMLFrameElementBase.cpp b/Source/WebCore/html/HTMLFrameElementBase.cpp
index 975b302..7adc9c8 100644
--- a/Source/WebCore/html/HTMLFrameElementBase.cpp
+++ b/Source/WebCore/html/HTMLFrameElementBase.cpp
@@ -102,47 +102,47 @@
contentFrame()->setInViewSourceMode(viewSourceMode());
}
-void HTMLFrameElementBase::parseAttribute(const Attribute& attribute)
+void HTMLFrameElementBase::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == srcdocAttr)
+ if (name == srcdocAttr)
setLocation("about:srcdoc");
- else if (attribute.name() == srcAttr && !fastHasAttribute(srcdocAttr))
- setLocation(stripLeadingAndTrailingHTMLSpaces(attribute.value()));
- else if (isIdAttributeName(attribute.name())) {
+ else if (name == srcAttr && !fastHasAttribute(srcdocAttr))
+ setLocation(stripLeadingAndTrailingHTMLSpaces(value));
+ else if (isIdAttributeName(name)) {
// Important to call through to base for the id attribute so the hasID bit gets set.
- HTMLFrameOwnerElement::parseAttribute(attribute);
- m_frameName = attribute.value();
- } else if (attribute.name() == nameAttr) {
- m_frameName = attribute.value();
+ HTMLFrameOwnerElement::parseAttribute(name, value);
+ m_frameName = value;
+ } else if (name == nameAttr) {
+ m_frameName = value;
// FIXME: If we are already attached, this doesn't actually change the frame's name.
// FIXME: If we are already attached, this doesn't check for frame name
// conflicts and generate a unique frame name.
- } else if (attribute.name() == marginwidthAttr) {
- m_marginWidth = attribute.value().toInt();
+ } else if (name == marginwidthAttr) {
+ m_marginWidth = value.toInt();
// FIXME: If we are already attached, this has no effect.
- } else if (attribute.name() == marginheightAttr) {
- m_marginHeight = attribute.value().toInt();
+ } else if (name == marginheightAttr) {
+ m_marginHeight = value.toInt();
// FIXME: If we are already attached, this has no effect.
- } else if (attribute.name() == scrollingAttr) {
+ } else if (name == scrollingAttr) {
// Auto and yes both simply mean "allow scrolling." No means "don't allow scrolling."
- if (equalIgnoringCase(attribute.value(), "auto") || equalIgnoringCase(attribute.value(), "yes"))
+ if (equalIgnoringCase(value, "auto") || equalIgnoringCase(value, "yes"))
m_scrolling = document()->frameElementsShouldIgnoreScrolling() ? ScrollbarAlwaysOff : ScrollbarAuto;
- else if (equalIgnoringCase(attribute.value(), "no"))
+ else if (equalIgnoringCase(value, "no"))
m_scrolling = ScrollbarAlwaysOff;
// FIXME: If we are already attached, this has no effect.
- } else if (attribute.name() == viewsourceAttr) {
- m_viewSource = !attribute.isNull();
+ } else if (name == viewsourceAttr) {
+ m_viewSource = !value.isNull();
if (contentFrame())
contentFrame()->setInViewSourceMode(viewSourceMode());
- } else if (attribute.name() == onloadAttr)
- setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onbeforeloadAttr)
- setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onbeforeunloadAttr) {
+ } else if (name == onloadAttr)
+ setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, name, value));
+ else if (name == onbeforeloadAttr)
+ setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, name, value));
+ else if (name == onbeforeunloadAttr) {
// FIXME: should <frame> elements have beforeunload handlers?
- setAttributeEventListener(eventNames().beforeunloadEvent, createAttributeEventListener(this, attribute));
+ setAttributeEventListener(eventNames().beforeunloadEvent, createAttributeEventListener(this, name, value));
} else
- HTMLFrameOwnerElement::parseAttribute(attribute);
+ HTMLFrameOwnerElement::parseAttribute(name, value);
}
void HTMLFrameElementBase::setNameAndOpenURL()
diff --git a/Source/WebCore/html/HTMLFrameElementBase.h b/Source/WebCore/html/HTMLFrameElementBase.h
index be9abc8..7af9485 100644
--- a/Source/WebCore/html/HTMLFrameElementBase.h
+++ b/Source/WebCore/html/HTMLFrameElementBase.h
@@ -49,7 +49,7 @@
bool isURLAllowed() const;
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
virtual void didNotifySubtreeInsertions(ContainerNode*) OVERRIDE;
virtual void attach();
diff --git a/Source/WebCore/html/HTMLFrameSetElement.cpp b/Source/WebCore/html/HTMLFrameSetElement.cpp
index 89e34a2..e89f6ee 100644
--- a/Source/WebCore/html/HTMLFrameSetElement.cpp
+++ b/Source/WebCore/html/HTMLFrameSetElement.cpp
@@ -79,21 +79,20 @@
HTMLElement::collectStyleForPresentationAttribute(attribute, style);
}
-void HTMLFrameSetElement::parseAttribute(const Attribute& attribute)
+void HTMLFrameSetElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == rowsAttr) {
- if (!attribute.isNull()) {
- m_rowLengths = newLengthArray(attribute.value().string(), m_totalRows);
+ if (name == rowsAttr) {
+ if (!value.isNull()) {
+ m_rowLengths = newLengthArray(value.string(), m_totalRows);
setNeedsStyleRecalc();
}
- } else if (attribute.name() == colsAttr) {
- if (!attribute.isNull()) {
- m_colLengths = newLengthArray(attribute.value().string(), m_totalCols);
+ } else if (name == colsAttr) {
+ if (!value.isNull()) {
+ m_colLengths = newLengthArray(value.string(), m_totalCols);
setNeedsStyleRecalc();
}
- } else if (attribute.name() == frameborderAttr) {
- if (!attribute.isNull()) {
- const AtomicString& value = attribute.value();
+ } else if (name == frameborderAttr) {
+ if (!value.isNull()) {
if (equalIgnoringCase(value, "no") || equalIgnoringCase(value, "0")) {
m_frameborder = false;
m_frameborderSet = true;
@@ -104,50 +103,50 @@
m_frameborder = false;
m_frameborderSet = false;
}
- } else if (attribute.name() == noresizeAttr) {
+ } else if (name == noresizeAttr) {
m_noresize = true;
- } else if (attribute.name() == borderAttr) {
- if (!attribute.isNull()) {
- m_border = attribute.value().toInt();
+ } else if (name == borderAttr) {
+ if (!value.isNull()) {
+ m_border = value.toInt();
m_borderSet = true;
} else
m_borderSet = false;
- } else if (attribute.name() == bordercolorAttr)
- m_borderColorSet = !attribute.isEmpty();
- else if (attribute.name() == onloadAttr)
- document()->setWindowAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onbeforeunloadAttr)
- document()->setWindowAttributeEventListener(eventNames().beforeunloadEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onunloadAttr)
- document()->setWindowAttributeEventListener(eventNames().unloadEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onblurAttr)
- document()->setWindowAttributeEventListener(eventNames().blurEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onfocusAttr)
- document()->setWindowAttributeEventListener(eventNames().focusEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onfocusinAttr)
- document()->setWindowAttributeEventListener(eventNames().focusinEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onfocusoutAttr)
- document()->setWindowAttributeEventListener(eventNames().focusoutEvent, createAttributeEventListener(document()->frame(), attribute));
+ } else if (name == bordercolorAttr)
+ m_borderColorSet = !value.isEmpty();
+ else if (name == onloadAttr)
+ document()->setWindowAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onbeforeunloadAttr)
+ document()->setWindowAttributeEventListener(eventNames().beforeunloadEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onunloadAttr)
+ document()->setWindowAttributeEventListener(eventNames().unloadEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onblurAttr)
+ document()->setWindowAttributeEventListener(eventNames().blurEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onfocusAttr)
+ document()->setWindowAttributeEventListener(eventNames().focusEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onfocusinAttr)
+ document()->setWindowAttributeEventListener(eventNames().focusinEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onfocusoutAttr)
+ document()->setWindowAttributeEventListener(eventNames().focusoutEvent, createAttributeEventListener(document()->frame(), name, value));
#if ENABLE(ORIENTATION_EVENTS)
- else if (attribute.name() == onorientationchangeAttr)
- document()->setWindowAttributeEventListener(eventNames().orientationchangeEvent, createAttributeEventListener(document()->frame(), attribute));
+ else if (name == onorientationchangeAttr)
+ document()->setWindowAttributeEventListener(eventNames().orientationchangeEvent, createAttributeEventListener(document()->frame(), name, value));
#endif
- else if (attribute.name() == onhashchangeAttr)
- document()->setWindowAttributeEventListener(eventNames().hashchangeEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onresizeAttr)
- document()->setWindowAttributeEventListener(eventNames().resizeEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onscrollAttr)
- document()->setWindowAttributeEventListener(eventNames().scrollEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onstorageAttr)
- document()->setWindowAttributeEventListener(eventNames().storageEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == ononlineAttr)
- document()->setWindowAttributeEventListener(eventNames().onlineEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onofflineAttr)
- document()->setWindowAttributeEventListener(eventNames().offlineEvent, createAttributeEventListener(document()->frame(), attribute));
- else if (attribute.name() == onpopstateAttr)
- document()->setWindowAttributeEventListener(eventNames().popstateEvent, createAttributeEventListener(document()->frame(), attribute));
+ else if (name == onhashchangeAttr)
+ document()->setWindowAttributeEventListener(eventNames().hashchangeEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onresizeAttr)
+ document()->setWindowAttributeEventListener(eventNames().resizeEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onscrollAttr)
+ document()->setWindowAttributeEventListener(eventNames().scrollEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onstorageAttr)
+ document()->setWindowAttributeEventListener(eventNames().storageEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == ononlineAttr)
+ document()->setWindowAttributeEventListener(eventNames().onlineEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onofflineAttr)
+ document()->setWindowAttributeEventListener(eventNames().offlineEvent, createAttributeEventListener(document()->frame(), name, value));
+ else if (name == onpopstateAttr)
+ document()->setWindowAttributeEventListener(eventNames().popstateEvent, createAttributeEventListener(document()->frame(), name, value));
else
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
bool HTMLFrameSetElement::rendererIsNeeded(const NodeRenderingContext& context)
diff --git a/Source/WebCore/html/HTMLFrameSetElement.h b/Source/WebCore/html/HTMLFrameSetElement.h
index 92ed564..90ae439 100644
--- a/Source/WebCore/html/HTMLFrameSetElement.h
+++ b/Source/WebCore/html/HTMLFrameSetElement.h
@@ -67,7 +67,7 @@
private:
HTMLFrameSetElement(const QualifiedName&, Document*);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
diff --git a/Source/WebCore/html/HTMLIFrameElement.cpp b/Source/WebCore/html/HTMLIFrameElement.cpp
index a5ff6ba..1195dcf 100644
--- a/Source/WebCore/html/HTMLIFrameElement.cpp
+++ b/Source/WebCore/html/HTMLIFrameElement.cpp
@@ -77,29 +77,28 @@
HTMLFrameElementBase::collectStyleForPresentationAttribute(attribute, style);
}
-void HTMLIFrameElement::parseAttribute(const Attribute& attribute)
+void HTMLIFrameElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == nameAttr) {
- const AtomicString& newName = attribute.value();
+ if (name == nameAttr) {
if (inDocument() && document()->isHTMLDocument()) {
HTMLDocument* document = static_cast<HTMLDocument*>(this->document());
document->removeExtraNamedItem(m_name);
- document->addExtraNamedItem(newName);
+ document->addExtraNamedItem(value);
}
- m_name = newName;
- } else if (attribute.name() == sandboxAttr) {
+ m_name = value;
+ } else if (name == sandboxAttr) {
String invalidTokens;
- setSandboxFlags(attribute.isNull() ? SandboxNone : SecurityContext::parseSandboxPolicy(attribute.value(), invalidTokens));
+ setSandboxFlags(value.isNull() ? SandboxNone : SecurityContext::parseSandboxPolicy(value, invalidTokens));
if (!invalidTokens.isNull()) {
int line = document()->scriptableDocumentParser() ? document()->scriptableDocumentParser()->lineNumber().oneBasedInt() : 0;
document()->addConsoleMessage(HTMLMessageSource, LogMessageType, ErrorMessageLevel, "Error while parsing the 'sandbox' attribute: " + invalidTokens, document()->url().string(), line);
}
- } else if (attribute.name() == seamlessAttr) {
+ } else if (name == seamlessAttr) {
// If we're adding or removing the seamless attribute, we need to force the content document to recalculate its StyleResolver.
if (contentDocument())
contentDocument()->styleResolverChanged(DeferRecalcStyle);
} else
- HTMLFrameElementBase::parseAttribute(attribute);
+ HTMLFrameElementBase::parseAttribute(name, value);
}
bool HTMLIFrameElement::rendererIsNeeded(const NodeRenderingContext& context)
diff --git a/Source/WebCore/html/HTMLIFrameElement.h b/Source/WebCore/html/HTMLIFrameElement.h
index e4c3904..ac8dfcc 100644
--- a/Source/WebCore/html/HTMLIFrameElement.h
+++ b/Source/WebCore/html/HTMLIFrameElement.h
@@ -37,7 +37,7 @@
private:
HTMLIFrameElement(const QualifiedName&, Document*);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
diff --git a/Source/WebCore/html/HTMLImageElement.cpp b/Source/WebCore/html/HTMLImageElement.cpp
index 2446844..69d8bc3 100644
--- a/Source/WebCore/html/HTMLImageElement.cpp
+++ b/Source/WebCore/html/HTMLImageElement.cpp
@@ -159,27 +159,27 @@
HTMLElement::collectStyleForPresentationAttribute(attribute, style);
}
-void HTMLImageElement::parseAttribute(const Attribute& attribute)
+void HTMLImageElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == altAttr) {
+ if (name == altAttr) {
RenderObject* renderObject = shadow() ? innerElement()->renderer() : renderer();
if (renderObject && renderObject->isImage())
toRenderImage(renderObject)->updateAltText();
- } else if (attribute.name() == srcAttr) {
+ } else if (name == srcAttr) {
m_imageLoader.updateFromElementIgnoringPreviousError();
if (ElementShadow* elementShadow = shadow())
elementShadow->invalidateDistribution();
- } else if (attribute.name() == usemapAttr)
- setIsLink(!attribute.isNull());
- else if (attribute.name() == onloadAttr)
- setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onbeforeloadAttr)
- setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == compositeAttr) {
- if (!parseCompositeOperator(attribute.value(), m_compositeOperator))
+ } else if (name == usemapAttr)
+ setIsLink(!value.isNull());
+ else if (name == onloadAttr)
+ setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, name, value));
+ else if (name == onbeforeloadAttr)
+ setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, name, value));
+ else if (name == compositeAttr) {
+ if (!parseCompositeOperator(value, m_compositeOperator))
m_compositeOperator = CompositeSourceOver;
} else
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
String HTMLImageElement::altText() const
diff --git a/Source/WebCore/html/HTMLImageElement.h b/Source/WebCore/html/HTMLImageElement.h
index de5e19c..5f5ebef 100644
--- a/Source/WebCore/html/HTMLImageElement.h
+++ b/Source/WebCore/html/HTMLImageElement.h
@@ -105,7 +105,7 @@
void refSourceElement() { ref(); }
void derefSourceElement() { deref(); }
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp
index ab77e23..6b28337 100644
--- a/Source/WebCore/html/HTMLInputElement.cpp
+++ b/Source/WebCore/html/HTMLInputElement.cpp
@@ -648,21 +648,21 @@
HTMLTextFormControlElement::collectStyleForPresentationAttribute(attribute, style);
}
-void HTMLInputElement::parseAttribute(const Attribute& attribute)
+void HTMLInputElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == nameAttr) {
+ if (name == nameAttr) {
removeFromRadioButtonGroup();
- m_name = attribute.value();
+ m_name = value;
addToRadioButtonGroup();
- HTMLTextFormControlElement::parseAttribute(attribute);
- } else if (attribute.name() == autocompleteAttr) {
- if (equalIgnoringCase(attribute.value(), "off")) {
+ HTMLTextFormControlElement::parseAttribute(name, value);
+ } else if (name == autocompleteAttr) {
+ if (equalIgnoringCase(value, "off")) {
m_autocomplete = Off;
registerForSuspensionCallbackIfNeeded();
} else {
bool needsToUnregister = m_autocomplete == Off;
- if (attribute.isEmpty())
+ if (value.isEmpty())
m_autocomplete = Uninitialized;
else
m_autocomplete = On;
@@ -670,9 +670,9 @@
if (needsToUnregister)
unregisterForSuspensionCallbackIfNeeded();
}
- } else if (attribute.name() == typeAttr) {
+ } else if (name == typeAttr)
updateType();
- } else if (attribute.name() == valueAttr) {
+ else if (name == valueAttr) {
// Changes to the value attribute may change whether or not this element has a default value.
// If this field is autocomplete=off that might affect the return value of needsSuspensionCallback.
if (m_autocomplete == Off) {
@@ -687,63 +687,63 @@
setFormControlValueMatchesRenderer(false);
setNeedsValidityCheck();
m_valueAttributeWasUpdatedAfterParsing = !m_parsingInProgress;
- } else if (attribute.name() == checkedAttr) {
+ } else if (name == checkedAttr) {
// Another radio button in the same group might be checked by state
// restore. We shouldn't call setChecked() even if this has the checked
// attribute. So, delay the setChecked() call until
// finishParsingChildren() is called if parsing is in progress.
if (!m_parsingInProgress && m_reflectsCheckedAttribute) {
- setChecked(!attribute.isNull());
+ setChecked(!value.isNull());
m_reflectsCheckedAttribute = true;
}
- } else if (attribute.name() == maxlengthAttr)
- parseMaxLengthAttribute(attribute);
- else if (attribute.name() == sizeAttr) {
+ } else if (name == maxlengthAttr)
+ parseMaxLengthAttribute(value);
+ else if (name == sizeAttr) {
int oldSize = m_size;
- int value = attribute.value().toInt();
- m_size = value > 0 ? value : defaultSize;
+ int valueAsInteger = value.toInt();
+ m_size = valueAsInteger > 0 ? valueAsInteger : defaultSize;
if (m_size != oldSize && renderer())
renderer()->setNeedsLayoutAndPrefWidthsRecalc();
- } else if (attribute.name() == altAttr)
+ } else if (name == altAttr)
m_inputType->altAttributeChanged();
- else if (attribute.name() == srcAttr)
+ else if (name == srcAttr)
m_inputType->srcAttributeChanged();
- else if (attribute.name() == usemapAttr || attribute.name() == accesskeyAttr) {
+ else if (name == usemapAttr || name == accesskeyAttr) {
// FIXME: ignore for the moment
- } else if (attribute.name() == onsearchAttr) {
+ } else if (name == onsearchAttr) {
// Search field and slider attributes all just cause updateFromElement to be called through style recalcing.
- setAttributeEventListener(eventNames().searchEvent, createAttributeEventListener(this, attribute));
- } else if (attribute.name() == resultsAttr) {
+ setAttributeEventListener(eventNames().searchEvent, createAttributeEventListener(this, name, value));
+ } else if (name == resultsAttr) {
int oldResults = m_maxResults;
- m_maxResults = !attribute.isNull() ? std::min(attribute.value().toInt(), maxSavedResults) : -1;
+ m_maxResults = !value.isNull() ? std::min(value.toInt(), maxSavedResults) : -1;
// FIXME: Detaching just for maxResults change is not ideal. We should figure out the right
// time to relayout for this change.
if (m_maxResults != oldResults && (m_maxResults <= 0 || oldResults <= 0))
reattachIfAttached();
setNeedsStyleRecalc();
- } else if (attribute.name() == autosaveAttr || attribute.name() == incrementalAttr)
+ } else if (name == autosaveAttr || name == incrementalAttr)
setNeedsStyleRecalc();
- else if (attribute.name() == minAttr || attribute.name() == maxAttr) {
+ else if (name == minAttr || name == maxAttr) {
m_inputType->minOrMaxAttributeChanged();
setNeedsValidityCheck();
- } else if (attribute.name() == multipleAttr) {
+ } else if (name == multipleAttr) {
m_inputType->multipleAttributeChanged();
setNeedsValidityCheck();
- } else if (attribute.name() == stepAttr) {
+ } else if (name == stepAttr) {
m_inputType->stepAttributeChanged();
setNeedsValidityCheck();
- } else if (attribute.name() == patternAttr || attribute.name() == precisionAttr)
+ } else if (name == patternAttr || name == precisionAttr)
setNeedsValidityCheck();
- else if (attribute.name() == disabledAttr) {
- HTMLTextFormControlElement::parseAttribute(attribute);
+ else if (name == disabledAttr) {
+ HTMLTextFormControlElement::parseAttribute(name, value);
m_inputType->disabledAttributeChanged();
- } else if (attribute.name() == readonlyAttr) {
- HTMLTextFormControlElement::parseAttribute(attribute);
+ } else if (name == readonlyAttr) {
+ HTMLTextFormControlElement::parseAttribute(name, value);
m_inputType->readonlyAttributeChanged();
}
#if ENABLE(DATALIST_ELEMENT)
- else if (attribute.name() == listAttr) {
- m_hasNonEmptyList = !attribute.isEmpty();
+ else if (name == listAttr) {
+ m_hasNonEmptyList = !value.isEmpty();
if (m_hasNonEmptyList) {
resetListAttributeTargetObserver();
listAttributeTargetChanged();
@@ -751,7 +751,7 @@
}
#endif
#if ENABLE(INPUT_SPEECH)
- else if (attribute.name() == webkitspeechAttr) {
+ else if (name == webkitspeechAttr) {
if (renderer()) {
// This renderer and its children have quite different layouts and styles depending on
// whether the speech button is visible or not. So we reset the whole thing and recreate
@@ -766,11 +766,11 @@
}
setFormControlValueMatchesRenderer(false);
setNeedsStyleRecalc();
- } else if (attribute.name() == onwebkitspeechchangeAttr)
- setAttributeEventListener(eventNames().webkitspeechchangeEvent, createAttributeEventListener(this, attribute));
+ } else if (name == onwebkitspeechchangeAttr)
+ setAttributeEventListener(eventNames().webkitspeechchangeEvent, createAttributeEventListener(this, name, value));
#endif
else
- HTMLTextFormControlElement::parseAttribute(attribute);
+ HTMLTextFormControlElement::parseAttribute(name, value);
m_inputType->updateInnerTextValue();
}
@@ -1758,10 +1758,10 @@
return m_inputType->updatePlaceholderText();
}
-void HTMLInputElement::parseMaxLengthAttribute(const Attribute& attribute)
+void HTMLInputElement::parseMaxLengthAttribute(const AtomicString& value)
{
int maxLength;
- if (!parseHTMLInteger(attribute.value(), maxLength))
+ if (!parseHTMLInteger(value, maxLength))
maxLength = maximumLength;
if (maxLength < 0 || maxLength > maximumLength)
maxLength = maximumLength;
diff --git a/Source/WebCore/html/HTMLInputElement.h b/Source/WebCore/html/HTMLInputElement.h
index f5197fe..0471a3b 100644
--- a/Source/WebCore/html/HTMLInputElement.h
+++ b/Source/WebCore/html/HTMLInputElement.h
@@ -338,7 +338,7 @@
virtual void accessKeyAction(bool sendMouseEvents);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
virtual void finishParsingChildren();
@@ -394,7 +394,7 @@
#if ENABLE(DATALIST_ELEMENT)
void resetListAttributeTargetObserver();
#endif
- void parseMaxLengthAttribute(const Attribute&);
+ void parseMaxLengthAttribute(const AtomicString&);
void updateValueIfNeeded();
// Returns null if this isn't associated with any radio button group.
diff --git a/Source/WebCore/html/HTMLKeygenElement.cpp b/Source/WebCore/html/HTMLKeygenElement.cpp
index c72625e..1e4ec06 100644
--- a/Source/WebCore/html/HTMLKeygenElement.cpp
+++ b/Source/WebCore/html/HTMLKeygenElement.cpp
@@ -92,13 +92,13 @@
return adoptRef(new HTMLKeygenElement(tagName, document, form));
}
-void HTMLKeygenElement::parseAttribute(const Attribute& attribute)
+void HTMLKeygenElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
// Reflect disabled attribute on the shadow select element
- if (attribute.name() == disabledAttr)
- shadowSelect()->setAttribute(attribute.name(), attribute.value());
+ if (name == disabledAttr)
+ shadowSelect()->setAttribute(name, value);
- HTMLFormControlElement::parseAttribute(attribute);
+ HTMLFormControlElement::parseAttribute(name, value);
}
bool HTMLKeygenElement::appendFormData(FormDataList& encoded_values, bool)
diff --git a/Source/WebCore/html/HTMLKeygenElement.h b/Source/WebCore/html/HTMLKeygenElement.h
index e3c9129..048d54e 100644
--- a/Source/WebCore/html/HTMLKeygenElement.h
+++ b/Source/WebCore/html/HTMLKeygenElement.h
@@ -43,7 +43,7 @@
virtual bool canStartSelection() const { return false; }
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool appendFormData(FormDataList&, bool);
virtual const AtomicString& formControlType() const;
diff --git a/Source/WebCore/html/HTMLLIElement.cpp b/Source/WebCore/html/HTMLLIElement.cpp
index be6e82a..6753652 100644
--- a/Source/WebCore/html/HTMLLIElement.cpp
+++ b/Source/WebCore/html/HTMLLIElement.cpp
@@ -76,13 +76,13 @@
HTMLElement::collectStyleForPresentationAttribute(attribute, style);
}
-void HTMLLIElement::parseAttribute(const Attribute& attribute)
+void HTMLLIElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == valueAttr) {
+ if (name == valueAttr) {
if (renderer() && renderer()->isListItem())
- parseValue(attribute.value());
+ parseValue(value);
} else
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
void HTMLLIElement::attach()
diff --git a/Source/WebCore/html/HTMLLIElement.h b/Source/WebCore/html/HTMLLIElement.h
index 508aa25..cf0ef60 100644
--- a/Source/WebCore/html/HTMLLIElement.h
+++ b/Source/WebCore/html/HTMLLIElement.h
@@ -35,7 +35,7 @@
private:
HTMLLIElement(const QualifiedName&, Document*);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
diff --git a/Source/WebCore/html/HTMLLinkElement.cpp b/Source/WebCore/html/HTMLLinkElement.cpp
index 4a3dcfc..491d730 100644
--- a/Source/WebCore/html/HTMLLinkElement.cpp
+++ b/Source/WebCore/html/HTMLLinkElement.cpp
@@ -130,36 +130,36 @@
}
}
-void HTMLLinkElement::parseAttribute(const Attribute& attribute)
+void HTMLLinkElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == relAttr) {
- m_relAttribute = LinkRelAttribute(attribute.value());
+ if (name == relAttr) {
+ m_relAttribute = LinkRelAttribute(value);
process();
- } else if (attribute.name() == hrefAttr) {
- String url = stripLeadingAndTrailingHTMLSpaces(attribute.value());
+ } else if (name == hrefAttr) {
+ String url = stripLeadingAndTrailingHTMLSpaces(value);
m_url = url.isEmpty() ? KURL() : document()->completeURL(url);
process();
- } else if (attribute.name() == typeAttr) {
- m_type = attribute.value();
+ } else if (name == typeAttr) {
+ m_type = value;
process();
- } else if (attribute.name() == sizesAttr) {
- setSizes(attribute.value());
+ } else if (name == sizesAttr) {
+ setSizes(value);
process();
- } else if (attribute.name() == mediaAttr) {
- m_media = attribute.value().string().lower();
+ } else if (name == mediaAttr) {
+ m_media = value.string().lower();
process();
- } else if (attribute.name() == disabledAttr)
- setDisabledState(!attribute.isNull());
- else if (attribute.name() == onbeforeloadAttr)
- setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onloadAttr)
- setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onerrorAttr)
- setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, attribute));
+ } else if (name == disabledAttr)
+ setDisabledState(!value.isNull());
+ else if (name == onbeforeloadAttr)
+ setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, name, value));
+ else if (name == onloadAttr)
+ setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, name, value));
+ else if (name == onerrorAttr)
+ setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, name, value));
else {
- if (attribute.name() == titleAttr && m_sheet)
- m_sheet->setTitle(attribute.value());
- HTMLElement::parseAttribute(attribute);
+ if (name == titleAttr && m_sheet)
+ m_sheet->setTitle(value);
+ HTMLElement::parseAttribute(name, value);
}
}
diff --git a/Source/WebCore/html/HTMLLinkElement.h b/Source/WebCore/html/HTMLLinkElement.h
index 0b6c6c9..2c718c0 100644
--- a/Source/WebCore/html/HTMLLinkElement.h
+++ b/Source/WebCore/html/HTMLLinkElement.h
@@ -73,7 +73,7 @@
static void dispatchPendingLoadEvents();
private:
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool shouldLoadLink();
void process();
diff --git a/Source/WebCore/html/HTMLMapElement.cpp b/Source/WebCore/html/HTMLMapElement.cpp
index de3fee4..d01eae6 100644
--- a/Source/WebCore/html/HTMLMapElement.cpp
+++ b/Source/WebCore/html/HTMLMapElement.cpp
@@ -98,21 +98,21 @@
return 0;
}
-void HTMLMapElement::parseAttribute(const Attribute& attribute)
+void HTMLMapElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
// FIXME: This logic seems wrong for XML documents.
// Either the id or name will be used depending on the order the attributes are parsed.
- if (isIdAttributeName(attribute.name()) || attribute.name() == nameAttr) {
- if (isIdAttributeName(attribute.name())) {
+ if (isIdAttributeName(name) || name == nameAttr) {
+ if (isIdAttributeName(name)) {
// Call base class so that hasID bit gets set.
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
if (document()->isHTMLDocument())
return;
}
if (inDocument())
treeScope()->removeImageMap(this);
- String mapName = attribute.value();
+ String mapName = value;
if (mapName[0] == '#')
mapName = mapName.substring(1);
m_name = document()->isHTMLDocument() ? mapName.lower() : mapName;
@@ -122,7 +122,7 @@
return;
}
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
PassRefPtr<HTMLCollection> HTMLMapElement::areas()
diff --git a/Source/WebCore/html/HTMLMapElement.h b/Source/WebCore/html/HTMLMapElement.h
index f73a62b..76641de 100644
--- a/Source/WebCore/html/HTMLMapElement.h
+++ b/Source/WebCore/html/HTMLMapElement.h
@@ -46,7 +46,7 @@
private:
HTMLMapElement(const QualifiedName&, Document*);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
virtual void removedFrom(ContainerNode*) OVERRIDE;
diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp
index 409546a..68949cb 100644
--- a/Source/WebCore/html/HTMLMediaElement.cpp
+++ b/Source/WebCore/html/HTMLMediaElement.cpp
@@ -359,24 +359,24 @@
return false;
}
-void HTMLMediaElement::parseAttribute(const Attribute& attribute)
+void HTMLMediaElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == srcAttr) {
+ if (name == srcAttr) {
// Trigger a reload, as long as the 'src' attribute is present.
if (fastHasAttribute(srcAttr)) {
clearMediaPlayer(MediaResource);
scheduleLoad(MediaResource);
}
- } else if (attribute.name() == controlsAttr)
+ } else if (name == controlsAttr)
configureMediaControls();
#if PLATFORM(MAC)
- else if (attribute.name() == loopAttr)
+ else if (name == loopAttr)
updateDisableSleep();
#endif
- else if (attribute.name() == preloadAttr) {
- if (equalIgnoringCase(attribute.value(), "none"))
+ else if (name == preloadAttr) {
+ if (equalIgnoringCase(value, "none"))
m_preload = MediaPlayer::None;
- else if (equalIgnoringCase(attribute.value(), "metadata"))
+ else if (equalIgnoringCase(value, "metadata"))
m_preload = MediaPlayer::MetaData;
else {
// The spec does not define an "invalid value default" but "auto" is suggested as the
@@ -388,60 +388,60 @@
if (!autoplay() && m_player)
m_player->setPreload(m_preload);
- } else if (attribute.name() == mediagroupAttr)
- setMediaGroup(attribute.value());
- else if (attribute.name() == onabortAttr)
- setAttributeEventListener(eventNames().abortEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onbeforeloadAttr)
- setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == oncanplayAttr)
- setAttributeEventListener(eventNames().canplayEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == oncanplaythroughAttr)
- setAttributeEventListener(eventNames().canplaythroughEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == ondurationchangeAttr)
- setAttributeEventListener(eventNames().durationchangeEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onemptiedAttr)
- setAttributeEventListener(eventNames().emptiedEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onendedAttr)
- setAttributeEventListener(eventNames().endedEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onerrorAttr)
- setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onloadeddataAttr)
- setAttributeEventListener(eventNames().loadeddataEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onloadedmetadataAttr)
- setAttributeEventListener(eventNames().loadedmetadataEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onloadstartAttr)
- setAttributeEventListener(eventNames().loadstartEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onpauseAttr)
- setAttributeEventListener(eventNames().pauseEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onplayAttr)
- setAttributeEventListener(eventNames().playEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onplayingAttr)
- setAttributeEventListener(eventNames().playingEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onprogressAttr)
- setAttributeEventListener(eventNames().progressEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onratechangeAttr)
- setAttributeEventListener(eventNames().ratechangeEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onseekedAttr)
- setAttributeEventListener(eventNames().seekedEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onseekingAttr)
- setAttributeEventListener(eventNames().seekingEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onstalledAttr)
- setAttributeEventListener(eventNames().stalledEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onsuspendAttr)
- setAttributeEventListener(eventNames().suspendEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == ontimeupdateAttr)
- setAttributeEventListener(eventNames().timeupdateEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onvolumechangeAttr)
- setAttributeEventListener(eventNames().volumechangeEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onwaitingAttr)
- setAttributeEventListener(eventNames().waitingEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onwebkitbeginfullscreenAttr)
- setAttributeEventListener(eventNames().webkitbeginfullscreenEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onwebkitendfullscreenAttr)
- setAttributeEventListener(eventNames().webkitendfullscreenEvent, createAttributeEventListener(this, attribute));
+ } else if (name == mediagroupAttr)
+ setMediaGroup(value);
+ else if (name == onabortAttr)
+ setAttributeEventListener(eventNames().abortEvent, createAttributeEventListener(this, name, value));
+ else if (name == onbeforeloadAttr)
+ setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, name, value));
+ else if (name == oncanplayAttr)
+ setAttributeEventListener(eventNames().canplayEvent, createAttributeEventListener(this, name, value));
+ else if (name == oncanplaythroughAttr)
+ setAttributeEventListener(eventNames().canplaythroughEvent, createAttributeEventListener(this, name, value));
+ else if (name == ondurationchangeAttr)
+ setAttributeEventListener(eventNames().durationchangeEvent, createAttributeEventListener(this, name, value));
+ else if (name == onemptiedAttr)
+ setAttributeEventListener(eventNames().emptiedEvent, createAttributeEventListener(this, name, value));
+ else if (name == onendedAttr)
+ setAttributeEventListener(eventNames().endedEvent, createAttributeEventListener(this, name, value));
+ else if (name == onerrorAttr)
+ setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, name, value));
+ else if (name == onloadeddataAttr)
+ setAttributeEventListener(eventNames().loadeddataEvent, createAttributeEventListener(this, name, value));
+ else if (name == onloadedmetadataAttr)
+ setAttributeEventListener(eventNames().loadedmetadataEvent, createAttributeEventListener(this, name, value));
+ else if (name == onloadstartAttr)
+ setAttributeEventListener(eventNames().loadstartEvent, createAttributeEventListener(this, name, value));
+ else if (name == onpauseAttr)
+ setAttributeEventListener(eventNames().pauseEvent, createAttributeEventListener(this, name, value));
+ else if (name == onplayAttr)
+ setAttributeEventListener(eventNames().playEvent, createAttributeEventListener(this, name, value));
+ else if (name == onplayingAttr)
+ setAttributeEventListener(eventNames().playingEvent, createAttributeEventListener(this, name, value));
+ else if (name == onprogressAttr)
+ setAttributeEventListener(eventNames().progressEvent, createAttributeEventListener(this, name, value));
+ else if (name == onratechangeAttr)
+ setAttributeEventListener(eventNames().ratechangeEvent, createAttributeEventListener(this, name, value));
+ else if (name == onseekedAttr)
+ setAttributeEventListener(eventNames().seekedEvent, createAttributeEventListener(this, name, value));
+ else if (name == onseekingAttr)
+ setAttributeEventListener(eventNames().seekingEvent, createAttributeEventListener(this, name, value));
+ else if (name == onstalledAttr)
+ setAttributeEventListener(eventNames().stalledEvent, createAttributeEventListener(this, name, value));
+ else if (name == onsuspendAttr)
+ setAttributeEventListener(eventNames().suspendEvent, createAttributeEventListener(this, name, value));
+ else if (name == ontimeupdateAttr)
+ setAttributeEventListener(eventNames().timeupdateEvent, createAttributeEventListener(this, name, value));
+ else if (name == onvolumechangeAttr)
+ setAttributeEventListener(eventNames().volumechangeEvent, createAttributeEventListener(this, name, value));
+ else if (name == onwaitingAttr)
+ setAttributeEventListener(eventNames().waitingEvent, createAttributeEventListener(this, name, value));
+ else if (name == onwebkitbeginfullscreenAttr)
+ setAttributeEventListener(eventNames().webkitbeginfullscreenEvent, createAttributeEventListener(this, name, value));
+ else if (name == onwebkitendfullscreenAttr)
+ setAttributeEventListener(eventNames().webkitendfullscreenEvent, createAttributeEventListener(this, name, value));
else
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
void HTMLMediaElement::finishParsingChildren()
diff --git a/Source/WebCore/html/HTMLMediaElement.h b/Source/WebCore/html/HTMLMediaElement.h
index d1cced0..ea9a4b7 100644
--- a/Source/WebCore/html/HTMLMediaElement.h
+++ b/Source/WebCore/html/HTMLMediaElement.h
@@ -324,7 +324,7 @@
HTMLMediaElement(const QualifiedName&, Document*, bool);
virtual ~HTMLMediaElement();
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual void finishParsingChildren();
virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual void attach() OVERRIDE;
diff --git a/Source/WebCore/html/HTMLMetaElement.cpp b/Source/WebCore/html/HTMLMetaElement.cpp
index 0e0d27b..fecc8a2 100644
--- a/Source/WebCore/html/HTMLMetaElement.cpp
+++ b/Source/WebCore/html/HTMLMetaElement.cpp
@@ -42,16 +42,16 @@
return adoptRef(new HTMLMetaElement(tagName, document));
}
-void HTMLMetaElement::parseAttribute(const Attribute& attribute)
+void HTMLMetaElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == http_equivAttr)
+ if (name == http_equivAttr)
process();
- else if (attribute.name() == contentAttr)
+ else if (name == contentAttr)
process();
- else if (attribute.name() == nameAttr) {
+ else if (name == nameAttr) {
// Do nothing
} else
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
Node::InsertionNotificationRequest HTMLMetaElement::insertedInto(ContainerNode* insertionPoint)
diff --git a/Source/WebCore/html/HTMLMetaElement.h b/Source/WebCore/html/HTMLMetaElement.h
index 92118f8..41f2780 100644
--- a/Source/WebCore/html/HTMLMetaElement.h
+++ b/Source/WebCore/html/HTMLMetaElement.h
@@ -38,7 +38,7 @@
private:
HTMLMetaElement(const QualifiedName&, Document*);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
void process();
diff --git a/Source/WebCore/html/HTMLMeterElement.cpp b/Source/WebCore/html/HTMLMeterElement.cpp
index a7c6698..63ae7a7 100644
--- a/Source/WebCore/html/HTMLMeterElement.cpp
+++ b/Source/WebCore/html/HTMLMeterElement.cpp
@@ -77,12 +77,12 @@
return Node::supportsFocus() && !disabled();
}
-void HTMLMeterElement::parseAttribute(const Attribute& attribute)
+void HTMLMeterElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == valueAttr || attribute.name() == minAttr || attribute.name() == maxAttr || attribute.name() == lowAttr || attribute.name() == highAttr || attribute.name() == optimumAttr)
+ if (name == valueAttr || name == minAttr || name == maxAttr || name == lowAttr || name == highAttr || name == optimumAttr)
didElementStateChange();
else
- LabelableElement::parseAttribute(attribute);
+ LabelableElement::parseAttribute(name, value);
}
double HTMLMeterElement::min() const
diff --git a/Source/WebCore/html/HTMLMeterElement.h b/Source/WebCore/html/HTMLMeterElement.h
index fb12b37..d1107a4 100644
--- a/Source/WebCore/html/HTMLMeterElement.h
+++ b/Source/WebCore/html/HTMLMeterElement.h
@@ -79,7 +79,7 @@
virtual bool recalcWillValidate() const { return false; }
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const OVERRIDE;
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
void didElementStateChange();
void createShadowSubtree();
diff --git a/Source/WebCore/html/HTMLOListElement.cpp b/Source/WebCore/html/HTMLOListElement.cpp
index 17dd19b..8b761e8 100644
--- a/Source/WebCore/html/HTMLOListElement.cpp
+++ b/Source/WebCore/html/HTMLOListElement.cpp
@@ -78,25 +78,25 @@
HTMLElement::collectStyleForPresentationAttribute(attribute, style);
}
-void HTMLOListElement::parseAttribute(const Attribute& attribute)
+void HTMLOListElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == startAttr) {
+ if (name == startAttr) {
int oldStart = start();
bool canParse;
- int parsedStart = attribute.value().toInt(&canParse);
+ int parsedStart = value.toInt(&canParse);
m_hasExplicitStart = canParse;
m_start = canParse ? parsedStart : 0xBADBEEF;
if (oldStart == start())
return;
updateItemValues();
- } else if (attribute.name() == reversedAttr) {
- bool reversed = !attribute.isNull();
+ } else if (name == reversedAttr) {
+ bool reversed = !value.isNull();
if (reversed == m_isReversed)
return;
m_isReversed = reversed;
updateItemValues();
} else
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
void HTMLOListElement::setStart(int start)
diff --git a/Source/WebCore/html/HTMLOListElement.h b/Source/WebCore/html/HTMLOListElement.h
index d84551e..22a9799 100644
--- a/Source/WebCore/html/HTMLOListElement.h
+++ b/Source/WebCore/html/HTMLOListElement.h
@@ -53,7 +53,7 @@
void recalculateItemCount();
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
diff --git a/Source/WebCore/html/HTMLObjectElement.cpp b/Source/WebCore/html/HTMLObjectElement.cpp
index ec8bdd3..8c60445 100644
--- a/Source/WebCore/html/HTMLObjectElement.cpp
+++ b/Source/WebCore/html/HTMLObjectElement.cpp
@@ -94,19 +94,19 @@
HTMLPlugInImageElement::collectStyleForPresentationAttribute(attribute, style);
}
-void HTMLObjectElement::parseAttribute(const Attribute& attribute)
+void HTMLObjectElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == formAttr)
+ if (name == formAttr)
formAttributeChanged();
- else if (attribute.name() == typeAttr) {
- m_serviceType = attribute.value().lower();
+ else if (name == typeAttr) {
+ m_serviceType = value.lower();
size_t pos = m_serviceType.find(";");
if (pos != notFound)
m_serviceType = m_serviceType.left(pos);
if (renderer())
setNeedsWidgetUpdate(true);
- } else if (attribute.name() == dataAttr) {
- m_url = stripLeadingAndTrailingHTMLSpaces(attribute.value());
+ } else if (name == dataAttr) {
+ m_url = stripLeadingAndTrailingHTMLSpaces(value);
if (renderer()) {
setNeedsWidgetUpdate(true);
if (isImageType()) {
@@ -115,16 +115,16 @@
m_imageLoader->updateFromElementIgnoringPreviousError();
}
}
- } else if (attribute.name() == classidAttr) {
- m_classId = attribute.value();
+ } else if (name == classidAttr) {
+ m_classId = value;
if (renderer())
setNeedsWidgetUpdate(true);
- } else if (attribute.name() == onloadAttr)
- setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onbeforeloadAttr)
- setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attribute));
+ } else if (name == onloadAttr)
+ setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, name, value));
+ else if (name == onbeforeloadAttr)
+ setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, name, value));
else
- HTMLPlugInImageElement::parseAttribute(attribute);
+ HTMLPlugInImageElement::parseAttribute(name, value);
}
static void mapDataParamToSrc(Vector<String>* paramNames, Vector<String>* paramValues)
diff --git a/Source/WebCore/html/HTMLObjectElement.h b/Source/WebCore/html/HTMLObjectElement.h
index 1127498..dc19ff2 100644
--- a/Source/WebCore/html/HTMLObjectElement.h
+++ b/Source/WebCore/html/HTMLObjectElement.h
@@ -67,7 +67,7 @@
private:
HTMLObjectElement(const QualifiedName&, Document*, HTMLFormElement*, bool createdByParser);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
diff --git a/Source/WebCore/html/HTMLOptGroupElement.cpp b/Source/WebCore/html/HTMLOptGroupElement.cpp
index 9547bcc..d71021b 100644
--- a/Source/WebCore/html/HTMLOptGroupElement.cpp
+++ b/Source/WebCore/html/HTMLOptGroupElement.cpp
@@ -78,12 +78,12 @@
HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
}
-void HTMLOptGroupElement::parseAttribute(const Attribute& attribute)
+void HTMLOptGroupElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
recalcSelectOptions();
- if (attribute.name() == disabledAttr)
+ if (name == disabledAttr)
invalidateParentDistributionIfNecessary(this, SelectRuleFeatureSet::RuleFeatureDisabled | SelectRuleFeatureSet::RuleFeatureEnabled);
}
diff --git a/Source/WebCore/html/HTMLOptGroupElement.h b/Source/WebCore/html/HTMLOptGroupElement.h
index c6ad359b..1bfb140 100644
--- a/Source/WebCore/html/HTMLOptGroupElement.h
+++ b/Source/WebCore/html/HTMLOptGroupElement.h
@@ -46,7 +46,7 @@
virtual bool supportsFocus() const;
virtual bool isFocusable() const;
virtual bool isEnabledFormControl() const OVERRIDE { return !disabled(); }
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; }
virtual void attach();
virtual void detach();
diff --git a/Source/WebCore/html/HTMLOptionElement.cpp b/Source/WebCore/html/HTMLOptionElement.cpp
index 4e48600..c1e7a37 100644
--- a/Source/WebCore/html/HTMLOptionElement.cpp
+++ b/Source/WebCore/html/HTMLOptionElement.cpp
@@ -190,33 +190,33 @@
return 0;
}
-void HTMLOptionElement::parseAttribute(const Attribute& attribute)
+void HTMLOptionElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
#if ENABLE(DATALIST_ELEMENT)
- if (attribute.name() == valueAttr) {
+ if (name == valueAttr) {
if (HTMLDataListElement* dataList = ownerDataListElement())
dataList->optionElementChildrenChanged();
} else
#endif
- if (attribute.name() == disabledAttr) {
+ if (name == disabledAttr) {
bool oldDisabled = m_disabled;
- m_disabled = !attribute.isNull();
+ m_disabled = !value.isNull();
if (oldDisabled != m_disabled) {
setNeedsStyleRecalc();
invalidateParentDistributionIfNecessary(this, SelectRuleFeatureSet::RuleFeatureDisabled | SelectRuleFeatureSet::RuleFeatureEnabled);
if (renderer() && renderer()->style()->hasAppearance())
renderer()->theme()->stateChanged(renderer(), EnabledState);
}
- } else if (attribute.name() == selectedAttr) {
+ } else if (name == selectedAttr) {
// FIXME: This doesn't match what the HTML specification says.
// The specification implies that removing the selected attribute or
// changing the value of a selected attribute that is already present
// has no effect on whether the element is selected. Further, it seems
// that we need to do more than just set m_isSelected to select in that
// case; we'd need to do the other work from the setSelected function.
- m_isSelected = !attribute.isNull();
+ m_isSelected = !value.isNull();
} else
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
String HTMLOptionElement::value() const
diff --git a/Source/WebCore/html/HTMLOptionElement.h b/Source/WebCore/html/HTMLOptionElement.h
index 8f61b30..1bcb943 100644
--- a/Source/WebCore/html/HTMLOptionElement.h
+++ b/Source/WebCore/html/HTMLOptionElement.h
@@ -76,7 +76,7 @@
virtual void attach();
virtual void detach();
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
virtual void accessKeyAction(bool);
diff --git a/Source/WebCore/html/HTMLOutputElement.cpp b/Source/WebCore/html/HTMLOutputElement.cpp
index 277fe5a..740fd9c 100644
--- a/Source/WebCore/html/HTMLOutputElement.cpp
+++ b/Source/WebCore/html/HTMLOutputElement.cpp
@@ -61,12 +61,12 @@
return Node::supportsFocus() && !disabled();
}
-void HTMLOutputElement::parseAttribute(const Attribute& attribute)
+void HTMLOutputElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == HTMLNames::forAttr)
- setFor(attribute.value());
+ if (name == HTMLNames::forAttr)
+ setFor(value);
else
- HTMLFormControlElement::parseAttribute(attribute);
+ HTMLFormControlElement::parseAttribute(name, value);
}
DOMSettableTokenList* HTMLOutputElement::htmlFor() const
diff --git a/Source/WebCore/html/HTMLOutputElement.h b/Source/WebCore/html/HTMLOutputElement.h
index da2c8d8..cade5ad 100644
--- a/Source/WebCore/html/HTMLOutputElement.h
+++ b/Source/WebCore/html/HTMLOutputElement.h
@@ -55,7 +55,7 @@
private:
HTMLOutputElement(const QualifiedName&, Document*, HTMLFormElement*);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual const AtomicString& formControlType() const;
virtual bool isEnumeratable() const { return true; }
virtual bool supportLabels() const OVERRIDE { return true; }
diff --git a/Source/WebCore/html/HTMLProgressElement.cpp b/Source/WebCore/html/HTMLProgressElement.cpp
index 10bfc2c..ea5f407 100644
--- a/Source/WebCore/html/HTMLProgressElement.cpp
+++ b/Source/WebCore/html/HTMLProgressElement.cpp
@@ -94,14 +94,14 @@
return Node::supportsFocus() && !disabled();
}
-void HTMLProgressElement::parseAttribute(const Attribute& attribute)
+void HTMLProgressElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == valueAttr)
+ if (name == valueAttr)
didElementStateChange();
- else if (attribute.name() == maxAttr)
+ else if (name == maxAttr)
didElementStateChange();
else
- LabelableElement::parseAttribute(attribute);
+ LabelableElement::parseAttribute(name, value);
}
void HTMLProgressElement::attach()
diff --git a/Source/WebCore/html/HTMLProgressElement.h b/Source/WebCore/html/HTMLProgressElement.h
index 8cc45c8..c39e8dd 100644
--- a/Source/WebCore/html/HTMLProgressElement.h
+++ b/Source/WebCore/html/HTMLProgressElement.h
@@ -65,7 +65,7 @@
virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const OVERRIDE;
RenderProgress* renderProgress() const;
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual void attach();
diff --git a/Source/WebCore/html/HTMLScriptElement.cpp b/Source/WebCore/html/HTMLScriptElement.cpp
index 4f2c956..57f8511 100644
--- a/Source/WebCore/html/HTMLScriptElement.cpp
+++ b/Source/WebCore/html/HTMLScriptElement.cpp
@@ -58,18 +58,18 @@
ScriptElement::childrenChanged();
}
-void HTMLScriptElement::parseAttribute(const Attribute& attribute)
+void HTMLScriptElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == srcAttr)
- handleSourceAttribute(attribute.value());
- else if (attribute.name() == asyncAttr)
+ if (name == srcAttr)
+ handleSourceAttribute(value);
+ else if (name == asyncAttr)
handleAsyncAttribute();
- else if (attribute.name() == onloadAttr)
- setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onbeforeloadAttr)
- setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attribute));
+ else if (name == onloadAttr)
+ setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, name, value));
+ else if (name == onbeforeloadAttr)
+ setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, name, value));
else
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
Node::InsertionNotificationRequest HTMLScriptElement::insertedInto(ContainerNode* insertionPoint)
diff --git a/Source/WebCore/html/HTMLScriptElement.h b/Source/WebCore/html/HTMLScriptElement.h
index c2ca0db..beac8eb 100644
--- a/Source/WebCore/html/HTMLScriptElement.h
+++ b/Source/WebCore/html/HTMLScriptElement.h
@@ -44,7 +44,7 @@
private:
HTMLScriptElement(const QualifiedName&, Document*, bool wasInsertedByParser, bool alreadyStarted);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
diff --git a/Source/WebCore/html/HTMLSelectElement.cpp b/Source/WebCore/html/HTMLSelectElement.cpp
index 1ceae8c..0527a91 100644
--- a/Source/WebCore/html/HTMLSelectElement.cpp
+++ b/Source/WebCore/html/HTMLSelectElement.cpp
@@ -284,15 +284,15 @@
return HTMLFormControlElementWithState::isPresentationAttribute(name);
}
-void HTMLSelectElement::parseAttribute(const Attribute& attribute)
+void HTMLSelectElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == sizeAttr) {
+ if (name == sizeAttr) {
int oldSize = m_size;
// Set the attribute value to a number.
// This is important since the style rules for this attribute can determine the appearance property.
- int size = attribute.value().toInt();
+ int size = value.toInt();
String attrSize = String::number(size);
- if (attrSize != attribute.value()) {
+ if (attrSize != value) {
// FIXME: This is horribly factored.
if (Attribute* sizeAttribute = getAttributeItem(sizeAttr))
sizeAttribute->setValue(attrSize);
@@ -309,14 +309,14 @@
reattach();
setRecalcListItems();
}
- } else if (attribute.name() == multipleAttr)
- parseMultipleAttribute(attribute);
- else if (attribute.name() == accesskeyAttr) {
+ } else if (name == multipleAttr)
+ parseMultipleAttribute(value);
+ else if (name == accesskeyAttr) {
// FIXME: ignore for the moment.
- } else if (attribute.name() == onchangeAttr)
- setAttributeEventListener(eventNames().changeEvent, createAttributeEventListener(this, attribute));
+ } else if (name == onchangeAttr)
+ setAttributeEventListener(eventNames().changeEvent, createAttributeEventListener(this, name, value));
else
- HTMLFormControlElementWithState::parseAttribute(attribute);
+ HTMLFormControlElementWithState::parseAttribute(name, value);
}
bool HTMLSelectElement::isKeyboardFocusable(KeyboardEvent* event) const
@@ -1000,10 +1000,10 @@
setNeedsValidityCheck();
}
-void HTMLSelectElement::parseMultipleAttribute(const Attribute& attribute)
+void HTMLSelectElement::parseMultipleAttribute(const AtomicString& value)
{
bool oldUsesMenuList = usesMenuList();
- m_multiple = !attribute.isNull();
+ m_multiple = !value.isNull();
setNeedsValidityCheck();
if (oldUsesMenuList != usesMenuList())
reattachIfAttached();
diff --git a/Source/WebCore/html/HTMLSelectElement.h b/Source/WebCore/html/HTMLSelectElement.h
index 9147c3f..6d88da1 100644
--- a/Source/WebCore/html/HTMLSelectElement.h
+++ b/Source/WebCore/html/HTMLSelectElement.h
@@ -124,7 +124,7 @@
virtual FormControlState saveFormControlState() const OVERRIDE;
virtual void restoreFormControlState(const FormControlState&) OVERRIDE;
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const OVERRIDE;
@@ -158,7 +158,7 @@
typedef unsigned SelectOptionFlags;
void selectOption(int optionIndex, SelectOptionFlags = 0);
void deselectItemsWithoutValidation(HTMLElement* elementToExclude = 0);
- void parseMultipleAttribute(const Attribute&);
+ void parseMultipleAttribute(const AtomicString&);
int lastSelectedListIndex() const;
void updateSelectedState(int listIndex, bool multi, bool shift);
void menuListDefaultEventHandler(Event*);
diff --git a/Source/WebCore/html/HTMLStyleElement.cpp b/Source/WebCore/html/HTMLStyleElement.cpp
index 22645dc..db91c99 100644
--- a/Source/WebCore/html/HTMLStyleElement.cpp
+++ b/Source/WebCore/html/HTMLStyleElement.cpp
@@ -70,21 +70,21 @@
return adoptRef(new HTMLStyleElement(tagName, document, createdByParser));
}
-void HTMLStyleElement::parseAttribute(const Attribute& attribute)
+void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == titleAttr && m_sheet)
- m_sheet->setTitle(attribute.value());
- else if (attribute.name() == onloadAttr)
- setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onerrorAttr)
- setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == scopedAttr && ContextFeatures::styleScopedEnabled(document()))
- scopedAttributeChanged(!attribute.isNull());
- else if (attribute.name() == mediaAttr && inDocument() && document()->renderer() && m_sheet) {
- m_sheet->setMediaQueries(MediaQuerySet::createAllowingDescriptionSyntax(attribute.value()));
+ if (name == titleAttr && m_sheet)
+ m_sheet->setTitle(value);
+ else if (name == onloadAttr)
+ setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, name, value));
+ else if (name == onerrorAttr)
+ setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, name, value));
+ else if (name == scopedAttr && ContextFeatures::styleScopedEnabled(document()))
+ scopedAttributeChanged(!value.isNull());
+ else if (name == mediaAttr && inDocument() && document()->renderer() && m_sheet) {
+ m_sheet->setMediaQueries(MediaQuerySet::createAllowingDescriptionSyntax(value));
document()->styleResolverChanged(RecalcStyleImmediately);
} else
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
void HTMLStyleElement::scopedAttributeChanged(bool scoped)
diff --git a/Source/WebCore/html/HTMLStyleElement.h b/Source/WebCore/html/HTMLStyleElement.h
index cc9e0b2..d3e99e4 100644
--- a/Source/WebCore/html/HTMLStyleElement.h
+++ b/Source/WebCore/html/HTMLStyleElement.h
@@ -65,7 +65,7 @@
HTMLStyleElement(const QualifiedName&, Document*, bool createdByParser);
// overload from HTMLElement
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
virtual void removedFrom(ContainerNode*) OVERRIDE;
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
diff --git a/Source/WebCore/html/HTMLTableCellElement.cpp b/Source/WebCore/html/HTMLTableCellElement.cpp
index c79e205..71cbb99 100644
--- a/Source/WebCore/html/HTMLTableCellElement.cpp
+++ b/Source/WebCore/html/HTMLTableCellElement.cpp
@@ -105,16 +105,16 @@
HTMLTablePartElement::collectStyleForPresentationAttribute(attribute, style);
}
-void HTMLTableCellElement::parseAttribute(const Attribute& attribute)
+void HTMLTableCellElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == rowspanAttr) {
+ if (name == rowspanAttr) {
if (renderer() && renderer()->isTableCell())
toRenderTableCell(renderer())->colSpanOrRowSpanChanged();
- } else if (attribute.name() == colspanAttr) {
+ } else if (name == colspanAttr) {
if (renderer() && renderer()->isTableCell())
toRenderTableCell(renderer())->colSpanOrRowSpanChanged();
} else
- HTMLTablePartElement::parseAttribute(attribute);
+ HTMLTablePartElement::parseAttribute(name, value);
}
const StylePropertySet* HTMLTableCellElement::additionalPresentationAttributeStyle()
diff --git a/Source/WebCore/html/HTMLTableCellElement.h b/Source/WebCore/html/HTMLTableCellElement.h
index ee7675b..a8bcbbc 100644
--- a/Source/WebCore/html/HTMLTableCellElement.h
+++ b/Source/WebCore/html/HTMLTableCellElement.h
@@ -53,7 +53,7 @@
private:
HTMLTableCellElement(const QualifiedName&, Document*);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
diff --git a/Source/WebCore/html/HTMLTableColElement.cpp b/Source/WebCore/html/HTMLTableColElement.cpp
index b4c6952..9af84376 100644
--- a/Source/WebCore/html/HTMLTableColElement.cpp
+++ b/Source/WebCore/html/HTMLTableColElement.cpp
@@ -62,14 +62,14 @@
HTMLTablePartElement::collectStyleForPresentationAttribute(attribute, style);
}
-void HTMLTableColElement::parseAttribute(const Attribute& attribute)
+void HTMLTableColElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == spanAttr) {
- m_span = !attribute.isNull() ? attribute.value().toInt() : 1;
+ if (name == spanAttr) {
+ m_span = !value.isNull() ? value.toInt() : 1;
if (renderer() && renderer()->isRenderTableCol())
renderer()->updateFromElement();
- } else if (attribute.name() == widthAttr) {
- if (!attribute.isEmpty()) {
+ } else if (name == widthAttr) {
+ if (!value.isEmpty()) {
if (renderer() && renderer()->isRenderTableCol()) {
RenderTableCol* col = toRenderTableCol(renderer());
int newWidth = width().toInt();
@@ -78,7 +78,7 @@
}
}
} else
- HTMLTablePartElement::parseAttribute(attribute);
+ HTMLTablePartElement::parseAttribute(name, value);
}
const StylePropertySet* HTMLTableColElement::additionalPresentationAttributeStyle()
diff --git a/Source/WebCore/html/HTMLTableColElement.h b/Source/WebCore/html/HTMLTableColElement.h
index 669b6cf..87c0098 100644
--- a/Source/WebCore/html/HTMLTableColElement.h
+++ b/Source/WebCore/html/HTMLTableColElement.h
@@ -42,7 +42,7 @@
private:
HTMLTableColElement(const QualifiedName& tagName, Document*);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
virtual const StylePropertySet* additionalPresentationAttributeStyle() OVERRIDE;
diff --git a/Source/WebCore/html/HTMLTableElement.cpp b/Source/WebCore/html/HTMLTableElement.cpp
index 6c45bab..c27d519 100644
--- a/Source/WebCore/html/HTMLTableElement.cpp
+++ b/Source/WebCore/html/HTMLTableElement.cpp
@@ -369,48 +369,48 @@
return HTMLElement::isPresentationAttribute(name);
}
-void HTMLTableElement::parseAttribute(const Attribute& attribute)
+void HTMLTableElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
CellBorders bordersBefore = cellBorders();
unsigned short oldPadding = m_padding;
- if (attribute.name() == borderAttr) {
+ if (name == borderAttr) {
// FIXME: This attribute is a mess.
m_borderAttr = true;
- if (!attribute.isNull()) {
- int border = attribute.isEmpty() ? 1 : attribute.value().toInt();
+ if (!value.isNull()) {
+ int border = value.isEmpty() ? 1 : value.toInt();
m_borderAttr = border;
}
- } else if (attribute.name() == bordercolorAttr) {
- m_borderColorAttr = !attribute.isEmpty();
- } else if (attribute.name() == frameAttr) {
+ } else if (name == bordercolorAttr) {
+ m_borderColorAttr = !value.isEmpty();
+ } else if (name == frameAttr) {
// FIXME: This attribute is a mess.
bool borderTop;
bool borderRight;
bool borderBottom;
bool borderLeft;
- m_frameAttr = getBordersFromFrameAttributeValue(attribute.value(), borderTop, borderRight, borderBottom, borderLeft);
- } else if (attribute.name() == rulesAttr) {
+ m_frameAttr = getBordersFromFrameAttributeValue(value, borderTop, borderRight, borderBottom, borderLeft);
+ } else if (name == rulesAttr) {
m_rulesAttr = UnsetRules;
- if (equalIgnoringCase(attribute.value(), "none"))
+ if (equalIgnoringCase(value, "none"))
m_rulesAttr = NoneRules;
- else if (equalIgnoringCase(attribute.value(), "groups"))
+ else if (equalIgnoringCase(value, "groups"))
m_rulesAttr = GroupsRules;
- else if (equalIgnoringCase(attribute.value(), "rows"))
+ else if (equalIgnoringCase(value, "rows"))
m_rulesAttr = RowsRules;
- if (equalIgnoringCase(attribute.value(), "cols"))
+ else if (equalIgnoringCase(value, "cols"))
m_rulesAttr = ColsRules;
- if (equalIgnoringCase(attribute.value(), "all"))
+ else if (equalIgnoringCase(value, "all"))
m_rulesAttr = AllRules;
- } else if (attribute.name() == cellpaddingAttr) {
- if (!attribute.value().isEmpty())
- m_padding = max(0, attribute.value().toInt());
+ } else if (name == cellpaddingAttr) {
+ if (!value.isEmpty())
+ m_padding = max(0, value.toInt());
else
m_padding = 1;
- } else if (attribute.name() == colsAttr) {
+ } else if (name == colsAttr) {
// ###
} else
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
if (bordersBefore != cellBorders() || oldPadding != m_padding) {
m_sharedCellStyle = 0;
diff --git a/Source/WebCore/html/HTMLTableElement.h b/Source/WebCore/html/HTMLTableElement.h
index 1719bd6..cb0f8ed 100644
--- a/Source/WebCore/html/HTMLTableElement.h
+++ b/Source/WebCore/html/HTMLTableElement.h
@@ -71,7 +71,7 @@
private:
HTMLTableElement(const QualifiedName&, Document*);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
diff --git a/Source/WebCore/html/HTMLTextAreaElement.cpp b/Source/WebCore/html/HTMLTextAreaElement.cpp
index 33c5fee..1632927 100644
--- a/Source/WebCore/html/HTMLTextAreaElement.cpp
+++ b/Source/WebCore/html/HTMLTextAreaElement.cpp
@@ -162,10 +162,10 @@
HTMLTextFormControlElement::collectStyleForPresentationAttribute(attribute, style);
}
-void HTMLTextAreaElement::parseAttribute(const Attribute& attribute)
+void HTMLTextAreaElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == rowsAttr) {
- int rows = attribute.value().toInt();
+ if (name == rowsAttr) {
+ int rows = value.toInt();
if (rows <= 0)
rows = defaultRows;
if (m_rows != rows) {
@@ -173,8 +173,8 @@
if (renderer())
renderer()->setNeedsLayoutAndPrefWidthsRecalc();
}
- } else if (attribute.name() == colsAttr) {
- int cols = attribute.value().toInt();
+ } else if (name == colsAttr) {
+ int cols = value.toInt();
if (cols <= 0)
cols = defaultCols;
if (m_cols != cols) {
@@ -182,13 +182,13 @@
if (renderer())
renderer()->setNeedsLayoutAndPrefWidthsRecalc();
}
- } else if (attribute.name() == wrapAttr) {
+ } else if (name == wrapAttr) {
// The virtual/physical values were a Netscape extension of HTML 3.0, now deprecated.
// The soft/hard /off values are a recommendation for HTML 4 extension by IE and NS 4.
WrapMethod wrap;
- if (equalIgnoringCase(attribute.value(), "physical") || equalIgnoringCase(attribute.value(), "hard") || equalIgnoringCase(attribute.value(), "on"))
+ if (equalIgnoringCase(value, "physical") || equalIgnoringCase(value, "hard") || equalIgnoringCase(value, "on"))
wrap = HardWrap;
- else if (equalIgnoringCase(attribute.value(), "off"))
+ else if (equalIgnoringCase(value, "off"))
wrap = NoWrap;
else
wrap = SoftWrap;
@@ -197,12 +197,12 @@
if (renderer())
renderer()->setNeedsLayoutAndPrefWidthsRecalc();
}
- } else if (attribute.name() == accesskeyAttr) {
+ } else if (name == accesskeyAttr) {
// ignore for the moment
- } else if (attribute.name() == maxlengthAttr)
+ } else if (name == maxlengthAttr)
setNeedsValidityCheck();
else
- HTMLTextFormControlElement::parseAttribute(attribute);
+ HTMLTextFormControlElement::parseAttribute(name, value);
}
RenderObject* HTMLTextAreaElement::createRenderer(RenderArena* arena, RenderStyle*)
diff --git a/Source/WebCore/html/HTMLTextAreaElement.h b/Source/WebCore/html/HTMLTextAreaElement.h
index 7f438f8..fcc19f8 100644
--- a/Source/WebCore/html/HTMLTextAreaElement.h
+++ b/Source/WebCore/html/HTMLTextAreaElement.h
@@ -97,7 +97,7 @@
virtual bool isTextFormControl() const { return true; }
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
diff --git a/Source/WebCore/html/HTMLTextFormControlElement.cpp b/Source/WebCore/html/HTMLTextFormControlElement.cpp
index a2f952a..0c925ba 100644
--- a/Source/WebCore/html/HTMLTextFormControlElement.cpp
+++ b/Source/WebCore/html/HTMLTextFormControlElement.cpp
@@ -503,16 +503,16 @@
}
}
-void HTMLTextFormControlElement::parseAttribute(const Attribute& attribute)
+void HTMLTextFormControlElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == placeholderAttr)
+ if (name == placeholderAttr)
updatePlaceholderVisibility(true);
- else if (attribute.name() == onselectAttr)
- setAttributeEventListener(eventNames().selectEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onchangeAttr)
- setAttributeEventListener(eventNames().changeEvent, createAttributeEventListener(this, attribute));
+ else if (name == onselectAttr)
+ setAttributeEventListener(eventNames().selectEvent, createAttributeEventListener(this, name, value));
+ else if (name == onchangeAttr)
+ setAttributeEventListener(eventNames().changeEvent, createAttributeEventListener(this, name, value));
else
- HTMLFormControlElementWithState::parseAttribute(attribute);
+ HTMLFormControlElementWithState::parseAttribute(name, value);
}
bool HTMLTextFormControlElement::lastChangeWasUserEdit() const
diff --git a/Source/WebCore/html/HTMLTextFormControlElement.h b/Source/WebCore/html/HTMLTextFormControlElement.h
index 1faf8fc..ed95228 100644
--- a/Source/WebCore/html/HTMLTextFormControlElement.h
+++ b/Source/WebCore/html/HTMLTextFormControlElement.h
@@ -94,7 +94,7 @@
bool isPlaceholderEmpty() const;
virtual void updatePlaceholderText() = 0;
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
void cacheSelection(int start, int end, TextFieldSelectionDirection direction)
{
diff --git a/Source/WebCore/html/HTMLTrackElement.cpp b/Source/WebCore/html/HTMLTrackElement.cpp
index 6c6c9e4..38451ad 100644
--- a/Source/WebCore/html/HTMLTrackElement.cpp
+++ b/Source/WebCore/html/HTMLTrackElement.cpp
@@ -95,28 +95,28 @@
HTMLElement::removedFrom(insertionPoint);
}
-void HTMLTrackElement::parseAttribute(const Attribute& attribute)
+void HTMLTrackElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (RuntimeEnabledFeatures::webkitVideoTrackEnabled()) {
- if (attribute.name() == srcAttr) {
- if (!attribute.isEmpty() && mediaElement())
+ if (name == srcAttr) {
+ if (!value.isEmpty() && mediaElement())
scheduleLoad();
// 4.8.10.12.3 Sourcing out-of-band text tracks
// As the kind, label, and srclang attributes are set, changed, or removed, the text track must update accordingly...
- } else if (attribute.name() == kindAttr)
- track()->setKind(attribute.value());
- else if (attribute.name() == labelAttr)
- track()->setLabel(attribute.value());
- else if (attribute.name() == srclangAttr)
- track()->setLanguage(attribute.value());
+ } else if (name == kindAttr)
+ track()->setKind(value);
+ else if (name == labelAttr)
+ track()->setLabel(value);
+ else if (name == srclangAttr)
+ track()->setLanguage(value);
}
- if (attribute.name() == onloadAttr)
- setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attribute));
- else if (attribute.name() == onerrorAttr)
- setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, attribute));
+ if (name == onloadAttr)
+ setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, name, value));
+ else if (name == onerrorAttr)
+ setAttributeEventListener(eventNames().errorEvent, createAttributeEventListener(this, name, value));
else
- HTMLElement::parseAttribute(attribute);
+ HTMLElement::parseAttribute(name, value);
}
KURL HTMLTrackElement::src() const
diff --git a/Source/WebCore/html/HTMLTrackElement.h b/Source/WebCore/html/HTMLTrackElement.h
index 34f779b..d7ebdfa 100644
--- a/Source/WebCore/html/HTMLTrackElement.h
+++ b/Source/WebCore/html/HTMLTrackElement.h
@@ -75,7 +75,7 @@
HTMLTrackElement(const QualifiedName&, Document*);
virtual ~HTMLTrackElement();
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
diff --git a/Source/WebCore/html/HTMLVideoElement.cpp b/Source/WebCore/html/HTMLVideoElement.cpp
index 2ac2ca5..31acb01 100644
--- a/Source/WebCore/html/HTMLVideoElement.cpp
+++ b/Source/WebCore/html/HTMLVideoElement.cpp
@@ -104,9 +104,9 @@
return HTMLMediaElement::isPresentationAttribute(name);
}
-void HTMLVideoElement::parseAttribute(const Attribute& attribute)
+void HTMLVideoElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == posterAttr) {
+ if (name == posterAttr) {
// Force a poster recalc by setting m_displayMode to Unknown directly before calling updateDisplayState.
HTMLMediaElement::setDisplayMode(Unknown);
updateDisplayState();
@@ -121,7 +121,7 @@
}
#endif
} else
- HTMLMediaElement::parseAttribute(attribute);
+ HTMLMediaElement::parseAttribute(name, value);
}
bool HTMLVideoElement::supportsFullscreen() const
diff --git a/Source/WebCore/html/HTMLVideoElement.h b/Source/WebCore/html/HTMLVideoElement.h
index 94fb4f7..f86d53b 100644
--- a/Source/WebCore/html/HTMLVideoElement.h
+++ b/Source/WebCore/html/HTMLVideoElement.h
@@ -75,7 +75,7 @@
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
#endif
virtual void attach();
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
virtual bool isVideo() const { return true; }
diff --git a/Source/WebCore/html/shadow/HTMLContentElement.cpp b/Source/WebCore/html/shadow/HTMLContentElement.cpp
index 3d963f9..a25d132 100644
--- a/Source/WebCore/html/shadow/HTMLContentElement.cpp
+++ b/Source/WebCore/html/shadow/HTMLContentElement.cpp
@@ -98,16 +98,16 @@
m_selectorList = CSSSelectorList();
}
-void HTMLContentElement::parseAttribute(const Attribute& attribute)
+void HTMLContentElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
- if (attribute.name() == selectAttr) {
+ if (name == selectAttr) {
if (ShadowRoot* root = shadowRoot()) {
root->owner()->setShouldCollectSelectFeatureSet();
root->owner()->invalidateDistribution();
}
m_shouldParseSelectorList = true;
} else
- InsertionPoint::parseAttribute(attribute);
+ InsertionPoint::parseAttribute(name, value);
}
Node::InsertionNotificationRequest HTMLContentElement::insertedInto(ContainerNode* insertionPoint)
diff --git a/Source/WebCore/html/shadow/HTMLContentElement.h b/Source/WebCore/html/shadow/HTMLContentElement.h
index ed0b088..557aab9 100644
--- a/Source/WebCore/html/shadow/HTMLContentElement.h
+++ b/Source/WebCore/html/shadow/HTMLContentElement.h
@@ -57,7 +57,7 @@
virtual void removedFrom(ContainerNode*) OVERRIDE;
private:
- virtual void parseAttribute(const Attribute&) OVERRIDE;
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
void ensureSelectParsed();
bool validateSelect() const;