Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: Source/core/svg/properties/SVGPathSegListPropertyTearOff.cpp

Issue 19914002: Use toSVGPathElement() instead of static_cast<> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/svg/properties/SVGAnimatedPathSegListPropertyTearOff.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 SVGPathSegListPropertyTearOff::ListItemType removedItem = SVGPathSegListProp ertyTearOff::Base::removeItemValues(index, ec); 82 SVGPathSegListPropertyTearOff::ListItemType removedItem = SVGPathSegListProp ertyTearOff::Base::removeItemValues(index, ec);
83 if (removedItem) 83 if (removedItem)
84 static_cast<SVGPathSegWithContext*>(removedItem.get())->setContextAndRol e(0, PathSegUndefinedRole); 84 static_cast<SVGPathSegWithContext*>(removedItem.get())->setContextAndRol e(0, PathSegUndefinedRole);
85 return removedItem.release(); 85 return removedItem.release();
86 } 86 }
87 87
88 SVGPathElement* SVGPathSegListPropertyTearOff::contextElement() const 88 SVGPathElement* SVGPathSegListPropertyTearOff::contextElement() const
89 { 89 {
90 SVGElement* contextElement = m_animatedProperty->contextElement(); 90 SVGElement* contextElement = m_animatedProperty->contextElement();
91 ASSERT(contextElement); 91 ASSERT(contextElement);
92 ASSERT(contextElement->hasTagName(SVGNames::pathTag)); 92 return toSVGPathElement(contextElement);
93 return static_cast<SVGPathElement*>(contextElement);
94 } 93 }
95 94
96 bool SVGPathSegListPropertyTearOff::processIncomingListItemValue(const ListItemT ype& newItem, unsigned* indexToModify) 95 bool SVGPathSegListPropertyTearOff::processIncomingListItemValue(const ListItemT ype& newItem, unsigned* indexToModify)
97 { 96 {
98 SVGPathSegWithContext* newItemWithContext = static_cast<SVGPathSegWithContex t*>(newItem.get()); 97 SVGPathSegWithContext* newItemWithContext = static_cast<SVGPathSegWithContex t*>(newItem.get());
99 SVGAnimatedProperty* animatedPropertyOfItem = newItemWithContext->animatedPr operty(); 98 SVGAnimatedProperty* animatedPropertyOfItem = newItemWithContext->animatedPr operty();
100 99
101 // Alter the role, after calling animatedProperty(), as that may influence t he returned animated property. 100 // Alter the role, after calling animatedProperty(), as that may influence t he returned animated property.
102 newItemWithContext->setContextAndRole(contextElement(), m_pathSegRole); 101 newItemWithContext->setContextAndRole(contextElement(), m_pathSegRole);
103 102
(...skipping 26 matching lines...) Expand all
130 unsigned& index = *indexToModify; 129 unsigned& index = *indexToModify;
131 // Spec: If the item is already in this list, note that the index of the item to (replace|insert before) is before the removal of the item. 130 // Spec: If the item is already in this list, note that the index of the item to (replace|insert before) is before the removal of the item.
132 if (static_cast<unsigned>(indexToRemove) < index) 131 if (static_cast<unsigned>(indexToRemove) < index)
133 --index; 132 --index;
134 } 133 }
135 134
136 return true; 135 return true;
137 } 136 }
138 137
139 } 138 }
OLDNEW
« no previous file with comments | « Source/core/svg/properties/SVGAnimatedPathSegListPropertyTearOff.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698