| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 void clear(ExceptionCode&); | 69 void clear(ExceptionCode&); |
| 70 | 70 |
| 71 PassListItemType initialize(PassListItemType passNewItem, ExceptionCode& ec) | 71 PassListItemType initialize(PassListItemType passNewItem, ExceptionCode& ec) |
| 72 { | 72 { |
| 73 // Not specified, but FF/Opera do it this way, and it's just sane. | 73 // Not specified, but FF/Opera do it this way, and it's just sane. |
| 74 if (!passNewItem) { | 74 if (!passNewItem) { |
| 75 ec = SVGException::SVG_WRONG_TYPE_ERR; | 75 ec = SVGException::SVG_WRONG_TYPE_ERR; |
| 76 return 0; | 76 return 0; |
| 77 } | 77 } |
| 78 | 78 |
| 79 clearContextAndRoles(); |
| 79 ListItemType newItem = passNewItem; | 80 ListItemType newItem = passNewItem; |
| 80 return Base::initializeValues(newItem, ec); | 81 return Base::initializeValues(newItem, ec); |
| 81 } | 82 } |
| 82 | 83 |
| 83 PassListItemType getItem(unsigned index, ExceptionCode&); | 84 PassListItemType getItem(unsigned index, ExceptionCode&); |
| 84 | 85 |
| 85 PassListItemType insertItemBefore(PassListItemType passNewItem, unsigned ind
ex, ExceptionCode& ec) | 86 PassListItemType insertItemBefore(PassListItemType passNewItem, unsigned ind
ex, ExceptionCode& ec) |
| 86 { | 87 { |
| 87 // Not specified, but FF/Opera do it this way, and it's just sane. | 88 // Not specified, but FF/Opera do it this way, and it's just sane. |
| 88 if (!passNewItem) { | 89 if (!passNewItem) { |
| 89 ec = SVGException::SVG_WRONG_TYPE_ERR; | 90 ec = SVGException::SVG_WRONG_TYPE_ERR; |
| 90 return 0; | 91 return 0; |
| 91 } | 92 } |
| 92 | 93 |
| 93 ListItemType newItem = passNewItem; | 94 ListItemType newItem = passNewItem; |
| 94 return Base::insertItemBeforeValues(newItem, index, ec); | 95 return Base::insertItemBeforeValues(newItem, index, ec); |
| 95 } | 96 } |
| 96 | 97 |
| 97 PassListItemType replaceItem(PassListItemType passNewItem, unsigned index, E
xceptionCode& ec) | 98 PassListItemType replaceItem(PassListItemType, unsigned index, ExceptionCode
&); |
| 98 { | |
| 99 // Not specified, but FF/Opera do it this way, and it's just sane. | |
| 100 if (!passNewItem) { | |
| 101 ec = SVGException::SVG_WRONG_TYPE_ERR; | |
| 102 return 0; | |
| 103 } | |
| 104 | |
| 105 ListItemType newItem = passNewItem; | |
| 106 return Base::replaceItemValues(newItem, index, ec); | |
| 107 } | |
| 108 | 99 |
| 109 PassListItemType removeItem(unsigned index, ExceptionCode&); | 100 PassListItemType removeItem(unsigned index, ExceptionCode&); |
| 110 | 101 |
| 111 PassListItemType appendItem(PassListItemType passNewItem, ExceptionCode& ec) | 102 PassListItemType appendItem(PassListItemType passNewItem, ExceptionCode& ec) |
| 112 { | 103 { |
| 113 // Not specified, but FF/Opera do it this way, and it's just sane. | 104 // Not specified, but FF/Opera do it this way, and it's just sane. |
| 114 if (!passNewItem) { | 105 if (!passNewItem) { |
| 115 ec = SVGException::SVG_WRONG_TYPE_ERR; | 106 ec = SVGException::SVG_WRONG_TYPE_ERR; |
| 116 return 0; | 107 return 0; |
| 117 } | 108 } |
| 118 | 109 |
| 119 ListItemType newItem = passNewItem; | 110 ListItemType newItem = passNewItem; |
| 120 return Base::appendItemValues(newItem, ec); | 111 return Base::appendItemValues(newItem, ec); |
| 121 } | 112 } |
| 122 | 113 |
| 123 private: | 114 private: |
| 124 SVGPathSegListPropertyTearOff(AnimatedListPropertyTearOff* animatedProperty,
SVGPropertyRole role, SVGPathSegRole pathSegRole, SVGPathSegList& values, ListW
rapperCache& wrappers) | 115 SVGPathSegListPropertyTearOff(AnimatedListPropertyTearOff* animatedProperty,
SVGPropertyRole role, SVGPathSegRole pathSegRole, SVGPathSegList& values, ListW
rapperCache& wrappers) |
| 125 : SVGListProperty<SVGPathSegList>(role, values, &wrappers) | 116 : SVGListProperty<SVGPathSegList>(role, values, &wrappers) |
| 126 , m_animatedProperty(animatedProperty) | 117 , m_animatedProperty(animatedProperty) |
| 127 , m_pathSegRole(pathSegRole) | 118 , m_pathSegRole(pathSegRole) |
| 128 { | 119 { |
| 129 } | 120 } |
| 130 | 121 |
| 131 SVGPathElement* contextElement() const; | 122 SVGPathElement* contextElement() const; |
| 132 | 123 |
| 124 void clearContextAndRoles(); |
| 125 |
| 133 using Base::m_role; | 126 using Base::m_role; |
| 134 | 127 |
| 135 virtual bool isReadOnly() const | 128 virtual bool isReadOnly() const |
| 136 { | 129 { |
| 137 if (m_role == AnimValRole) | 130 if (m_role == AnimValRole) |
| 138 return true; | 131 return true; |
| 139 if (m_animatedProperty && m_animatedProperty->isReadOnly()) | 132 if (m_animatedProperty && m_animatedProperty->isReadOnly()) |
| 140 return true; | 133 return true; |
| 141 return false; | 134 return false; |
| 142 } | 135 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 162 | 155 |
| 163 private: | 156 private: |
| 164 RefPtr<AnimatedListPropertyTearOff> m_animatedProperty; | 157 RefPtr<AnimatedListPropertyTearOff> m_animatedProperty; |
| 165 SVGPathSegRole m_pathSegRole; | 158 SVGPathSegRole m_pathSegRole; |
| 166 }; | 159 }; |
| 167 | 160 |
| 168 } | 161 } |
| 169 | 162 |
| 170 #endif // ENABLE(SVG) | 163 #endif // ENABLE(SVG) |
| 171 #endif // SVGListPropertyTearOff_h | 164 #endif // SVGListPropertyTearOff_h |
| OLD | NEW |