| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 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) 2005 Alexander Kellett <lypanov@kde.org> | 4 * Copyright (C) 2005 Alexander Kellett <lypanov@kde.org> |
| 5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
| 6 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 REGISTER_LOCAL_ANIMATED_PROPERTY(maskContentUnits) | 46 REGISTER_LOCAL_ANIMATED_PROPERTY(maskContentUnits) |
| 47 REGISTER_LOCAL_ANIMATED_PROPERTY(x) | 47 REGISTER_LOCAL_ANIMATED_PROPERTY(x) |
| 48 REGISTER_LOCAL_ANIMATED_PROPERTY(y) | 48 REGISTER_LOCAL_ANIMATED_PROPERTY(y) |
| 49 REGISTER_LOCAL_ANIMATED_PROPERTY(width) | 49 REGISTER_LOCAL_ANIMATED_PROPERTY(width) |
| 50 REGISTER_LOCAL_ANIMATED_PROPERTY(height) | 50 REGISTER_LOCAL_ANIMATED_PROPERTY(height) |
| 51 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | 51 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) |
| 52 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) | 52 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) |
| 53 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) | 53 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) |
| 54 END_REGISTER_ANIMATED_PROPERTIES | 54 END_REGISTER_ANIMATED_PROPERTIES |
| 55 | 55 |
| 56 inline SVGMaskElement::SVGMaskElement(const QualifiedName& tagName, Document* do
cument) | 56 inline SVGMaskElement::SVGMaskElement(const QualifiedName& tagName, Document& do
cument) |
| 57 : SVGElement(tagName, document) | 57 : SVGElement(tagName, document) |
| 58 , m_maskUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) | 58 , m_maskUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) |
| 59 , m_maskContentUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) | 59 , m_maskContentUnits(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) |
| 60 , m_x(LengthModeWidth, "-10%") | 60 , m_x(LengthModeWidth, "-10%") |
| 61 , m_y(LengthModeHeight, "-10%") | 61 , m_y(LengthModeHeight, "-10%") |
| 62 , m_width(LengthModeWidth, "120%") | 62 , m_width(LengthModeWidth, "120%") |
| 63 , m_height(LengthModeHeight, "120%") | 63 , m_height(LengthModeHeight, "120%") |
| 64 { | 64 { |
| 65 // Spec: If the x/y attribute is not specified, the effect is as if a value
of "-10%" were specified. | 65 // Spec: If the x/y attribute is not specified, the effect is as if a value
of "-10%" were specified. |
| 66 // Spec: If the width/height attribute is not specified, the effect is as if
a value of "120%" were specified. | 66 // Spec: If the width/height attribute is not specified, the effect is as if
a value of "120%" were specified. |
| 67 ASSERT(hasTagName(SVGNames::maskTag)); | 67 ASSERT(hasTagName(SVGNames::maskTag)); |
| 68 ScriptWrappable::init(this); | 68 ScriptWrappable::init(this); |
| 69 registerAnimatedPropertiesForSVGMaskElement(); | 69 registerAnimatedPropertiesForSVGMaskElement(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 PassRefPtr<SVGMaskElement> SVGMaskElement::create(const QualifiedName& tagName,
Document* document) | 72 PassRefPtr<SVGMaskElement> SVGMaskElement::create(const QualifiedName& tagName,
Document& document) |
| 73 { | 73 { |
| 74 return adoptRef(new SVGMaskElement(tagName, document)); | 74 return adoptRef(new SVGMaskElement(tagName, document)); |
| 75 } | 75 } |
| 76 | 76 |
| 77 bool SVGMaskElement::isSupportedAttribute(const QualifiedName& attrName) | 77 bool SVGMaskElement::isSupportedAttribute(const QualifiedName& attrName) |
| 78 { | 78 { |
| 79 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 79 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
| 80 if (supportedAttributes.isEmpty()) { | 80 if (supportedAttributes.isEmpty()) { |
| 81 SVGTests::addSupportedAttributes(supportedAttributes); | 81 SVGTests::addSupportedAttributes(supportedAttributes); |
| 82 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); | 82 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 bool SVGMaskElement::selfHasRelativeLengths() const | 160 bool SVGMaskElement::selfHasRelativeLengths() const |
| 161 { | 161 { |
| 162 return xCurrentValue().isRelative() | 162 return xCurrentValue().isRelative() |
| 163 || yCurrentValue().isRelative() | 163 || yCurrentValue().isRelative() |
| 164 || widthCurrentValue().isRelative() | 164 || widthCurrentValue().isRelative() |
| 165 || heightCurrentValue().isRelative(); | 165 || heightCurrentValue().isRelative(); |
| 166 } | 166 } |
| 167 | 167 |
| 168 } | 168 } |
| OLD | NEW |