/work/obj-fuzz/dist/include/mozilla/dom/HTMLProgressElement.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_HTMLProgressElement_h |
8 | | #define mozilla_dom_HTMLProgressElement_h |
9 | | |
10 | | #include "mozilla/Attributes.h" |
11 | | #include "nsGenericHTMLElement.h" |
12 | | #include "nsAttrValue.h" |
13 | | #include "nsAttrValueInlines.h" |
14 | | #include <algorithm> |
15 | | |
16 | | namespace mozilla { |
17 | | namespace dom { |
18 | | |
19 | | class HTMLProgressElement final : public nsGenericHTMLElement |
20 | | { |
21 | | public: |
22 | | explicit HTMLProgressElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo); |
23 | | |
24 | | EventStates IntrinsicState() const override; |
25 | | |
26 | | nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override; |
27 | | |
28 | | virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, |
29 | | const nsAString& aValue, |
30 | | nsIPrincipal* aMaybeScriptedPrincipal, |
31 | | nsAttrValue& aResult) override; |
32 | | |
33 | | // WebIDL |
34 | | double Value() const; |
35 | | void SetValue(double aValue, ErrorResult& aRv) |
36 | 0 | { |
37 | 0 | SetDoubleAttr(nsGkAtoms::value, aValue, aRv); |
38 | 0 | } |
39 | | double Max() const; |
40 | | void SetMax(double aValue, ErrorResult& aRv) |
41 | 0 | { |
42 | 0 | SetDoubleAttr(nsGkAtoms::max, aValue, aRv); |
43 | 0 | } |
44 | | double Position() const; |
45 | | |
46 | | protected: |
47 | | virtual ~HTMLProgressElement(); |
48 | | |
49 | | virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; |
50 | | |
51 | | protected: |
52 | | /** |
53 | | * Returns whethem the progress element is in the indeterminate state. |
54 | | * A progress element is in the indeterminate state if its value is ommited |
55 | | * or is not a floating point number.. |
56 | | * |
57 | | * @return whether the progress element is in the indeterminate state. |
58 | | */ |
59 | | bool IsIndeterminate() const; |
60 | | |
61 | | static const double kIndeterminatePosition; |
62 | | static const double kDefaultValue; |
63 | | static const double kDefaultMax; |
64 | | }; |
65 | | |
66 | | } // namespace dom |
67 | | } // namespace mozilla |
68 | | |
69 | | #endif // mozilla_dom_HTMLProgressElement_h |