| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 void clear(ExceptionCode&); | 68 void clear(ExceptionCode&); |
| 69 | 69 |
| 70 PassListItemType initialize(PassListItemType passNewItem, ExceptionCode& ec) | 70 PassListItemType initialize(PassListItemType passNewItem, ExceptionCode& ec) |
| 71 { | 71 { |
| 72 // Not specified, but FF/Opera do it this way, and it's just sane. | 72 // Not specified, but FF/Opera do it this way, and it's just sane. |
| 73 if (!passNewItem) { | 73 if (!passNewItem) { |
| 74 ec = SVGException::SVG_WRONG_TYPE_ERR; | 74 ec = SVGException::SVG_WRONG_TYPE_ERR; |
| 75 return 0; | 75 return 0; |
| 76 } | 76 } |
| 77 | 77 |
| 78 clearContextAndRoles(); |
| 78 ListItemType newItem = passNewItem; | 79 ListItemType newItem = passNewItem; |
| 79 return Base::initializeValues(newItem, ec); | 80 return Base::initializeValues(newItem, ec); |
| 80 } | 81 } |
| 81 | 82 |
| 82 PassListItemType getItem(unsigned index, ExceptionCode&); | 83 PassListItemType getItem(unsigned index, ExceptionCode&); |
| 83 | 84 |
| 84 PassListItemType insertItemBefore(PassListItemType passNewItem, unsigned ind
ex, ExceptionCode& ec) | 85 PassListItemType insertItemBefore(PassListItemType passNewItem, unsigned ind
ex, ExceptionCode& ec) |
| 85 { | 86 { |
| 86 // Not specified, but FF/Opera do it this way, and it's just sane. | 87 // Not specified, but FF/Opera do it this way, and it's just sane. |
| 87 if (!passNewItem) { | 88 if (!passNewItem) { |
| 88 ec = SVGException::SVG_WRONG_TYPE_ERR; | 89 ec = SVGException::SVG_WRONG_TYPE_ERR; |
| 89 return 0; | 90 return 0; |
| 90 } | 91 } |
| 91 | 92 |
| 92 ListItemType newItem = passNewItem; | 93 ListItemType newItem = passNewItem; |
| 93 return Base::insertItemBeforeValues(newItem, index, ec); | 94 return Base::insertItemBeforeValues(newItem, index, ec); |
| 94 } | 95 } |
| 95 | 96 |
| 96 PassListItemType replaceItem(PassListItemType passNewItem, unsigned index, E
xceptionCode& ec) | 97 PassListItemType replaceItem(PassListItemType, unsigned index, ExceptionCode
&); |
| 97 { | |
| 98 // Not specified, but FF/Opera do it this way, and it's just sane. | |
| 99 if (!passNewItem) { | |
| 100 ec = SVGException::SVG_WRONG_TYPE_ERR; | |
| 101 return 0; | |
| 102 } | |
| 103 | |
| 104 ListItemType newItem = passNewItem; | |
| 105 return Base::replaceItemValues(newItem, index, ec); | |
| 106 } | |
| 107 | 98 |
| 108 PassListItemType removeItem(unsigned index, ExceptionCode&); | 99 PassListItemType removeItem(unsigned index, ExceptionCode&); |
| 109 | 100 |
| 110 PassListItemType appendItem(PassListItemType passNewItem, ExceptionCode& ec) | 101 PassListItemType appendItem(PassListItemType passNewItem, ExceptionCode& ec) |
| 111 { | 102 { |
| 112 // Not specified, but FF/Opera do it this way, and it's just sane. | 103 // Not specified, but FF/Opera do it this way, and it's just sane. |
| 113 if (!passNewItem) { | 104 if (!passNewItem) { |
| 114 ec = SVGException::SVG_WRONG_TYPE_ERR; | 105 ec = SVGException::SVG_WRONG_TYPE_ERR; |
| 115 return 0; | 106 return 0; |
| 116 } | 107 } |
| 117 | 108 |
| 118 ListItemType newItem = passNewItem; | 109 ListItemType newItem = passNewItem; |
| 119 return Base::appendItemValues(newItem, ec); | 110 return Base::appendItemValues(newItem, ec); |
| 120 } | 111 } |
| 121 | 112 |
| 122 private: | 113 private: |
| 123 SVGPathSegListPropertyTearOff(AnimatedListPropertyTearOff* animatedProperty,
SVGPropertyRole role, SVGPathSegRole pathSegRole, SVGPathSegList& values, ListW
rapperCache& wrappers) | 114 SVGPathSegListPropertyTearOff(AnimatedListPropertyTearOff* animatedProperty,
SVGPropertyRole role, SVGPathSegRole pathSegRole, SVGPathSegList& values, ListW
rapperCache& wrappers) |
| 124 : SVGListProperty<SVGPathSegList>(role, values, &wrappers) | 115 : SVGListProperty<SVGPathSegList>(role, values, &wrappers) |
| 125 , m_animatedProperty(animatedProperty) | 116 , m_animatedProperty(animatedProperty) |
| 126 , m_pathSegRole(pathSegRole) | 117 , m_pathSegRole(pathSegRole) |
| 127 { | 118 { |
| 128 } | 119 } |
| 129 | 120 |
| 130 SVGPathElement* contextElement() const; | 121 SVGPathElement* contextElement() const; |
| 131 | 122 |
| 123 void clearContextAndRoles(); |
| 124 |
| 132 using Base::m_role; | 125 using Base::m_role; |
| 133 | 126 |
| 134 virtual bool isReadOnly() const | 127 virtual bool isReadOnly() const |
| 135 { | 128 { |
| 136 if (m_role == AnimValRole) | 129 if (m_role == AnimValRole) |
| 137 return true; | 130 return true; |
| 138 if (m_animatedProperty && m_animatedProperty->isReadOnly()) | 131 if (m_animatedProperty && m_animatedProperty->isReadOnly()) |
| 139 return true; | 132 return true; |
| 140 return false; | 133 return false; |
| 141 } | 134 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 161 | 154 |
| 162 private: | 155 private: |
| 163 RefPtr<AnimatedListPropertyTearOff> m_animatedProperty; | 156 RefPtr<AnimatedListPropertyTearOff> m_animatedProperty; |
| 164 SVGPathSegRole m_pathSegRole; | 157 SVGPathSegRole m_pathSegRole; |
| 165 }; | 158 }; |
| 166 | 159 |
| 167 } | 160 } |
| 168 | 161 |
| 169 #endif // ENABLE(SVG) | 162 #endif // ENABLE(SVG) |
| 170 #endif // SVGListPropertyTearOff_h | 163 #endif // SVGListPropertyTearOff_h |
| OLD | NEW |