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"
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
)
24 ValidityState::ValidityState(nsIConstraintValidation
* aConstraintValidation
)
25 : mConstraintValidation(aConstraintValidation
)
30 ValidityState::GetValueMissing(bool* aValueMissing
)
32 *aValueMissing
= ValueMissing();
37 ValidityState::GetTypeMismatch(bool* aTypeMismatch
)
39 *aTypeMismatch
= TypeMismatch();
44 ValidityState::GetPatternMismatch(bool* aPatternMismatch
)
46 *aPatternMismatch
= PatternMismatch();
51 ValidityState::GetTooLong(bool* aTooLong
)
53 *aTooLong
= TooLong();
58 ValidityState::GetRangeUnderflow(bool* aRangeUnderflow
)
60 *aRangeUnderflow
= RangeUnderflow();
65 ValidityState::GetRangeOverflow(bool* aRangeOverflow
)
67 *aRangeOverflow
= RangeOverflow();
72 ValidityState::GetStepMismatch(bool* aStepMismatch
)
74 *aStepMismatch
= StepMismatch();
79 ValidityState::GetBadInput(bool* aBadInput
)
81 *aBadInput
= BadInput();
86 ValidityState::GetCustomError(bool* aCustomError
)
88 *aCustomError
= CustomError();
93 ValidityState::GetValid(bool* aValid
)
100 ValidityState::WrapObject(JSContext
* aCx
)
102 return ValidityStateBinding::Wrap(aCx
, this);
106 } // namespace mozilla