summaryrefslogtreecommitdiff
path: root/Source/WebCore/svg/SVGImageElement.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-09-13 12:51:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 20:50:05 +0200
commitd441d6f39bb846989d95bcf5caf387b42414718d (patch)
treee367e64a75991c554930278175d403c072de6bb8 /Source/WebCore/svg/SVGImageElement.cpp
parent0060b2994c07842f4c59de64b5e3e430525c4b90 (diff)
downloadqtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit. Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/svg/SVGImageElement.cpp')
-rw-r--r--Source/WebCore/svg/SVGImageElement.cpp50
1 files changed, 22 insertions, 28 deletions
diff --git a/Source/WebCore/svg/SVGImageElement.cpp b/Source/WebCore/svg/SVGImageElement.cpp
index 0072e698d..27e7274b4 100644
--- a/Source/WebCore/svg/SVGImageElement.cpp
+++ b/Source/WebCore/svg/SVGImageElement.cpp
@@ -53,19 +53,18 @@ BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGImageElement)
REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio)
REGISTER_LOCAL_ANIMATED_PROPERTY(href)
REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledTransformableElement)
- REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
+ REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement)
END_REGISTER_ANIMATED_PROPERTIES
inline SVGImageElement::SVGImageElement(const QualifiedName& tagName, Document* document)
- : SVGStyledTransformableElement(tagName, document)
+ : SVGGraphicsElement(tagName, document)
, m_x(LengthModeWidth)
, m_y(LengthModeHeight)
, m_width(LengthModeWidth)
, m_height(LengthModeHeight)
, m_imageLoader(this)
{
- ASSERT(hasTagName(SVGNames::imageTag));
+ ASSERT(isSVGImageElement(this));
registerAnimatedPropertiesForSVGImageElement();
}
@@ -78,7 +77,6 @@ bool SVGImageElement::isSupportedAttribute(const QualifiedName& attrName)
{
DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
if (supportedAttributes.isEmpty()) {
- SVGTests::addSupportedAttributes(supportedAttributes);
SVGLangSpace::addSupportedAttributes(supportedAttributes);
SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
SVGURIReference::addSupportedAttributes(supportedAttributes);
@@ -88,24 +86,24 @@ bool SVGImageElement::isSupportedAttribute(const QualifiedName& attrName)
supportedAttributes.add(SVGNames::heightAttr);
supportedAttributes.add(SVGNames::preserveAspectRatioAttr);
}
- return supportedAttributes.contains<QualifiedName, SVGAttributeHashTranslator>(attrName);
+ return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
}
bool SVGImageElement::isPresentationAttribute(const QualifiedName& name) const
{
if (name == SVGNames::widthAttr || name == SVGNames::heightAttr)
return true;
- return SVGStyledTransformableElement::isPresentationAttribute(name);
+ return SVGGraphicsElement::isPresentationAttribute(name);
}
-void SVGImageElement::collectStyleForPresentationAttribute(const Attribute& attribute, StylePropertySet* style)
+void SVGImageElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
{
- if (!isSupportedAttribute(attribute.name()))
- SVGStyledTransformableElement::collectStyleForPresentationAttribute(attribute, style);
- else if (attribute.name() == SVGNames::widthAttr)
- addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, attribute.value());
- else if (attribute.name() == SVGNames::heightAttr)
- addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, attribute.value());
+ if (!isSupportedAttribute(name))
+ SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, style);
+ else if (name == SVGNames::widthAttr)
+ addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, value);
+ else if (name == SVGNames::heightAttr)
+ addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, value);
}
void SVGImageElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -113,7 +111,7 @@ void SVGImageElement::parseAttribute(const QualifiedName& name, const AtomicStri
SVGParsingError parseError = NoError;
if (!isSupportedAttribute(name))
- SVGStyledTransformableElement::parseAttribute(name, value);
+ SVGGraphicsElement::parseAttribute(name, value);
else if (name == SVGNames::xAttr)
setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError));
else if (name == SVGNames::yAttr)
@@ -126,8 +124,7 @@ void SVGImageElement::parseAttribute(const QualifiedName& name, const AtomicStri
setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths));
else if (name == SVGNames::heightAttr)
setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths));
- else if (SVGTests::parseAttribute(name, value)
- || SVGLangSpace::parseAttribute(name, value)
+ else if (SVGLangSpace::parseAttribute(name, value)
|| SVGExternalResourcesRequired::parseAttribute(name, value)
|| SVGURIReference::parseAttribute(name, value)) {
} else
@@ -139,7 +136,7 @@ void SVGImageElement::parseAttribute(const QualifiedName& name, const AtomicStri
void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName)
{
if (!isSupportedAttribute(attrName)) {
- SVGStyledTransformableElement::svgAttributeChanged(attrName);
+ SVGGraphicsElement::svgAttributeChanged(attrName);
return;
}
@@ -153,9 +150,6 @@ void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName)
if (isLengthAttribute)
updateRelativeLengthsInformation();
- if (SVGTests::handleAttributeChange(this, attrName))
- return;
-
if (SVGURIReference::isKnownAttribute(attrName)) {
m_imageLoader.updateFromElementIgnoringPreviousError();
return;
@@ -199,9 +193,9 @@ bool SVGImageElement::haveLoadedRequiredResources()
return !externalResourcesRequiredBaseValue() || !m_imageLoader.hasPendingActivity();
}
-void SVGImageElement::attach()
+void SVGImageElement::attach(const AttachContext& context)
{
- SVGStyledTransformableElement::attach();
+ SVGGraphicsElement::attach(context);
if (RenderSVGImage* imageObj = toRenderSVGImage(renderer())) {
if (imageObj->imageResource()->hasImage())
@@ -213,7 +207,7 @@ void SVGImageElement::attach()
Node::InsertionNotificationRequest SVGImageElement::insertedInto(ContainerNode* rootParent)
{
- SVGStyledTransformableElement::insertedInto(rootParent);
+ SVGGraphicsElement::insertedInto(rootParent);
if (!rootParent->inDocument())
return InsertionDone;
// Update image loader, as soon as we're living in the tree.
@@ -222,14 +216,14 @@ Node::InsertionNotificationRequest SVGImageElement::insertedInto(ContainerNode*
return InsertionDone;
}
-const QualifiedName& SVGImageElement::imageSourceAttributeName() const
+const AtomicString& SVGImageElement::imageSourceURL() const
{
- return XLinkNames::hrefAttr;
+ return getAttribute(XLinkNames::hrefAttr);
}
void SVGImageElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
{
- SVGStyledTransformableElement::addSubresourceAttributeURLs(urls);
+ SVGGraphicsElement::addSubresourceAttributeURLs(urls);
addSubresourceURL(urls, document()->completeURL(href()));
}
@@ -237,7 +231,7 @@ void SVGImageElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
void SVGImageElement::didMoveToNewDocument(Document* oldDocument)
{
m_imageLoader.elementDidMoveToNewDocument();
- SVGStyledTransformableElement::didMoveToNewDocument(oldDocument);
+ SVGGraphicsElement::didMoveToNewDocument(oldDocument);
}
}