| 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, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2008 Apple Inc. All rights reserved. | 4 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
| 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> | 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> |
| 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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 const AtomicString& eventName = HTMLElement::eventNameForAttributeName(n
ame); | 595 const AtomicString& eventName = HTMLElement::eventNameForAttributeName(n
ame); |
| 596 if (!eventName.isNull()) | 596 if (!eventName.isNull()) |
| 597 setAttributeEventListener(eventName, createAttributeEventListener(th
is, name, value, eventParameterName())); | 597 setAttributeEventListener(eventName, createAttributeEventListener(th
is, name, value, eventParameterName())); |
| 598 else | 598 else |
| 599 Element::parseAttribute(name, value); | 599 Element::parseAttribute(name, value); |
| 600 } | 600 } |
| 601 } | 601 } |
| 602 | 602 |
| 603 void SVGElement::parseAttributeNew(const QualifiedName& name, const AtomicString
& value) | 603 void SVGElement::parseAttributeNew(const QualifiedName& name, const AtomicString
& value) |
| 604 { | 604 { |
| 605 RefPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute(name); | 605 RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute
(name); |
| 606 if (property) { | 606 if (property) { |
| 607 SVGParsingError parseError = NoError; | 607 SVGParsingError parseError = NoError; |
| 608 property->setBaseValueAsString(value, parseError); | 608 property->setBaseValueAsString(value, parseError); |
| 609 reportAttributeParsingError(parseError, name, value); | 609 reportAttributeParsingError(parseError, name, value); |
| 610 | 610 |
| 611 return; | 611 return; |
| 612 } | 612 } |
| 613 | 613 |
| 614 SVGElement::parseAttribute(name, value); | 614 SVGElement::parseAttribute(name, value); |
| 615 } | 615 } |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 for (size_t i = 0; i < WTF_ARRAY_LENGTH(attrToTypes); i++) | 683 for (size_t i = 0; i < WTF_ARRAY_LENGTH(attrToTypes); i++) |
| 684 cssPropertyMap.set(attrToTypes[i].attr, attrToTypes[i].propType); | 684 cssPropertyMap.set(attrToTypes[i].attr, attrToTypes[i].propType); |
| 685 } | 685 } |
| 686 | 686 |
| 687 if (cssPropertyMap.contains(attributeName)) | 687 if (cssPropertyMap.contains(attributeName)) |
| 688 return cssPropertyMap.get(attributeName); | 688 return cssPropertyMap.get(attributeName); |
| 689 | 689 |
| 690 return AnimatedUnknown; | 690 return AnimatedUnknown; |
| 691 } | 691 } |
| 692 | 692 |
| 693 void SVGElement::addToPropertyMap(PassRefPtr<SVGAnimatedPropertyBase> passProper
ty) | 693 void SVGElement::addToPropertyMap(PassRefPtrWillBeRawPtr<SVGAnimatedPropertyBase
> passProperty) |
| 694 { | 694 { |
| 695 RefPtr<SVGAnimatedPropertyBase> property(passProperty); | 695 RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property(passProperty); |
| 696 QualifiedName attributeName = property->attributeName(); | 696 QualifiedName attributeName = property->attributeName(); |
| 697 m_attributeToPropertyMap.set(attributeName, property.release()); | 697 m_attributeToPropertyMap.set(attributeName, property.release()); |
| 698 } | 698 } |
| 699 | 699 |
| 700 PassRefPtr<SVGAnimatedPropertyBase> SVGElement::propertyFromAttribute(const Qual
ifiedName& attributeName) | 700 PassRefPtrWillBeRawPtr<SVGAnimatedPropertyBase> SVGElement::propertyFromAttribut
e(const QualifiedName& attributeName) |
| 701 { | 701 { |
| 702 AttributeToPropertyMap::iterator it = m_attributeToPropertyMap.find<SVGAttri
buteHashTranslator>(attributeName); | 702 AttributeToPropertyMap::iterator it = m_attributeToPropertyMap.find<SVGAttri
buteHashTranslator>(attributeName); |
| 703 if (it == m_attributeToPropertyMap.end()) | 703 if (it == m_attributeToPropertyMap.end()) |
| 704 return nullptr; | 704 return nullptr; |
| 705 | 705 |
| 706 return it->value; | 706 return it->value; |
| 707 } | 707 } |
| 708 | 708 |
| 709 bool SVGElement::isAnimatableCSSProperty(const QualifiedName& attrName) | 709 bool SVGElement::isAnimatableCSSProperty(const QualifiedName& attrName) |
| 710 { | 710 { |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 if (name == anyQName()) { | 895 if (name == anyQName()) { |
| 896 AttributeToPropertyMap::const_iterator::Values it = m_attributeToPropert
yMap.values().begin(); | 896 AttributeToPropertyMap::const_iterator::Values it = m_attributeToPropert
yMap.values().begin(); |
| 897 AttributeToPropertyMap::const_iterator::Values end = m_attributeToProper
tyMap.values().end(); | 897 AttributeToPropertyMap::const_iterator::Values end = m_attributeToProper
tyMap.values().end(); |
| 898 for (; it != end; ++it) { | 898 for (; it != end; ++it) { |
| 899 if ((*it)->needsSynchronizeAttribute()) | 899 if ((*it)->needsSynchronizeAttribute()) |
| 900 (*it)->synchronizeAttribute(); | 900 (*it)->synchronizeAttribute(); |
| 901 } | 901 } |
| 902 | 902 |
| 903 elementData()->m_animatedSVGAttributesAreDirty = false; | 903 elementData()->m_animatedSVGAttributesAreDirty = false; |
| 904 } else { | 904 } else { |
| 905 RefPtr<SVGAnimatedPropertyBase> property = m_attributeToPropertyMap.get(
name); | 905 RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property = m_attributeToProp
ertyMap.get(name); |
| 906 if (property && property->needsSynchronizeAttribute()) | 906 if (property && property->needsSynchronizeAttribute()) |
| 907 property->synchronizeAttribute(); | 907 property->synchronizeAttribute(); |
| 908 } | 908 } |
| 909 } | 909 } |
| 910 | 910 |
| 911 PassRefPtr<RenderStyle> SVGElement::customStyleForRenderer() | 911 PassRefPtr<RenderStyle> SVGElement::customStyleForRenderer() |
| 912 { | 912 { |
| 913 if (!correspondingElement()) | 913 if (!correspondingElement()) |
| 914 return document().ensureStyleResolver().styleForElement(this); | 914 return document().ensureStyleResolver().styleForElement(this); |
| 915 | 915 |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1179 ASSERT(targetElement->hasSVGRareData()); | 1179 ASSERT(targetElement->hasSVGRareData()); |
| 1180 targetElement->ensureSVGRareData()->incomingReferences().remove(this); | 1180 targetElement->ensureSVGRareData()->incomingReferences().remove(this); |
| 1181 } | 1181 } |
| 1182 outgoingReferences.clear(); | 1182 outgoingReferences.clear(); |
| 1183 } | 1183 } |
| 1184 | 1184 |
| 1185 void SVGElement::trace(Visitor* visitor) | 1185 void SVGElement::trace(Visitor* visitor) |
| 1186 { | 1186 { |
| 1187 #if ENABLE(OILPAN) | 1187 #if ENABLE(OILPAN) |
| 1188 visitor->trace(m_elementsWithRelativeLengths); | 1188 visitor->trace(m_elementsWithRelativeLengths); |
| 1189 visitor->trace(m_attributeToPropertyMap); |
| 1189 visitor->trace(m_SVGRareData); | 1190 visitor->trace(m_SVGRareData); |
| 1191 visitor->trace(m_className); |
| 1190 #endif | 1192 #endif |
| 1191 Element::trace(visitor); | 1193 Element::trace(visitor); |
| 1192 } | 1194 } |
| 1193 | 1195 |
| 1194 const AtomicString& SVGElement::eventParameterName() | 1196 const AtomicString& SVGElement::eventParameterName() |
| 1195 { | 1197 { |
| 1196 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt", AtomicString::Con
structFromLiteral)); | 1198 DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt", AtomicString::Con
structFromLiteral)); |
| 1197 return evtString; | 1199 return evtString; |
| 1198 } | 1200 } |
| 1199 | 1201 |
| 1200 } // namespace blink | 1202 } // namespace blink |
| OLD | NEW |