summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/HTMLImageElement.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-18 14:03:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-18 14:03:11 +0200
commit8d473cf9743f1d30a16a27114e93bd5af5648d23 (patch)
treecdca40d0353886b3ca52f33a2d7b8f1c0011aafc /Source/WebCore/html/HTMLImageElement.cpp
parent1b914638db989aaa98631a1c1e02c7b2d44805d8 (diff)
downloadqtwebkit-8d473cf9743f1d30a16a27114e93bd5af5648d23.tar.gz
Imported WebKit commit 1350e72f7345ced9da2bd9980deeeb5a8d62fab4 (http://svn.webkit.org/repository/webkit/trunk@117578)
Weekly snapshot
Diffstat (limited to 'Source/WebCore/html/HTMLImageElement.cpp')
-rw-r--r--Source/WebCore/html/HTMLImageElement.cpp63
1 files changed, 31 insertions, 32 deletions
diff --git a/Source/WebCore/html/HTMLImageElement.cpp b/Source/WebCore/html/HTMLImageElement.cpp
index 7bf618881..1510bb627 100644
--- a/Source/WebCore/html/HTMLImageElement.cpp
+++ b/Source/WebCore/html/HTMLImageElement.cpp
@@ -85,47 +85,46 @@ bool HTMLImageElement::isPresentationAttribute(const QualifiedName& name) const
return HTMLElement::isPresentationAttribute(name);
}
-void HTMLImageElement::collectStyleForAttribute(Attribute* attr, StylePropertySet* style)
-{
- if (attr->name() == widthAttr)
- addHTMLLengthToStyle(style, CSSPropertyWidth, attr->value());
- else if (attr->name() == heightAttr)
- addHTMLLengthToStyle(style, CSSPropertyHeight, attr->value());
- else if (attr->name() == borderAttr)
- applyBorderAttributeToStyle(attr, style);
- else if (attr->name() == vspaceAttr) {
- addHTMLLengthToStyle(style, CSSPropertyMarginTop, attr->value());
- addHTMLLengthToStyle(style, CSSPropertyMarginBottom, attr->value());
- } else if (attr->name() == hspaceAttr) {
- addHTMLLengthToStyle(style, CSSPropertyMarginLeft, attr->value());
- addHTMLLengthToStyle(style, CSSPropertyMarginRight, attr->value());
- } else if (attr->name() == alignAttr)
- applyAlignmentAttributeToStyle(attr, style);
- else if (attr->name() == valignAttr)
- addPropertyToAttributeStyle(style, CSSPropertyVerticalAlign, attr->value());
+void HTMLImageElement::collectStyleForAttribute(const Attribute& attribute, StylePropertySet* style)
+{
+ if (attribute.name() == widthAttr)
+ addHTMLLengthToStyle(style, CSSPropertyWidth, attribute.value());
+ else if (attribute.name() == heightAttr)
+ addHTMLLengthToStyle(style, CSSPropertyHeight, attribute.value());
+ else if (attribute.name() == borderAttr)
+ applyBorderAttributeToStyle(attribute, style);
+ else if (attribute.name() == vspaceAttr) {
+ addHTMLLengthToStyle(style, CSSPropertyMarginTop, attribute.value());
+ addHTMLLengthToStyle(style, CSSPropertyMarginBottom, attribute.value());
+ } else if (attribute.name() == hspaceAttr) {
+ addHTMLLengthToStyle(style, CSSPropertyMarginLeft, attribute.value());
+ addHTMLLengthToStyle(style, CSSPropertyMarginRight, attribute.value());
+ } else if (attribute.name() == alignAttr)
+ applyAlignmentAttributeToStyle(attribute, style);
+ else if (attribute.name() == valignAttr)
+ addPropertyToAttributeStyle(style, CSSPropertyVerticalAlign, attribute.value());
else
- HTMLElement::collectStyleForAttribute(attr, style);
+ HTMLElement::collectStyleForAttribute(attribute, style);
}
-void HTMLImageElement::parseAttribute(Attribute* attr)
+void HTMLImageElement::parseAttribute(const Attribute& attribute)
{
- const QualifiedName& attrName = attr->name();
- if (attrName == altAttr) {
+ if (attribute.name() == altAttr) {
if (renderer() && renderer()->isImage())
toRenderImage(renderer())->updateAltText();
- } else if (attrName == srcAttr)
+ } else if (attribute.name() == srcAttr)
m_imageLoader.updateFromElementIgnoringPreviousError();
- else if (attrName == usemapAttr)
- setIsLink(!attr->isNull());
- else if (attrName == onloadAttr)
- setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attr));
- else if (attrName == onbeforeloadAttr)
- setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attr));
- else if (attrName == compositeAttr) {
- if (!parseCompositeOperator(attr->value(), m_compositeOperator))
+ 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))
m_compositeOperator = CompositeSourceOver;
} else
- HTMLElement::parseAttribute(attr);
+ HTMLElement::parseAttribute(attribute);
}
String HTMLImageElement::altText() const