Bumping gaia.json for 8 gaia revision(s) a=gaia-bump
[gecko.git] / dom / html / ValidityState.cpp
blob9b76e555d7f566a23732a0eb516e06937c358e7c
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "mozilla/dom/ValidityState.h"
7 #include "mozilla/dom/ValidityStateBinding.h"
9 #include "nsCycleCollectionParticipant.h"
11 namespace mozilla {
12 namespace dom {
14 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(ValidityState, mConstraintValidation)
15 NS_IMPL_CYCLE_COLLECTING_ADDREF(ValidityState)
16 NS_IMPL_CYCLE_COLLECTING_RELEASE(ValidityState)
18 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ValidityState)
19 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
20 NS_INTERFACE_MAP_ENTRY(nsIDOMValidityState)
21 NS_INTERFACE_MAP_ENTRY(nsISupports)
22 NS_INTERFACE_MAP_END
24 ValidityState::ValidityState(nsIConstraintValidation* aConstraintValidation)
25 : mConstraintValidation(aConstraintValidation)
29 NS_IMETHODIMP
30 ValidityState::GetValueMissing(bool* aValueMissing)
32 *aValueMissing = ValueMissing();
33 return NS_OK;
36 NS_IMETHODIMP
37 ValidityState::GetTypeMismatch(bool* aTypeMismatch)
39 *aTypeMismatch = TypeMismatch();
40 return NS_OK;
43 NS_IMETHODIMP
44 ValidityState::GetPatternMismatch(bool* aPatternMismatch)
46 *aPatternMismatch = PatternMismatch();
47 return NS_OK;
50 NS_IMETHODIMP
51 ValidityState::GetTooLong(bool* aTooLong)
53 *aTooLong = TooLong();
54 return NS_OK;
57 NS_IMETHODIMP
58 ValidityState::GetRangeUnderflow(bool* aRangeUnderflow)
60 *aRangeUnderflow = RangeUnderflow();
61 return NS_OK;
64 NS_IMETHODIMP
65 ValidityState::GetRangeOverflow(bool* aRangeOverflow)
67 *aRangeOverflow = RangeOverflow();
68 return NS_OK;
71 NS_IMETHODIMP
72 ValidityState::GetStepMismatch(bool* aStepMismatch)
74 *aStepMismatch = StepMismatch();
75 return NS_OK;
78 NS_IMETHODIMP
79 ValidityState::GetBadInput(bool* aBadInput)
81 *aBadInput = BadInput();
82 return NS_OK;
85 NS_IMETHODIMP
86 ValidityState::GetCustomError(bool* aCustomError)
88 *aCustomError = CustomError();
89 return NS_OK;
92 NS_IMETHODIMP
93 ValidityState::GetValid(bool* aValid)
95 *aValid = Valid();
96 return NS_OK;
99 JSObject*
100 ValidityState::WrapObject(JSContext* aCx)
102 return ValidityStateBinding::Wrap(aCx, this);
105 } // namespace dom
106 } // namespace mozilla