Line data Source code
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 : #include "mozilla/dom/ValidityState.h"
8 : #include "mozilla/dom/ValidityStateBinding.h"
9 :
10 : #include "nsCycleCollectionParticipant.h"
11 :
12 : namespace mozilla {
13 : namespace dom {
14 :
15 0 : NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(ValidityState, mConstraintValidation)
16 0 : NS_IMPL_CYCLE_COLLECTING_ADDREF(ValidityState)
17 0 : NS_IMPL_CYCLE_COLLECTING_RELEASE(ValidityState)
18 :
19 0 : NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ValidityState)
20 0 : NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
21 0 : NS_INTERFACE_MAP_ENTRY(nsIDOMValidityState)
22 0 : NS_INTERFACE_MAP_ENTRY(nsISupports)
23 0 : NS_INTERFACE_MAP_END
24 :
25 0 : ValidityState::ValidityState(nsIConstraintValidation* aConstraintValidation)
26 0 : : mConstraintValidation(aConstraintValidation)
27 : {
28 0 : }
29 :
30 : NS_IMETHODIMP
31 0 : ValidityState::GetValueMissing(bool* aValueMissing)
32 : {
33 0 : *aValueMissing = ValueMissing();
34 0 : return NS_OK;
35 : }
36 :
37 : NS_IMETHODIMP
38 0 : ValidityState::GetTypeMismatch(bool* aTypeMismatch)
39 : {
40 0 : *aTypeMismatch = TypeMismatch();
41 0 : return NS_OK;
42 : }
43 :
44 : NS_IMETHODIMP
45 0 : ValidityState::GetPatternMismatch(bool* aPatternMismatch)
46 : {
47 0 : *aPatternMismatch = PatternMismatch();
48 0 : return NS_OK;
49 : }
50 :
51 : NS_IMETHODIMP
52 0 : ValidityState::GetTooLong(bool* aTooLong)
53 : {
54 0 : *aTooLong = TooLong();
55 0 : return NS_OK;
56 : }
57 :
58 : NS_IMETHODIMP
59 0 : ValidityState::GetTooShort(bool* aTooShort)
60 : {
61 0 : *aTooShort = TooShort();
62 0 : return NS_OK;
63 : }
64 :
65 : NS_IMETHODIMP
66 0 : ValidityState::GetRangeUnderflow(bool* aRangeUnderflow)
67 : {
68 0 : *aRangeUnderflow = RangeUnderflow();
69 0 : return NS_OK;
70 : }
71 :
72 : NS_IMETHODIMP
73 0 : ValidityState::GetRangeOverflow(bool* aRangeOverflow)
74 : {
75 0 : *aRangeOverflow = RangeOverflow();
76 0 : return NS_OK;
77 : }
78 :
79 : NS_IMETHODIMP
80 0 : ValidityState::GetStepMismatch(bool* aStepMismatch)
81 : {
82 0 : *aStepMismatch = StepMismatch();
83 0 : return NS_OK;
84 : }
85 :
86 : NS_IMETHODIMP
87 0 : ValidityState::GetBadInput(bool* aBadInput)
88 : {
89 0 : *aBadInput = BadInput();
90 0 : return NS_OK;
91 : }
92 :
93 : NS_IMETHODIMP
94 0 : ValidityState::GetCustomError(bool* aCustomError)
95 : {
96 0 : *aCustomError = CustomError();
97 0 : return NS_OK;
98 : }
99 :
100 : NS_IMETHODIMP
101 0 : ValidityState::GetValid(bool* aValid)
102 : {
103 0 : *aValid = Valid();
104 0 : return NS_OK;
105 : }
106 :
107 : JSObject*
108 0 : ValidityState::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
109 : {
110 0 : return ValidityStateBinding::Wrap(aCx, this, aGivenProto);
111 : }
112 :
113 : } // namespace dom
114 : } // namespace mozilla
115 :
|