2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04: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-15 07:38:07 +03:00
|
|
|
|
|
|
|
#include "nsSMILNullType.h"
|
|
|
|
#include "nsSMILValue.h"
|
|
|
|
#include "nsDebug.h"
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsSMILNullType::Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const
|
|
|
|
{
|
2010-01-28 12:50:30 +03:00
|
|
|
NS_PRECONDITION(aDest.mType == aSrc.mType, "Incompatible SMIL types");
|
2009-01-15 07:38:07 +03:00
|
|
|
NS_PRECONDITION(aSrc.mType == this, "Unexpected source type");
|
|
|
|
aDest.mU = aSrc.mU;
|
2013-05-31 02:34:53 +04:00
|
|
|
aDest.mType = Singleton();
|
2009-01-15 07:38:07 +03:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool
|
2010-02-21 00:13:11 +03: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 18:59:28 +04:00
|
|
|
return true; // All null-typed values are equivalent.
|
2010-02-21 00:13:11 +03:00
|
|
|
}
|
|
|
|
|
2009-01-15 07:38:07 +03:00
|
|
|
nsresult
|
|
|
|
nsSMILNullType::Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t aCount) const
|
2009-01-15 07:38:07 +03:00
|
|
|
{
|
2010-01-28 12:50:30 +03:00
|
|
|
NS_NOTREACHED("Adding NULL type");
|
2009-01-15 07:38:07 +03:00
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsSMILNullType::ComputeDistance(const nsSMILValue& aFrom,
|
|
|
|
const nsSMILValue& aTo,
|
|
|
|
double& aDistance) const
|
|
|
|
{
|
2010-01-28 12:50:30 +03:00
|
|
|
NS_NOTREACHED("Computing distance for NULL type");
|
2009-01-15 07:38:07 +03:00
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsSMILNullType::Interpolate(const nsSMILValue& aStartVal,
|
|
|
|
const nsSMILValue& aEndVal,
|
|
|
|
double aUnitDistance,
|
|
|
|
nsSMILValue& aResult) const
|
|
|
|
{
|
2010-01-28 12:50:30 +03:00
|
|
|
NS_NOTREACHED("Interpolating NULL type");
|
2009-01-15 07:38:07 +03:00
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|