| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 #include "platform/transforms/AffineTransform.h" | 58 #include "platform/transforms/AffineTransform.h" |
| 59 #include "wtf/StdLibExtras.h" | 59 #include "wtf/StdLibExtras.h" |
| 60 | 60 |
| 61 namespace WebCore { | 61 namespace WebCore { |
| 62 | 62 |
| 63 // Animated property definitions | 63 // Animated property definitions |
| 64 DEFINE_ANIMATED_LENGTH(SVGSVGElement, SVGNames::xAttr, X, x) | 64 DEFINE_ANIMATED_LENGTH(SVGSVGElement, SVGNames::xAttr, X, x) |
| 65 DEFINE_ANIMATED_LENGTH(SVGSVGElement, SVGNames::yAttr, Y, y) | 65 DEFINE_ANIMATED_LENGTH(SVGSVGElement, SVGNames::yAttr, Y, y) |
| 66 DEFINE_ANIMATED_LENGTH(SVGSVGElement, SVGNames::widthAttr, Width, width) | 66 DEFINE_ANIMATED_LENGTH(SVGSVGElement, SVGNames::widthAttr, Width, width) |
| 67 DEFINE_ANIMATED_LENGTH(SVGSVGElement, SVGNames::heightAttr, Height, height) | 67 DEFINE_ANIMATED_LENGTH(SVGSVGElement, SVGNames::heightAttr, Height, height) |
| 68 DEFINE_ANIMATED_BOOLEAN(SVGSVGElement, SVGNames::externalResourcesRequiredAttr,
ExternalResourcesRequired, externalResourcesRequired) | |
| 69 DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGSVGElement, SVGNames::preserveAspectRatio
Attr, PreserveAspectRatio, preserveAspectRatio) | 68 DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGSVGElement, SVGNames::preserveAspectRatio
Attr, PreserveAspectRatio, preserveAspectRatio) |
| 70 DEFINE_ANIMATED_RECT(SVGSVGElement, SVGNames::viewBoxAttr, ViewBox, viewBox) | 69 DEFINE_ANIMATED_RECT(SVGSVGElement, SVGNames::viewBoxAttr, ViewBox, viewBox) |
| 71 | 70 |
| 72 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGSVGElement) | 71 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGSVGElement) |
| 73 REGISTER_LOCAL_ANIMATED_PROPERTY(x) | 72 REGISTER_LOCAL_ANIMATED_PROPERTY(x) |
| 74 REGISTER_LOCAL_ANIMATED_PROPERTY(y) | 73 REGISTER_LOCAL_ANIMATED_PROPERTY(y) |
| 75 REGISTER_LOCAL_ANIMATED_PROPERTY(width) | 74 REGISTER_LOCAL_ANIMATED_PROPERTY(width) |
| 76 REGISTER_LOCAL_ANIMATED_PROPERTY(height) | 75 REGISTER_LOCAL_ANIMATED_PROPERTY(height) |
| 77 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | |
| 78 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox) | 76 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox) |
| 79 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) | 77 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) |
| 80 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) | 78 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) |
| 81 END_REGISTER_ANIMATED_PROPERTIES | 79 END_REGISTER_ANIMATED_PROPERTIES |
| 82 | 80 |
| 83 inline SVGSVGElement::SVGSVGElement(Document& doc) | 81 inline SVGSVGElement::SVGSVGElement(Document& doc) |
| 84 : SVGGraphicsElement(SVGNames::svgTag, doc) | 82 : SVGGraphicsElement(SVGNames::svgTag, doc) |
| 85 , m_x(LengthModeWidth) | 83 , m_x(LengthModeWidth) |
| 86 , m_y(LengthModeHeight) | 84 , m_y(LengthModeHeight) |
| 87 , m_width(LengthModeWidth, "100%") | 85 , m_width(LengthModeWidth, "100%") |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 else if (name == HTMLNames::onerrorAttr) | 247 else if (name == HTMLNames::onerrorAttr) |
| 250 document().setWindowAttributeEventListener(EventTypeNames::error, create
AttributeEventListener(document().frame(), name, value)); | 248 document().setWindowAttributeEventListener(EventTypeNames::error, create
AttributeEventListener(document().frame(), name, value)); |
| 251 else if (name == SVGNames::xAttr) | 249 else if (name == SVGNames::xAttr) |
| 252 setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError)); | 250 setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError)); |
| 253 else if (name == SVGNames::yAttr) | 251 else if (name == SVGNames::yAttr) |
| 254 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError))
; | 252 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError))
; |
| 255 else if (name == SVGNames::widthAttr) | 253 else if (name == SVGNames::widthAttr) |
| 256 setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseErro
r, ForbidNegativeLengths)); | 254 setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseErro
r, ForbidNegativeLengths)); |
| 257 else if (name == SVGNames::heightAttr) | 255 else if (name == SVGNames::heightAttr) |
| 258 setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseEr
ror, ForbidNegativeLengths)); | 256 setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseEr
ror, ForbidNegativeLengths)); |
| 259 else if (SVGExternalResourcesRequired::parseAttribute(name, value) | 257 else if (SVGFitToViewBox::parseAttribute(this, name, value) |
| 260 || SVGFitToViewBox::parseAttribute(this, name, value) | 258 || SVGZoomAndPan::parseAttribute(this, name, value)) { |
| 261 || SVGZoomAndPan::parseAttribute(this, name, value)) { | |
| 262 } else | 259 } else |
| 263 SVGGraphicsElement::parseAttribute(name, value); | 260 SVGGraphicsElement::parseAttribute(name, value); |
| 264 | 261 |
| 265 reportAttributeParsingError(parseError, name, value); | 262 reportAttributeParsingError(parseError, name, value); |
| 266 } | 263 } |
| 267 | 264 |
| 268 void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName) | 265 void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName) |
| 269 { | 266 { |
| 270 bool updateRelativeLengthsOrViewBox = false; | 267 bool updateRelativeLengthsOrViewBox = false; |
| 271 bool widthChanged = attrName == SVGNames::widthAttr; | 268 bool widthChanged = attrName == SVGNames::widthAttr; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 288 | 285 |
| 289 if (SVGFitToViewBox::isKnownAttribute(attrName)) { | 286 if (SVGFitToViewBox::isKnownAttribute(attrName)) { |
| 290 updateRelativeLengthsOrViewBox = true; | 287 updateRelativeLengthsOrViewBox = true; |
| 291 if (RenderObject* object = renderer()) | 288 if (RenderObject* object = renderer()) |
| 292 object->setNeedsTransformUpdate(); | 289 object->setNeedsTransformUpdate(); |
| 293 } | 290 } |
| 294 | 291 |
| 295 SVGElementInstance::InvalidationGuard invalidationGuard(this); | 292 SVGElementInstance::InvalidationGuard invalidationGuard(this); |
| 296 | 293 |
| 297 if (updateRelativeLengthsOrViewBox | 294 if (updateRelativeLengthsOrViewBox |
| 298 || SVGExternalResourcesRequired::isKnownAttribute(attrName) | |
| 299 || SVGZoomAndPan::isKnownAttribute(attrName)) { | 295 || SVGZoomAndPan::isKnownAttribute(attrName)) { |
| 300 if (renderer()) | 296 if (renderer()) |
| 301 RenderSVGResource::markForLayoutAndParentResourceInvalidation(render
er()); | 297 RenderSVGResource::markForLayoutAndParentResourceInvalidation(render
er()); |
| 302 return; | 298 return; |
| 303 } | 299 } |
| 304 | 300 |
| 305 SVGGraphicsElement::svgAttributeChanged(attrName); | 301 SVGGraphicsElement::svgAttributeChanged(attrName); |
| 306 } | 302 } |
| 307 | 303 |
| 308 unsigned SVGSVGElement::suspendRedraw(unsigned /* maxWaitMilliseconds */) | 304 unsigned SVGSVGElement::suspendRedraw(unsigned /* maxWaitMilliseconds */) |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 continue; | 766 continue; |
| 771 | 767 |
| 772 Element* element = toElement(node); | 768 Element* element = toElement(node); |
| 773 if (element->getIdAttribute() == id) | 769 if (element->getIdAttribute() == id) |
| 774 return element; | 770 return element; |
| 775 } | 771 } |
| 776 return 0; | 772 return 0; |
| 777 } | 773 } |
| 778 | 774 |
| 779 } | 775 } |
| OLD | NEW |