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/. */
7 #ifndef mozilla_dom_HTMLOptGroupElement_h
8 #define mozilla_dom_HTMLOptGroupElement_h
10 #include "mozilla/Attributes.h"
11 #include "nsGenericHTMLElement.h"
15 class EventChainPreVisitor
;
18 class HTMLOptGroupElement final
: public nsGenericHTMLElement
{
20 explicit HTMLOptGroupElement(
21 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
);
23 NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLOptGroupElement
, optgroup
)
26 NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLOptGroupElement
,
30 virtual void InsertChildBefore(nsIContent
* aKid
, nsIContent
* aBeforeThis
,
31 bool aNotify
, ErrorResult
& aRv
) override
;
32 virtual void RemoveChildNode(nsIContent
* aKid
, bool aNotify
) override
;
35 void GetEventTargetParent(EventChainPreVisitor
& aVisitor
) override
;
37 virtual nsresult
Clone(dom::NodeInfo
*, nsINode
** aResult
) const override
;
39 virtual void AfterSetAttr(int32_t aNameSpaceID
, nsAtom
* aName
,
40 const nsAttrValue
* aValue
,
41 const nsAttrValue
* aOldValue
,
42 nsIPrincipal
* aSubjectPrincipal
,
43 bool aNotify
) override
;
45 bool Disabled() const { return GetBoolAttr(nsGkAtoms::disabled
); }
46 void SetDisabled(bool aValue
, ErrorResult
& aError
) {
47 SetHTMLBoolAttr(nsGkAtoms::disabled
, aValue
, aError
);
50 void GetLabel(nsAString
& aValue
) const {
51 GetHTMLAttr(nsGkAtoms::label
, aValue
);
53 void SetLabel(const nsAString
& aLabel
, ErrorResult
& aError
) {
54 SetHTMLAttr(nsGkAtoms::label
, aLabel
, aError
);
58 virtual ~HTMLOptGroupElement();
60 virtual JSObject
* WrapNode(JSContext
* aCx
,
61 JS::Handle
<JSObject
*> aGivenProto
) override
;
65 * Get the select content element that contains this option
66 * @param aSelectElement the select element [OUT]
72 } // namespace mozilla
74 #endif /* mozilla_dom_HTMLOptGroupElement_h */