tor-browser

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

DOMSVGAnimatedLength.h (1362B)


      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/. */
      6 
      7 #ifndef DOM_SVG_DOMSVGANIMATEDLENGTH_H_
      8 #define DOM_SVG_DOMSVGANIMATEDLENGTH_H_
      9 
     10 #include "SVGElement.h"
     11 
     12 namespace mozilla {
     13 
     14 class SVGAnimatedLength;
     15 
     16 namespace dom {
     17 
     18 class DOMSVGLength;
     19 
     20 class DOMSVGAnimatedLength final : public nsWrapperCache {
     21 public:
     22  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMSVGAnimatedLength)
     23  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMSVGAnimatedLength)
     24 
     25  DOMSVGAnimatedLength(SVGAnimatedLength* aVal, SVGElement* aSVGElement)
     26      : mVal(aVal), mSVGElement(aSVGElement) {}
     27 
     28  // WebIDL
     29  SVGElement* GetParentObject() { return mSVGElement; }
     30  JSObject* WrapObject(JSContext* aCx,
     31                       JS::Handle<JSObject*> aGivenProto) override;
     32  already_AddRefed<DOMSVGLength> BaseVal();
     33  already_AddRefed<DOMSVGLength> AnimVal();
     34 
     35 protected:
     36  ~DOMSVGAnimatedLength();
     37 
     38  SVGAnimatedLength* mVal;  // kept alive because it belongs to content
     39  RefPtr<SVGElement> mSVGElement;
     40 };
     41 
     42 }  // namespace dom
     43 }  // namespace mozilla
     44 
     45 #endif  // DOM_SVG_DOMSVGANIMATEDLENGTH_H_