Backed out 2 changesets (bug 1539720) for causing caret related failures. CLOSED...
[gecko.git] / dom / smil / SMILNullType.h
blob83f69b2478367b3e9beaacc98f97e6411848b992
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 #ifndef DOM_SMIL_SMILNULLTYPE_H_
8 #define DOM_SMIL_SMILNULLTYPE_H_
10 #include "mozilla/Attributes.h"
11 #include "mozilla/SMILType.h"
13 namespace mozilla {
15 class SMILNullType : public SMILType {
16 public:
17 // Singleton for SMILValue objects to hold onto.
18 static SMILNullType* Singleton();
20 protected:
21 // SMILType Methods
22 // -------------------
23 void Init(SMILValue& aValue) const override {}
24 void Destroy(SMILValue& aValue) const override {}
25 nsresult Assign(SMILValue& aDest, const SMILValue& aSrc) const override;
27 // The remaining methods should never be called, so although they're very
28 // simple they don't need to be inline.
29 bool IsEqual(const SMILValue& aLeft, const SMILValue& aRight) const override;
30 nsresult Add(SMILValue& aDest, const SMILValue& aValueToAdd,
31 uint32_t aCount) const override;
32 nsresult ComputeDistance(const SMILValue& aFrom, const SMILValue& aTo,
33 double& aDistance) const override;
34 nsresult Interpolate(const SMILValue& aStartVal, const SMILValue& aEndVal,
35 double aUnitDistance, SMILValue& aResult) const override;
37 private:
38 // Private constructor: prevent instances beyond my singleton.
39 constexpr SMILNullType() = default;
42 } // namespace mozilla
44 #endif // DOM_SMIL_SMILNULLTYPE_H_