Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/HTMLOptGroupElement.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 file,
5
 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef mozilla_dom_HTMLOptGroupElement_h
8
#define mozilla_dom_HTMLOptGroupElement_h
9
10
#include "mozilla/Attributes.h"
11
#include "nsGenericHTMLElement.h"
12
13
namespace mozilla {
14
class EventChainPreVisitor;
15
namespace dom {
16
17
class HTMLOptGroupElement final : public nsGenericHTMLElement
18
{
19
public:
20
  explicit HTMLOptGroupElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
21
22
  NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLOptGroupElement, optgroup)
23
24
  // nsISupports
25
  NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLOptGroupElement,
26
                                       nsGenericHTMLElement)
27
28
  // nsINode
29
  virtual nsresult InsertChildBefore(nsIContent* aKid, nsIContent* aBeforeThis,
30
                                     bool aNotify) override;
31
  virtual void RemoveChildNode(nsIContent* aKid, bool aNotify) override;
32
33
  // nsIContent
34
  void GetEventTargetParent(EventChainPreVisitor& aVisitor) override;
35
36
  virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
37
38
  virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
39
                                const nsAttrValue* aValue,
40
                                const nsAttrValue* aOldValue,
41
                                nsIPrincipal* aSubjectPrincipal,
42
                                bool aNotify) override;
43
44
  bool Disabled() const
45
0
  {
46
0
    return GetBoolAttr(nsGkAtoms::disabled);
47
0
  }
48
  void SetDisabled(bool aValue, ErrorResult& aError)
49
0
  {
50
0
     SetHTMLBoolAttr(nsGkAtoms::disabled, aValue, aError);
51
0
  }
52
53
  void GetLabel(nsAString& aValue) const
54
0
  {
55
0
    GetHTMLAttr(nsGkAtoms::label, aValue);
56
0
  }
57
  void SetLabel(const nsAString& aLabel, ErrorResult& aError)
58
0
  {
59
0
    SetHTMLAttr(nsGkAtoms::label, aLabel, aError);
60
0
  }
61
62
protected:
63
  virtual ~HTMLOptGroupElement();
64
65
  virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
66
67
protected:
68
69
  /**
70
   * Get the select content element that contains this option
71
   * @param aSelectElement the select element [OUT]
72
   */
73
  Element* GetSelect();
74
};
75
76
} // namespace dom
77
} // namespace mozilla
78
79
#endif /* mozilla_dom_HTMLOptGroupElement_h */