2013-04-13 00:08:49 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-08-18 11:28:08 -07:00
|
|
|
|
2013-01-06 11:20:02 -08:00
|
|
|
#include "mozilla/dom/ValidityState.h"
|
2013-01-16 10:01:01 -08:00
|
|
|
#include "mozilla/dom/ValidityStateBinding.h"
|
2010-08-18 11:28:08 -07:00
|
|
|
|
2013-01-16 10:01:01 -08:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
2010-08-18 11:28:08 -07:00
|
|
|
|
2013-01-06 11:20:02 -08:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
2010-08-18 11:28:08 -07:00
|
|
|
|
2014-04-29 01:57:00 -07:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(ValidityState, mConstraintValidation)
|
2013-01-16 10:01:01 -08:00
|
|
|
NS_IMPL_CYCLE_COLLECTING_ADDREF(ValidityState)
|
|
|
|
NS_IMPL_CYCLE_COLLECTING_RELEASE(ValidityState)
|
2013-01-06 11:20:02 -08:00
|
|
|
|
2013-01-16 10:01:01 -08:00
|
|
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ValidityState)
|
|
|
|
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
2010-08-18 11:28:08 -07:00
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIDOMValidityState)
|
2013-04-13 00:08:49 -07:00
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
2010-08-18 11:28:08 -07:00
|
|
|
NS_INTERFACE_MAP_END
|
|
|
|
|
2013-01-06 11:20:02 -08:00
|
|
|
ValidityState::ValidityState(nsIConstraintValidation* aConstraintValidation)
|
2010-08-18 11:28:08 -07:00
|
|
|
: mConstraintValidation(aConstraintValidation)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2013-01-06 11:20:02 -08:00
|
|
|
ValidityState::GetValueMissing(bool* aValueMissing)
|
2010-08-18 11:28:08 -07:00
|
|
|
{
|
2013-01-16 10:01:01 -08:00
|
|
|
*aValueMissing = ValueMissing();
|
2010-08-18 11:28:08 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2013-01-06 11:20:02 -08:00
|
|
|
ValidityState::GetTypeMismatch(bool* aTypeMismatch)
|
2010-08-18 11:28:08 -07:00
|
|
|
{
|
2013-01-16 10:01:01 -08:00
|
|
|
*aTypeMismatch = TypeMismatch();
|
2010-08-18 11:28:08 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2013-01-06 11:20:02 -08:00
|
|
|
ValidityState::GetPatternMismatch(bool* aPatternMismatch)
|
2010-08-18 11:28:08 -07:00
|
|
|
{
|
2013-01-16 10:01:01 -08:00
|
|
|
*aPatternMismatch = PatternMismatch();
|
2010-08-18 11:28:08 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2013-01-06 11:20:02 -08:00
|
|
|
ValidityState::GetTooLong(bool* aTooLong)
|
2010-08-18 11:28:08 -07:00
|
|
|
{
|
2013-01-16 10:01:01 -08:00
|
|
|
*aTooLong = TooLong();
|
2010-08-18 11:28:08 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2013-01-06 11:20:02 -08:00
|
|
|
ValidityState::GetRangeUnderflow(bool* aRangeUnderflow)
|
2010-08-18 11:28:08 -07:00
|
|
|
{
|
2013-01-16 10:01:01 -08:00
|
|
|
*aRangeUnderflow = RangeUnderflow();
|
2010-08-18 11:28:08 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2013-01-06 11:20:02 -08:00
|
|
|
ValidityState::GetRangeOverflow(bool* aRangeOverflow)
|
2010-08-18 11:28:08 -07:00
|
|
|
{
|
2013-01-16 10:01:01 -08:00
|
|
|
*aRangeOverflow = RangeOverflow();
|
2010-08-18 11:28:08 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2013-01-06 11:20:02 -08:00
|
|
|
ValidityState::GetStepMismatch(bool* aStepMismatch)
|
2010-08-18 11:28:08 -07:00
|
|
|
{
|
2013-01-16 10:01:01 -08:00
|
|
|
*aStepMismatch = StepMismatch();
|
2010-08-18 11:28:08 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2014-01-30 04:54:12 -08:00
|
|
|
NS_IMETHODIMP
|
|
|
|
ValidityState::GetBadInput(bool* aBadInput)
|
|
|
|
{
|
|
|
|
*aBadInput = BadInput();
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2010-08-18 11:28:08 -07:00
|
|
|
NS_IMETHODIMP
|
2013-01-06 11:20:02 -08:00
|
|
|
ValidityState::GetCustomError(bool* aCustomError)
|
2010-08-18 11:28:08 -07:00
|
|
|
{
|
2013-01-16 10:01:01 -08:00
|
|
|
*aCustomError = CustomError();
|
2010-08-18 11:28:08 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2013-01-06 11:20:02 -08:00
|
|
|
ValidityState::GetValid(bool* aValid)
|
2010-08-18 11:28:08 -07:00
|
|
|
{
|
2013-01-16 10:01:01 -08:00
|
|
|
*aValid = Valid();
|
2010-08-18 11:28:08 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2013-01-16 10:01:01 -08:00
|
|
|
JSObject*
|
2014-04-08 15:27:18 -07:00
|
|
|
ValidityState::WrapObject(JSContext* aCx)
|
2013-01-16 10:01:01 -08:00
|
|
|
{
|
Bug 991742 part 6. Remove the "aScope" argument of binding Wrap() methods. r=bholley
This patch was mostly generated with this command:
find . -name "*.h" -o -name "*.cpp" | xargs sed -e 's/Binding::Wrap(aCx, aScope, this/Binding::Wrap(aCx, this/' -e 's/Binding_workers::Wrap(aCx, aScope, this/Binding_workers::Wrap(aCx, this/' -e 's/Binding::Wrap(cx, scope, this/Binding::Wrap(cx, this/' -i ""
plus a few manual fixes to dom/bindings/Codegen.py, js/xpconnect/src/event_impl_gen.py, and a few C++ files that were not caught in the search-and-replace above.
2014-04-08 15:27:17 -07:00
|
|
|
return ValidityStateBinding::Wrap(aCx, this);
|
2013-01-16 10:01:01 -08:00
|
|
|
}
|
|
|
|
|
2013-01-06 11:20:02 -08:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|