2009-01-14 20:38:07 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2009-01-14 20:38:07 -08:00
|
|
|
|
|
|
|
#include "nsSMILNullType.h"
|
|
|
|
#include "nsSMILValue.h"
|
|
|
|
#include "nsDebug.h"
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsSMILNullType::Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const
|
|
|
|
{
|
2010-01-28 01:50:30 -08:00
|
|
|
NS_PRECONDITION(aDest.mType == aSrc.mType, "Incompatible SMIL types");
|
2009-01-14 20:38:07 -08:00
|
|
|
NS_PRECONDITION(aSrc.mType == this, "Unexpected source type");
|
|
|
|
aDest.mU = aSrc.mU;
|
2013-05-30 15:34:53 -07:00
|
|
|
aDest.mType = Singleton();
|
2009-01-14 20:38:07 -08:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool
|
2010-02-20 13:13:11 -08:00
|
|
|
nsSMILNullType::IsEqual(const nsSMILValue& aLeft,
|
|
|
|
const nsSMILValue& aRight) const
|
|
|
|
{
|
|
|
|
NS_PRECONDITION(aLeft.mType == aRight.mType, "Incompatible SMIL types");
|
|
|
|
NS_PRECONDITION(aLeft.mType == this, "Unexpected type for SMIL value");
|
|
|
|
|
2011-10-17 07:59:28 -07:00
|
|
|
return true; // All null-typed values are equivalent.
|
2010-02-20 13:13:11 -08:00
|
|
|
}
|
|
|
|
|
2009-01-14 20:38:07 -08:00
|
|
|
nsresult
|
|
|
|
nsSMILNullType::Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t aCount) const
|
2009-01-14 20:38:07 -08:00
|
|
|
{
|
2010-01-28 01:50:30 -08:00
|
|
|
NS_NOTREACHED("Adding NULL type");
|
2009-01-14 20:38:07 -08:00
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsSMILNullType::ComputeDistance(const nsSMILValue& aFrom,
|
|
|
|
const nsSMILValue& aTo,
|
|
|
|
double& aDistance) const
|
|
|
|
{
|
2010-01-28 01:50:30 -08:00
|
|
|
NS_NOTREACHED("Computing distance for NULL type");
|
2009-01-14 20:38:07 -08:00
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsSMILNullType::Interpolate(const nsSMILValue& aStartVal,
|
|
|
|
const nsSMILValue& aEndVal,
|
|
|
|
double aUnitDistance,
|
|
|
|
nsSMILValue& aResult) const
|
|
|
|
{
|
2010-01-28 01:50:30 -08:00
|
|
|
NS_NOTREACHED("Interpolating NULL type");
|
2009-01-14 20:38:07 -08:00
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|