LCOV - code coverage report
Current view: top level - dom/base - Comment.h (source / functions) Hit Total Coverage
Test: output.info Lines: 11 16 68.8 %
Date: 2017-07-14 16:53:18 Functions: 3 32 9.4 %
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_Comment_h
       8             : #define mozilla_dom_Comment_h
       9             : 
      10             : #include "mozilla/Attributes.h"
      11             : #include "nsIDOMComment.h"
      12             : #include "nsGenericDOMDataNode.h"
      13             : 
      14             : namespace mozilla {
      15             : namespace dom {
      16             : 
      17             : class Comment final : public nsGenericDOMDataNode,
      18             :                       public nsIDOMComment
      19             : {
      20             : private:
      21          43 :   void Init()
      22             :   {
      23          43 :     MOZ_ASSERT(mNodeInfo->NodeType() == nsIDOMNode::COMMENT_NODE,
      24             :                "Bad NodeType in aNodeInfo");
      25          43 :   }
      26             : 
      27             :   virtual ~Comment();
      28             : 
      29             : public:
      30           7 :   explicit Comment(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
      31           7 :     : nsGenericDOMDataNode(aNodeInfo)
      32             :   {
      33           7 :     Init();
      34           7 :   }
      35             : 
      36          36 :   explicit Comment(nsNodeInfoManager* aNodeInfoManager)
      37          36 :     : nsGenericDOMDataNode(aNodeInfoManager->GetCommentNodeInfo())
      38             :   {
      39          36 :     Init();
      40          36 :   }
      41             : 
      42             :   // nsISupports
      43             :   NS_DECL_ISUPPORTS_INHERITED
      44             : 
      45             :   // nsIDOMNode
      46           0 :   NS_FORWARD_NSIDOMNODE_TO_NSINODE
      47             : 
      48             :   // nsIDOMCharacterData
      49           0 :   NS_FORWARD_NSIDOMCHARACTERDATA(nsGenericDOMDataNode::)
      50             :   using nsGenericDOMDataNode::SetData; // Prevent hiding overloaded virtual function.
      51             : 
      52             :   // nsIDOMComment
      53             :   // Empty interface
      54             : 
      55             :   // nsINode
      56             :   virtual bool IsNodeOfType(uint32_t aFlags) const override;
      57             : 
      58             :   virtual nsGenericDOMDataNode* CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
      59             :                                               bool aCloneText) const override;
      60             : 
      61           0 :   virtual nsIDOMNode* AsDOMNode() override { return this; }
      62             : #ifdef DEBUG
      63             :   virtual void List(FILE* out, int32_t aIndent) const override;
      64           0 :   virtual void DumpContent(FILE* out = stdout, int32_t aIndent = 0,
      65             :                            bool aDumpAll = true) const override
      66             :   {
      67           0 :     return;
      68             :   }
      69             : #endif
      70             : 
      71             :   static already_AddRefed<Comment>
      72             :   Constructor(const GlobalObject& aGlobal, const nsAString& aData,
      73             :               ErrorResult& aRv);
      74             : 
      75             : protected:
      76             :   virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
      77             : };
      78             : 
      79             : } // namespace dom
      80             : } // namespace mozilla
      81             : 
      82             : #endif // mozilla_dom_Comment_h

Generated by: LCOV version 1.13