| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> |
| 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
| 5 * Copyright (C) 2011 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 5 * Copyright (C) 2011 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
| 6 * Copyright (C) 2012 University of Szeged | 6 * Copyright (C) 2012 University of Szeged |
| 7 * Copyright (C) 2012 Renata Hodovan <reni@webkit.org> | 7 * Copyright (C) 2012 Renata Hodovan <reni@webkit.org> |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName) | 185 void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName) |
| 186 { | 186 { |
| 187 if (!isSupportedAttribute(attrName)) { | 187 if (!isSupportedAttribute(attrName)) { |
| 188 SVGGraphicsElement::svgAttributeChanged(attrName); | 188 SVGGraphicsElement::svgAttributeChanged(attrName); |
| 189 return; | 189 return; |
| 190 } | 190 } |
| 191 | 191 |
| 192 SVGElement::InvalidationGuard invalidationGuard(this); | 192 SVGElement::InvalidationGuard invalidationGuard(this); |
| 193 | 193 |
| 194 RenderObject* renderer = this->renderer(); | 194 LayoutObject* renderer = this->renderer(); |
| 195 if (attrName == SVGNames::xAttr | 195 if (attrName == SVGNames::xAttr |
| 196 || attrName == SVGNames::yAttr | 196 || attrName == SVGNames::yAttr |
| 197 || attrName == SVGNames::widthAttr | 197 || attrName == SVGNames::widthAttr |
| 198 || attrName == SVGNames::heightAttr) { | 198 || attrName == SVGNames::heightAttr) { |
| 199 updateRelativeLengthsInformation(); | 199 updateRelativeLengthsInformation(); |
| 200 if (m_targetElementInstance) { | 200 if (m_targetElementInstance) { |
| 201 ASSERT(m_targetElementInstance->correspondingElement()); | 201 ASSERT(m_targetElementInstance->correspondingElement()); |
| 202 transferUseWidthAndHeightIfNeeded(*this, m_targetElementInstance.get
(), *m_targetElementInstance->correspondingElement()); | 202 transferUseWidthAndHeightIfNeeded(*this, m_targetElementInstance.get
(), *m_targetElementInstance->correspondingElement()); |
| 203 } | 203 } |
| 204 if (renderer) | 204 if (renderer) |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 | 405 |
| 406 m_targetElementInstance = toSVGElement(shadowTreeRootElement->firstChild()); | 406 m_targetElementInstance = toSVGElement(shadowTreeRootElement->firstChild()); |
| 407 transferUseWidthAndHeightIfNeeded(*this, m_targetElementInstance.get(), *m_t
argetElementInstance->correspondingElement()); | 407 transferUseWidthAndHeightIfNeeded(*this, m_targetElementInstance.get(), *m_t
argetElementInstance->correspondingElement()); |
| 408 | 408 |
| 409 ASSERT(m_targetElementInstance->parentNode() == shadowTreeRootElement); | 409 ASSERT(m_targetElementInstance->parentNode() == shadowTreeRootElement); |
| 410 | 410 |
| 411 // Update relative length information. | 411 // Update relative length information. |
| 412 updateRelativeLengthsInformation(); | 412 updateRelativeLengthsInformation(); |
| 413 } | 413 } |
| 414 | 414 |
| 415 RenderObject* SVGUseElement::createRenderer(const RenderStyle&) | 415 LayoutObject* SVGUseElement::createRenderer(const RenderStyle&) |
| 416 { | 416 { |
| 417 return new RenderSVGTransformableContainer(this); | 417 return new RenderSVGTransformableContainer(this); |
| 418 } | 418 } |
| 419 | 419 |
| 420 static bool isDirectReference(const SVGElement& element) | 420 static bool isDirectReference(const SVGElement& element) |
| 421 { | 421 { |
| 422 return isSVGPathElement(element) | 422 return isSVGPathElement(element) |
| 423 || isSVGRectElement(element) | 423 || isSVGRectElement(element) |
| 424 || isSVGCircleElement(element) | 424 || isSVGCircleElement(element) |
| 425 || isSVGEllipseElement(element) | 425 || isSVGEllipseElement(element) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 444 } else { | 444 } else { |
| 445 toSVGGraphicsElement(element).toClipPath(path); | 445 toSVGGraphicsElement(element).toClipPath(path); |
| 446 // FIXME: Avoid manual resolution of x/y here. Its potentially harmf
ul. | 446 // FIXME: Avoid manual resolution of x/y here. Its potentially harmf
ul. |
| 447 SVGLengthContext lengthContext(this); | 447 SVGLengthContext lengthContext(this); |
| 448 path.translate(FloatSize(m_x->currentValue()->value(lengthContext),
m_y->currentValue()->value(lengthContext))); | 448 path.translate(FloatSize(m_x->currentValue()->value(lengthContext),
m_y->currentValue()->value(lengthContext))); |
| 449 path.transform(calculateAnimatedLocalTransform()); | 449 path.transform(calculateAnimatedLocalTransform()); |
| 450 } | 450 } |
| 451 } | 451 } |
| 452 } | 452 } |
| 453 | 453 |
| 454 RenderObject* SVGUseElement::rendererClipChild() const | 454 LayoutObject* SVGUseElement::rendererClipChild() const |
| 455 { | 455 { |
| 456 if (Node* n = userAgentShadowRoot()->firstChild()) { | 456 if (Node* n = userAgentShadowRoot()->firstChild()) { |
| 457 if (n->isSVGElement() && isDirectReference(toSVGElement(*n))) | 457 if (n->isSVGElement() && isDirectReference(toSVGElement(*n))) |
| 458 return n->renderer(); | 458 return n->renderer(); |
| 459 } | 459 } |
| 460 | 460 |
| 461 return 0; | 461 return 0; |
| 462 } | 462 } |
| 463 | 463 |
| 464 bool SVGUseElement::buildShadowTree(SVGElement* target, SVGElement* targetInstan
ce, bool foundUse) | 464 bool SVGUseElement::buildShadowTree(SVGElement* target, SVGElement* targetInstan
ce, bool foundUse) |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 | 755 |
| 756 if (m_resource) | 756 if (m_resource) |
| 757 m_resource->removeClient(this); | 757 m_resource->removeClient(this); |
| 758 | 758 |
| 759 m_resource = resource; | 759 m_resource = resource; |
| 760 if (m_resource) | 760 if (m_resource) |
| 761 m_resource->addClient(this); | 761 m_resource->addClient(this); |
| 762 } | 762 } |
| 763 | 763 |
| 764 } | 764 } |
| OLD | NEW |