dom/smil/nsSMILNullType.cpp

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #include "nsSMILNullType.h"
     7 #include "nsSMILValue.h"
     8 #include "nsDebug.h"
    10 nsresult
    11 nsSMILNullType::Assign(nsSMILValue& aDest, const nsSMILValue& aSrc) const
    12 {
    13   NS_PRECONDITION(aDest.mType == aSrc.mType, "Incompatible SMIL types");
    14   NS_PRECONDITION(aSrc.mType == this, "Unexpected source type");
    15   aDest.mU    = aSrc.mU;
    16   aDest.mType = Singleton();
    17   return NS_OK;
    18 }
    20 bool
    21 nsSMILNullType::IsEqual(const nsSMILValue& aLeft,
    22                         const nsSMILValue& aRight) const
    23 {
    24   NS_PRECONDITION(aLeft.mType == aRight.mType, "Incompatible SMIL types");
    25   NS_PRECONDITION(aLeft.mType == this, "Unexpected type for SMIL value");
    27   return true;  // All null-typed values are equivalent.
    28 }
    30 nsresult
    31 nsSMILNullType::Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
    32                     uint32_t aCount) const
    33 {
    34   NS_NOTREACHED("Adding NULL type");
    35   return NS_ERROR_FAILURE;
    36 }
    38 nsresult
    39 nsSMILNullType::ComputeDistance(const nsSMILValue& aFrom,
    40                                 const nsSMILValue& aTo,
    41                                 double& aDistance) const
    42 {
    43   NS_NOTREACHED("Computing distance for NULL type");
    44   return NS_ERROR_FAILURE;
    45 }
    47 nsresult
    48 nsSMILNullType::Interpolate(const nsSMILValue& aStartVal,
    49                             const nsSMILValue& aEndVal,
    50                             double aUnitDistance,
    51                             nsSMILValue& aResult) const
    52 {
    53   NS_NOTREACHED("Interpolating NULL type");
    54   return NS_ERROR_FAILURE;
    55 }

mercurial