LCOV - code coverage report
Current view: top level - dom/svg - SVGSwitchElement.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 3 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 5 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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 mozilla_dom_SVGSwitchElement_h
       8             : #define mozilla_dom_SVGSwitchElement_h
       9             : 
      10             : #include "mozilla/dom/SVGGraphicsElement.h"
      11             : 
      12             : class nsSVGSwitchFrame;
      13             : 
      14             : nsresult NS_NewSVGSwitchElement(nsIContent **aResult,
      15             :                                 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
      16             : 
      17             : namespace mozilla {
      18             : namespace dom {
      19             : 
      20             : typedef SVGGraphicsElement SVGSwitchElementBase;
      21             : 
      22             : class SVGSwitchElement final : public SVGSwitchElementBase
      23             : {
      24             :   friend class ::nsSVGSwitchFrame;
      25             : protected:
      26             :   friend nsresult (::NS_NewSVGSwitchElement(nsIContent **aResult,
      27             :                                             already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
      28             :   explicit SVGSwitchElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
      29             :   ~SVGSwitchElement();
      30             :   virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
      31             : 
      32             : public:
      33           0 :   nsIContent * GetActiveChild() const
      34           0 :   { return mActiveChild; }
      35             :   void MaybeInvalidate();
      36             : 
      37             :   // interfaces:
      38             : 
      39             :   NS_DECL_ISUPPORTS_INHERITED
      40           0 :   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(SVGSwitchElement,
      41             :                                            SVGSwitchElementBase)
      42             :   // nsINode
      43             :   virtual nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex,
      44             :                                  bool aNotify) override;
      45             :   virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) override;
      46             : 
      47             :   // nsIContent
      48             :   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const override;
      49             : 
      50             :   virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
      51             :                          bool aPreallocateChildren) const override;
      52             : private:
      53             :   void UpdateActiveChild()
      54             :   { mActiveChild = FindActiveChild(); }
      55             :   nsIContent* FindActiveChild() const;
      56             : 
      57             :   // only this child will be displayed
      58             :   nsCOMPtr<nsIContent> mActiveChild;
      59             : };
      60             : 
      61             : } // namespace dom
      62             : } // namespace mozilla
      63             : 
      64             : #endif // mozilla_dom_SVGSwitchElement_h

Generated by: LCOV version 1.13