Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/html/HTMLFontElement.h
Line
Count
Source (jump to first uncovered line)
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
#ifndef HTMLFontElement_h___
7
#define HTMLFontElement_h___
8
9
#include "mozilla/Attributes.h"
10
#include "nsGenericHTMLElement.h"
11
12
namespace mozilla {
13
namespace dom {
14
15
class HTMLFontElement final : public nsGenericHTMLElement
16
{
17
public:
18
  explicit HTMLFontElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
19
    : nsGenericHTMLElement(std::move(aNodeInfo))
20
0
  {
21
0
  }
22
23
  void GetColor(DOMString& aColor)
24
  {
25
    GetHTMLAttr(nsGkAtoms::color, aColor);
26
  }
27
  void SetColor(const nsAString& aColor, ErrorResult& aError)
28
  {
29
    SetHTMLAttr(nsGkAtoms::color, aColor, aError);
30
  }
31
  void GetFace(DOMString& aFace)
32
  {
33
    GetHTMLAttr(nsGkAtoms::face, aFace);
34
  }
35
  void SetFace(const nsAString& aFace, ErrorResult& aError)
36
  {
37
    SetHTMLAttr(nsGkAtoms::face, aFace, aError);
38
  }
39
  void GetSize(DOMString& aSize)
40
  {
41
    GetHTMLAttr(nsGkAtoms::size, aSize);
42
  }
43
  void SetSize(const nsAString& aSize, ErrorResult& aError)
44
  {
45
    SetHTMLAttr(nsGkAtoms::size, aSize, aError);
46
  }
47
48
  virtual bool ParseAttribute(int32_t aNamespaceID,
49
                                nsAtom* aAttribute,
50
                                const nsAString& aValue,
51
                                nsIPrincipal* aMaybeScriptedPrincipal,
52
                                nsAttrValue& aResult) override;
53
  NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
54
  virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override;
55
  virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
56
57
protected:
58
  virtual ~HTMLFontElement();
59
60
  virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
61
62
private:
63
  static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
64
                                    MappedDeclarations&);
65
};
66
67
} // namespace dom
68
} // namespace mozilla
69
70
#endif /* HTMLFontElement_h___ */