| 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();
|
| +}
|
| +
|
| +}
|
|
|