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

Unified Diff: Source/core/svg/properties/SVGListPropertyTearOffHelper.h

Issue 1061263005: Throw NoModificationAllowed in SVG*List.removeItem(...) if immutable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Indentation. Created 5 years, 8 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 | « LayoutTests/svg/dom/svglist-immutable.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/properties/SVGListPropertyTearOffHelper.h
diff --git a/Source/core/svg/properties/SVGListPropertyTearOffHelper.h b/Source/core/svg/properties/SVGListPropertyTearOffHelper.h
index 68fbc99b3544545b7e7f1eabca3f6eb51bf10f97..08e46005a932fc9d9889d49543ebca9dc56f56df 100644
--- a/Source/core/svg/properties/SVGListPropertyTearOffHelper.h
+++ b/Source/core/svg/properties/SVGListPropertyTearOffHelper.h
@@ -162,6 +162,11 @@ public:
PassRefPtrWillBeRawPtr<ItemTearOffType> removeItem(unsigned long index, ExceptionState& exceptionState)
{
+ if (toDerived()->isImmutable()) {
+ exceptionState.throwDOMException(NoModificationAllowedError, "The object is read-only.");
+ return nullptr;
+ }
+
RefPtrWillBeRawPtr<ItemPropertyType> value = toDerived()->target()->removeItem(index, exceptionState);
toDerived()->commitChange();
« no previous file with comments | « LayoutTests/svg/dom/svglist-immutable.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698