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

Unified Diff: Source/core/svg/SVGRectTearOff.cpp

Issue 132233010: [SVG] SVGAnimatedRect migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebsaed Created 6 years, 11 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/core/svg/SVGRectTearOff.h ('k') | Source/core/svg/SVGSVGElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGRectTearOff.cpp
diff --git a/Source/modules/filesystem/DirectoryReaderSync.cpp b/Source/core/svg/SVGRectTearOff.cpp
similarity index 54%
copy from Source/modules/filesystem/DirectoryReaderSync.cpp
copy to Source/core/svg/SVGRectTearOff.cpp
index 5f83d945020165d9e959fcf362ebc5b01de316c0..64a2538c50c2656117137d6d704a5122264ff0b2 100644
--- a/Source/modules/filesystem/DirectoryReaderSync.cpp
+++ b/Source/core/svg/SVGRectTearOff.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2014 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -29,36 +29,62 @@
*/
#include "config.h"
-#include "modules/filesystem/DirectoryReaderSync.h"
+
+#include "core/svg/SVGRectTearOff.h"
#include "bindings/v8/ExceptionState.h"
#include "core/dom/ExceptionCode.h"
-#include "modules/filesystem/DirectoryEntry.h"
-#include "modules/filesystem/DirectoryEntrySync.h"
-#include "modules/filesystem/EntrySync.h"
-#include "modules/filesystem/FileEntrySync.h"
-#include "modules/filesystem/SyncCallbackHelper.h"
namespace WebCore {
-DirectoryReaderSync::DirectoryReaderSync(PassRefPtr<DOMFileSystemBase> fileSystem, const String& fullPath)
- : DirectoryReaderBase(fileSystem, fullPath)
+SVGRectTearOff::SVGRectTearOff(PassRefPtr<SVGRect> target, SVGElement* contextElement, PropertyIsAnimValType propertyIsAnimVal, const QualifiedName& attributeName)
+ : NewSVGPropertyTearOff<SVGRect>(target, contextElement, propertyIsAnimVal, attributeName)
{
ScriptWrappable::init(this);
}
-EntrySyncVector DirectoryReaderSync::readEntries(ExceptionState& exceptionState)
+void SVGRectTearOff::setX(float f, ExceptionState& exceptionState)
{
- if (!m_hasMoreEntries)
- return EntrySyncVector();
+ if (isImmutable()) {
+ exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
+ return;
+ }
- EntriesSyncCallbackHelper helper;
- if (!m_fileSystem->readDirectory(this, m_fullPath, helper.successCallback(), helper.errorCallback(), DOMFileSystemBase::Synchronous)) {
- exceptionState.throwDOMException(InvalidModificationError, "Failed to read the directory.");
- setHasMoreEntries(false);
- return EntrySyncVector();
+ target()->setX(f);
+ commitChange();
+}
+
+void SVGRectTearOff::setY(float f, ExceptionState& exceptionState)
+{
+ if (isImmutable()) {
+ exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
+ return;
}
- return helper.getResult(exceptionState);
+
+ target()->setY(f);
+ commitChange();
}
-} // namespace
+void SVGRectTearOff::setWidth(float f, ExceptionState& exceptionState)
+{
+ if (isImmutable()) {
+ exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
+ return;
+ }
+
+ target()->setWidth(f);
+ commitChange();
+}
+
+void SVGRectTearOff::setHeight(float f, ExceptionState& exceptionState)
+{
+ if (isImmutable()) {
+ exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
+ return;
+ }
+
+ target()->setHeight(f);
+ commitChange();
+}
+
+}
« no previous file with comments | « Source/core/svg/SVGRectTearOff.h ('k') | Source/core/svg/SVGSVGElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698