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

Unified Diff: Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.cpp

Issue 12334104: Merge 143454 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.cpp
===================================================================
--- Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.cpp (revision 144107)
+++ Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.cpp (working copy)
@@ -29,18 +29,23 @@
namespace WebCore {
-void SVGPathSegListPropertyTearOff::clear(ExceptionCode& ec)
+void SVGPathSegListPropertyTearOff::clearContextAndRoles()
{
ASSERT(m_values);
- if (m_values->isEmpty())
- return;
-
unsigned size = m_values->size();
for (unsigned i = 0; i < size; ++i) {
ListItemType item = m_values->at(i);
static_cast<SVGPathSegWithContext*>(item.get())->setContextAndRole(0, PathSegUndefinedRole);
}
+}
+void SVGPathSegListPropertyTearOff::clear(ExceptionCode& ec)
+{
+ ASSERT(m_values);
+ if (m_values->isEmpty())
+ return;
+
+ clearContextAndRoles();
SVGPathSegListPropertyTearOff::Base::clearValues(ec);
}
@@ -54,6 +59,24 @@
return returnedItem.release();
}
+SVGPathSegListPropertyTearOff::PassListItemType SVGPathSegListPropertyTearOff::replaceItem(PassListItemType passNewItem, unsigned index, ExceptionCode& ec)
+{
+ // Not specified, but FF/Opera do it this way, and it's just sane.
+ if (!passNewItem) {
+ ec = SVGException::SVG_WRONG_TYPE_ERR;
+ return 0;
+ }
+
+ if (index < m_values->size()) {
+ ListItemType replacedItem = m_values->at(index);
+ ASSERT(replacedItem);
+ static_cast<SVGPathSegWithContext*>(replacedItem.get())->setContextAndRole(0, PathSegUndefinedRole);
+ }
+
+ ListItemType newItem = passNewItem;
+ return Base::replaceItemValues(newItem, index, ec);
+}
+
SVGPathSegListPropertyTearOff::PassListItemType SVGPathSegListPropertyTearOff::removeItem(unsigned index, ExceptionCode& ec)
{
SVGPathSegListPropertyTearOff::ListItemType removedItem = SVGPathSegListPropertyTearOff::Base::removeItemValues(index, ec);
« no previous file with comments | « Source/WebCore/svg/properties/SVGPathSegListPropertyTearOff.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698