/work/obj-fuzz/dist/include/mozilla/dom/HTMLSummaryElement.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 | | |
7 | | #ifndef mozilla_dom_HTMLSummaryElement_h |
8 | | #define mozilla_dom_HTMLSummaryElement_h |
9 | | |
10 | | #include "mozilla/Attributes.h" |
11 | | #include "nsGenericHTMLElement.h" |
12 | | |
13 | | namespace mozilla { |
14 | | namespace dom { |
15 | | class HTMLDetailsElement; |
16 | | |
17 | | // HTMLSummaryElement implements the <summary> tag, which is used as a summary |
18 | | // or legend of the <details> tag. Please see the spec for more information. |
19 | | // https://html.spec.whatwg.org/multipage/forms.html#the-details-element |
20 | | // |
21 | | class HTMLSummaryElement final : public nsGenericHTMLElement |
22 | | { |
23 | | public: |
24 | | using NodeInfo = mozilla::dom::NodeInfo; |
25 | | |
26 | | explicit HTMLSummaryElement(already_AddRefed<NodeInfo>&& aNodeInfo) |
27 | | : nsGenericHTMLElement(std::move(aNodeInfo)) |
28 | 0 | { |
29 | 0 | } |
30 | | |
31 | | NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLSummaryElement, summary) |
32 | | |
33 | | nsresult Clone(NodeInfo*, nsINode** aResult) const override; |
34 | | |
35 | | nsresult PostHandleEvent(EventChainPostVisitor& aVisitor) override; |
36 | | |
37 | | bool IsHTMLFocusable(bool aWithMouse, bool* aIsFocusable, |
38 | | int32_t* aTabIndex) override; |
39 | | |
40 | | int32_t TabIndexDefault() override; |
41 | | |
42 | | // Return true if this is the first summary element child of a details or the |
43 | | // default summary element generated by DetailsFrame. |
44 | | bool IsMainSummary() const; |
45 | | |
46 | | // Return the details element which contains this summary. Otherwise return |
47 | | // nullptr if there is no such details element. |
48 | | HTMLDetailsElement* GetDetails() const; |
49 | | |
50 | | protected: |
51 | | virtual ~HTMLSummaryElement(); |
52 | | |
53 | | JSObject* WrapNode(JSContext* aCx, |
54 | | JS::Handle<JSObject*> aGivenProto) override; |
55 | | }; |
56 | | |
57 | | } // namespace dom |
58 | | } // namespace mozilla |
59 | | |
60 | | #endif /* mozilla_dom_HTMLSummaryElement_h */ |