tor-browser

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

HTMLParagraphElement.h (1784B)


      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_HTMLParagraphElement_h
      8 #define mozilla_dom_HTMLParagraphElement_h
      9 
     10 #include "nsGenericHTMLElement.h"
     11 
     12 namespace mozilla::dom {
     13 
     14 class HTMLParagraphElement final : public nsGenericHTMLElement {
     15 public:
     16  explicit HTMLParagraphElement(
     17      already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
     18      : nsGenericHTMLElement(std::move(aNodeInfo)) {}
     19 
     20  // nsISupports
     21  NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLParagraphElement,
     22                                       nsGenericHTMLElement)
     23 
     24  bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
     25                      const nsAString& aValue,
     26                      nsIPrincipal* aMaybeScriptedPrincipal,
     27                      nsAttrValue& aResult) override;
     28  NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
     29  nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override;
     30 
     31  nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
     32 
     33  // WebIDL API
     34  void GetAlign(nsAString& aValue) { GetHTMLAttr(nsGkAtoms::align, aValue); }
     35  void SetAlign(const nsAString& aValue, mozilla::ErrorResult& rv) {
     36    SetHTMLAttr(nsGkAtoms::align, aValue, rv);
     37  }
     38 
     39 protected:
     40  virtual ~HTMLParagraphElement();
     41 
     42  JSObject* WrapNode(JSContext*, JS::Handle<JSObject*> aGivenProto) override;
     43 
     44 private:
     45  static void MapAttributesIntoRule(MappedDeclarationsBuilder&);
     46 };
     47 
     48 }  // namespace mozilla::dom
     49 
     50 #endif  // mozilla_dom_HTMLParagraphElement_h