tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

CSSNumericValue.h (2635B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
      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/. */
      6 
      7 #ifndef LAYOUT_STYLE_TYPEDOM_CSSNUMERICVALUE_H_
      8 #define LAYOUT_STYLE_TYPEDOM_CSSNUMERICVALUE_H_
      9 
     10 #include "js/TypeDecls.h"
     11 #include "mozilla/dom/CSSMathSumBindingFwd.h"
     12 #include "mozilla/dom/CSSNumericValueBindingFwd.h"
     13 #include "mozilla/dom/CSSStyleValue.h"
     14 #include "mozilla/dom/CSSUnitValueBindingFwd.h"
     15 #include "nsStringFwd.h"
     16 
     17 template <class T>
     18 struct already_AddRefed;
     19 template <class T>
     20 class nsCOMPtr;
     21 class nsISupports;
     22 
     23 namespace mozilla {
     24 
     25 class ErrorResult;
     26 
     27 namespace dom {
     28 
     29 class GlobalObject;
     30 template <typename T>
     31 class Sequence;
     32 
     33 class CSSNumericValue : public CSSStyleValue {
     34 public:
     35  explicit CSSNumericValue(nsCOMPtr<nsISupports> aParent);
     36 
     37  CSSNumericValue(nsCOMPtr<nsISupports> aParent, ValueType aValueType);
     38 
     39  JSObject* WrapObject(JSContext* aCx,
     40                       JS::Handle<JSObject*> aGivenProto) override;
     41 
     42  // start of CSSNumbericValue Web IDL declarations
     43 
     44  already_AddRefed<CSSNumericValue> Add(
     45      const Sequence<OwningCSSNumberish>& aValues, ErrorResult& aRv);
     46 
     47  already_AddRefed<CSSNumericValue> Sub(
     48      const Sequence<OwningCSSNumberish>& aValues, ErrorResult& aRv);
     49 
     50  already_AddRefed<CSSNumericValue> Mul(
     51      const Sequence<OwningCSSNumberish>& aValues, ErrorResult& aRv);
     52 
     53  already_AddRefed<CSSNumericValue> Div(
     54      const Sequence<OwningCSSNumberish>& aValues, ErrorResult& aRv);
     55 
     56  already_AddRefed<CSSNumericValue> Min(
     57      const Sequence<OwningCSSNumberish>& aValues, ErrorResult& aRv);
     58 
     59  already_AddRefed<CSSNumericValue> Max(
     60      const Sequence<OwningCSSNumberish>& aValues, ErrorResult& aRv);
     61 
     62  bool Equals(const Sequence<OwningCSSNumberish>& aValue);
     63 
     64  already_AddRefed<CSSUnitValue> To(const nsACString& aUnit, ErrorResult& aRv);
     65 
     66  already_AddRefed<CSSMathSum> ToSum(const Sequence<nsCString>& aUnits,
     67                                     ErrorResult& aRv);
     68 
     69  void Type(CSSNumericType& aRetVal);
     70 
     71  static already_AddRefed<CSSNumericValue> Parse(const GlobalObject& aGlobal,
     72                                                 const nsACString& aCssText,
     73                                                 ErrorResult& aRv);
     74 
     75  // end of CSSNumbericValue Web IDL declarations
     76 
     77 protected:
     78  virtual ~CSSNumericValue() = default;
     79 };
     80 
     81 }  // namespace dom
     82 }  // namespace mozilla
     83 
     84 #endif  // LAYOUT_STYLE_TYPEDOM_CSSNUMERICVALUE_H_