1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "SMILNullType.h"
9 #include "mozilla/SMILValue.h"
15 SMILNullType
* SMILNullType::Singleton() {
16 static SMILNullType sSingleton
;
20 nsresult
SMILNullType::Assign(SMILValue
& aDest
, const SMILValue
& aSrc
) const {
21 MOZ_ASSERT(aDest
.mType
== aSrc
.mType
, "Incompatible SMIL types");
22 MOZ_ASSERT(aSrc
.mType
== this, "Unexpected source type");
24 aDest
.mType
= Singleton();
28 bool SMILNullType::IsEqual(const SMILValue
& aLeft
,
29 const SMILValue
& aRight
) const {
30 MOZ_ASSERT(aLeft
.mType
== aRight
.mType
, "Incompatible SMIL types");
31 MOZ_ASSERT(aLeft
.mType
== this, "Unexpected type for SMIL value");
33 return true; // All null-typed values are equivalent.
36 nsresult
SMILNullType::Add(SMILValue
& aDest
, const SMILValue
& aValueToAdd
,
37 uint32_t aCount
) const {
38 MOZ_ASSERT_UNREACHABLE("Adding NULL type");
39 return NS_ERROR_FAILURE
;
42 nsresult
SMILNullType::ComputeDistance(const SMILValue
& aFrom
,
44 double& aDistance
) const {
45 MOZ_ASSERT_UNREACHABLE("Computing distance for NULL type");
46 return NS_ERROR_FAILURE
;
49 nsresult
SMILNullType::Interpolate(const SMILValue
& aStartVal
,
50 const SMILValue
& aEndVal
,
52 SMILValue
& aResult
) const {
53 MOZ_ASSERT_UNREACHABLE("Interpolating NULL type");
54 return NS_ERROR_FAILURE
;
57 } // namespace mozilla