LCOV - code coverage report
Current view: top level - dom/base - Attr.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 6 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 30 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             : /*
       8             :  * Implementation of DOM Core's nsIDOMAttr node.
       9             :  */
      10             : 
      11             : #ifndef mozilla_dom_Attr_h
      12             : #define mozilla_dom_Attr_h
      13             : 
      14             : #include "mozilla/Attributes.h"
      15             : #include "nsIAttribute.h"
      16             : #include "nsIDOMAttr.h"
      17             : #include "nsIDOMText.h"
      18             : #include "nsIDOMNodeList.h"
      19             : #include "nsString.h"
      20             : #include "nsCOMPtr.h"
      21             : #include "nsCycleCollectionParticipant.h"
      22             : #include "nsStubMutationObserver.h"
      23             : 
      24             : class nsIDocument;
      25             : 
      26             : namespace mozilla {
      27             : class EventChainPreVisitor;
      28             : namespace dom {
      29             : 
      30             : // Attribute helper class used to wrap up an attribute with a dom
      31             : // object that implements nsIDOMAttr and nsIDOMNode
      32             : class Attr final : public nsIAttribute,
      33             :                    public nsIDOMAttr
      34             : {
      35           0 :   virtual ~Attr() {}
      36             : 
      37             : public:
      38             :   Attr(nsDOMAttributeMap* aAttrMap,
      39             :        already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
      40             :        const nsAString& aValue);
      41             : 
      42             :   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
      43             : 
      44             :   // nsIDOMNode interface
      45           0 :   NS_FORWARD_NSIDOMNODE_TO_NSINODE
      46             :   virtual void GetTextContentInternal(nsAString& aTextContent,
      47             :                                       OOMReporter& aError) override;
      48             :   virtual void SetTextContentInternal(const nsAString& aTextContent,
      49             :                                       ErrorResult& aError) override;
      50             :   virtual void GetNodeValueInternal(nsAString& aNodeValue) override;
      51             :   virtual void SetNodeValueInternal(const nsAString& aNodeValue,
      52             :                                     ErrorResult& aError) override;
      53             : 
      54             :   // nsIDOMAttr interface
      55             :   NS_DECL_NSIDOMATTR
      56             : 
      57             :   virtual nsresult GetEventTargetParent(EventChainPreVisitor& aVisitor) override;
      58             : 
      59             :   // nsIAttribute interface
      60             :   void SetMap(nsDOMAttributeMap *aMap) override;
      61             :   Element* GetElement() const;
      62             :   nsresult SetOwnerDocument(nsIDocument* aDocument) override;
      63             : 
      64             :   // nsINode interface
      65             :   virtual bool IsNodeOfType(uint32_t aFlags) const override;
      66             :   virtual uint32_t GetChildCount() const override;
      67             :   virtual nsIContent *GetChildAt(uint32_t aIndex) const override;
      68             :   virtual nsIContent * const * GetChildArray(uint32_t* aChildCount) const override;
      69             :   virtual int32_t IndexOf(const nsINode* aPossibleChild) const override;
      70             :   virtual nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex,
      71             :                                  bool aNotify) override;
      72             :   virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) override;
      73             :   virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
      74             :                          bool aPreallocateChildren) const override;
      75             :   virtual already_AddRefed<nsIURI> GetBaseURI(bool aTryUseXHRDocBaseURI = false) const override;
      76             : 
      77             :   static void Initialize();
      78             :   static void Shutdown();
      79             : 
      80           0 :   NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(Attr,
      81             :                                                                    nsIAttribute)
      82             : 
      83           0 :   virtual nsIDOMNode* AsDOMNode() override { return this; }
      84             : 
      85             :   // WebIDL
      86             :   virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
      87             : 
      88             :   // XPCOM GetName() is OK
      89             :   // XPCOM GetValue() is OK
      90             : 
      91             :   void SetValue(const nsAString& aValue, ErrorResult& aRv);
      92             : 
      93             :   bool Specified() const;
      94             : 
      95             :   // XPCOM GetNamespaceURI() is OK
      96             :   // XPCOM GetPrefix() is OK
      97             :   // XPCOM GetLocalName() is OK
      98             : 
      99             :   Element* GetOwnerElement(ErrorResult& aRv);
     100             : 
     101             : protected:
     102           0 :   virtual Element* GetNameSpaceElement() override
     103             :   {
     104           0 :     return GetElement();
     105             :   }
     106             : 
     107             :   static bool sInitialized;
     108             : 
     109             : private:
     110             :   nsString mValue;
     111             : };
     112             : 
     113             : } // namespace dom
     114             : } // namespace mozilla
     115             : 
     116             : #endif /* mozilla_dom_Attr_h */

Generated by: LCOV version 1.13