Bug 1887774 pass a track to EnsureAudioProcessing() r=pehrsons
[gecko.git] / dom / smil / SMILNullType.cpp
blob571f6f3afe25e22478fbead8a8f6e5a45da2dfc6
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"
10 #include "nsDebug.h"
12 namespace mozilla {
14 /*static*/
15 SMILNullType* SMILNullType::Singleton() {
16 static SMILNullType sSingleton;
17 return &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");
23 aDest.mU = aSrc.mU;
24 aDest.mType = Singleton();
25 return NS_OK;
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,
43 const SMILValue& aTo,
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,
51 double aUnitDistance,
52 SMILValue& aResult) const {
53 MOZ_ASSERT_UNREACHABLE("Interpolating NULL type");
54 return NS_ERROR_FAILURE;
57 } // namespace mozilla