tor-browser

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

SVGTitleElement.h (1766B)


      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_SVGTITLEELEMENT_H_
      8 #define DOM_SVG_SVGTITLEELEMENT_H_
      9 
     10 #include "SVGElement.h"
     11 #include "nsStubMutationObserver.h"
     12 
     13 nsresult NS_NewSVGTitleElement(
     14    nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
     15 namespace mozilla::dom {
     16 
     17 using SVGTitleElementBase = SVGElement;
     18 
     19 class SVGTitleElement final : public SVGTitleElementBase,
     20                              public nsStubMutationObserver {
     21 protected:
     22  friend nsresult(::NS_NewSVGTitleElement(
     23      nsIContent** aResult,
     24      already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
     25  explicit SVGTitleElement(
     26      already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
     27  ~SVGTitleElement() = default;
     28 
     29  JSObject* WrapNode(JSContext* aCx,
     30                     JS::Handle<JSObject*> aGivenProto) override;
     31 
     32 public:
     33  // interfaces:
     34 
     35  NS_DECL_ISUPPORTS_INHERITED
     36 
     37  // nsIMutationObserver
     38  NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
     39  NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
     40  NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
     41  NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
     42 
     43  nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
     44 
     45  nsresult BindToTree(BindContext&, nsINode& aParent) override;
     46 
     47  void UnbindFromTree(UnbindContext&) override;
     48 
     49  void DoneAddingChildren(bool aHaveNotified) override;
     50 
     51 private:
     52  void SendTitleChangeEvent(bool aBound);
     53 };
     54 
     55 }  // namespace mozilla::dom
     56 
     57 #endif  // DOM_SVG_SVGTITLEELEMENT_H_