michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsSMILNullType.h" michael@0: #include "nsSMILValue.h" michael@0: #include "nsDebug.h" michael@0: michael@0: nsresult michael@0: nsSMILNullType::Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const michael@0: { michael@0: NS_PRECONDITION(aDest.mType == aSrc.mType, "Incompatible SMIL types"); michael@0: NS_PRECONDITION(aSrc.mType == this, "Unexpected source type"); michael@0: aDest.mU = aSrc.mU; michael@0: aDest.mType = Singleton(); michael@0: return NS_OK; michael@0: } michael@0: michael@0: bool michael@0: nsSMILNullType::IsEqual(const nsSMILValue& aLeft, michael@0: const nsSMILValue& aRight) const michael@0: { michael@0: NS_PRECONDITION(aLeft.mType == aRight.mType, "Incompatible SMIL types"); michael@0: NS_PRECONDITION(aLeft.mType == this, "Unexpected type for SMIL value"); michael@0: michael@0: return true; // All null-typed values are equivalent. michael@0: } michael@0: michael@0: nsresult michael@0: nsSMILNullType::Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd, michael@0: uint32_t aCount) const michael@0: { michael@0: NS_NOTREACHED("Adding NULL type"); michael@0: return NS_ERROR_FAILURE; michael@0: } michael@0: michael@0: nsresult michael@0: nsSMILNullType::ComputeDistance(const nsSMILValue& aFrom, michael@0: const nsSMILValue& aTo, michael@0: double& aDistance) const michael@0: { michael@0: NS_NOTREACHED("Computing distance for NULL type"); michael@0: return NS_ERROR_FAILURE; michael@0: } michael@0: michael@0: nsresult michael@0: nsSMILNullType::Interpolate(const nsSMILValue& aStartVal, michael@0: const nsSMILValue& aEndVal, michael@0: double aUnitDistance, michael@0: nsSMILValue& aResult) const michael@0: { michael@0: NS_NOTREACHED("Interpolating NULL type"); michael@0: return NS_ERROR_FAILURE; michael@0: }