Bug 1437135 - Remove nsIDOMValidityState. r?bz
MozReview-Commit-ID: AlRrLxSiIre
--- a/dom/html/ValidityState.cpp
+++ b/dom/html/ValidityState.cpp
@@ -13,102 +13,24 @@ namespace mozilla {
namespace dom {
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(ValidityState, mConstraintValidation)
NS_IMPL_CYCLE_COLLECTING_ADDREF(ValidityState)
NS_IMPL_CYCLE_COLLECTING_RELEASE(ValidityState)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ValidityState)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
- NS_INTERFACE_MAP_ENTRY(nsIDOMValidityState)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
ValidityState::ValidityState(nsIConstraintValidation* aConstraintValidation)
: mConstraintValidation(aConstraintValidation)
{
}
-NS_IMETHODIMP
-ValidityState::GetValueMissing(bool* aValueMissing)
-{
- *aValueMissing = ValueMissing();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-ValidityState::GetTypeMismatch(bool* aTypeMismatch)
-{
- *aTypeMismatch = TypeMismatch();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-ValidityState::GetPatternMismatch(bool* aPatternMismatch)
-{
- *aPatternMismatch = PatternMismatch();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-ValidityState::GetTooLong(bool* aTooLong)
-{
- *aTooLong = TooLong();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-ValidityState::GetTooShort(bool* aTooShort)
-{
- *aTooShort = TooShort();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-ValidityState::GetRangeUnderflow(bool* aRangeUnderflow)
-{
- *aRangeUnderflow = RangeUnderflow();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-ValidityState::GetRangeOverflow(bool* aRangeOverflow)
-{
- *aRangeOverflow = RangeOverflow();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-ValidityState::GetStepMismatch(bool* aStepMismatch)
-{
- *aStepMismatch = StepMismatch();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-ValidityState::GetBadInput(bool* aBadInput)
-{
- *aBadInput = BadInput();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-ValidityState::GetCustomError(bool* aCustomError)
-{
- *aCustomError = CustomError();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-ValidityState::GetValid(bool* aValid)
-{
- *aValid = Valid();
- return NS_OK;
-}
-
JSObject*
ValidityState::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return ValidityStateBinding::Wrap(aCx, this, aGivenProto);
}
} // namespace dom
} // namespace mozilla
--- a/dom/html/ValidityState.h
+++ b/dom/html/ValidityState.h
@@ -2,33 +2,31 @@
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
#ifndef mozilla_dom_ValidityState_h
#define mozilla_dom_ValidityState_h
-#include "nsIDOMValidityState.h"
#include "nsIConstraintValidation.h"
#include "nsWrapperCache.h"
#include "js/TypeDecls.h"
namespace mozilla {
namespace dom {
-class ValidityState final : public nsIDOMValidityState,
+class ValidityState final : public nsISupports,
public nsWrapperCache
{
~ValidityState() {}
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ValidityState)
- NS_DECL_NSIDOMVALIDITYSTATE
friend class ::nsIConstraintValidation;
nsIConstraintValidation* GetParentObject() const {
return mConstraintValidation;
}
virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
--- a/dom/html/nsIConstraintValidation.cpp
+++ b/dom/html/nsIConstraintValidation.cpp
@@ -40,26 +40,16 @@ nsIConstraintValidation::Validity()
{
if (!mValidity) {
mValidity = new mozilla::dom::ValidityState(this);
}
return mValidity;
}
-nsresult
-nsIConstraintValidation::GetValidity(nsIDOMValidityState** aValidity)
-{
- NS_ENSURE_ARG_POINTER(aValidity);
-
- NS_ADDREF(*aValidity = Validity());
-
- return NS_OK;
-}
-
void
nsIConstraintValidation::GetValidationMessage(nsAString& aValidationMessage,
ErrorResult& aError)
{
aValidationMessage.Truncate();
if (IsCandidateForConstraintValidation() && !IsValid()) {
nsCOMPtr<Element> element = do_QueryInterface(this);
--- a/dom/html/nsIConstraintValidation.h
+++ b/dom/html/nsIConstraintValidation.h
@@ -5,18 +5,16 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsIConstraintValidition_h___
#define nsIConstraintValidition_h___
#include "nsISupports.h"
#include "nsString.h"
-class nsIDOMValidityState;
-
namespace mozilla {
class ErrorResult;
namespace dom {
class ValidityState;
} // namespace dom
} // namespace mozilla
#define NS_ICONSTRAINTVALIDATION_IID \
@@ -76,17 +74,16 @@ public:
bool CheckValidity();
bool ReportValidity();
protected:
// You can't instantiate an object from that class.
nsIConstraintValidation();
- nsresult GetValidity(nsIDOMValidityState** aValidity);
nsresult CheckValidity(bool* aValidity);
void SetCustomValidity(const nsAString& aError);
bool GetValidityState(ValidityStateType aState) const
{
return mValidityBitField & aState;
}
--- a/dom/interfaces/html/moz.build
+++ b/dom/interfaces/html/moz.build
@@ -8,14 +8,13 @@ with Files("**"):
BUG_COMPONENT = ("Core", "DOM")
XPIDL_SOURCES += [
'nsIDOMHTMLFormElement.idl',
'nsIDOMHTMLInputElement.idl',
'nsIDOMHTMLMediaElement.idl',
'nsIDOMMozBrowserFrame.idl',
'nsIDOMTimeRanges.idl',
- 'nsIDOMValidityState.idl',
'nsIMozBrowserFrame.idl',
]
XPIDL_MODULE = 'dom_html'
--- a/dom/interfaces/html/nsIDOMHTMLInputElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLInputElement.idl
@@ -2,17 +2,16 @@
/* 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/. */
#include "nsISupports.idl"
interface nsIControllers;
interface nsIDOMFileList;
-interface nsIDOMValidityState;
interface nsIDOMHTMLFormElement;
/**
* The nsIDOMHTMLInputElement interface is the interface to a [X]HTML
* input element.
*
* This interface is trying to follow the DOM Level 2 HTML specification:
* http://www.w3.org/TR/DOM-Level-2-HTML/
deleted file mode 100644
--- a/dom/interfaces/html/nsIDOMValidityState.idl
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-#include "domstubs.idl"
-
-/**
- * The nsIDOMValidityState interface is the interface to a ValidityState
- * object which represents the validity states of an element.
- *
- * For more information on this interface please see
- * http://www.whatwg.org/specs/web-apps/current-work/#validitystate
- */
-
-[uuid(00bed276-f1f7-492f-a039-dbd9b9efc10b)]
-interface nsIDOMValidityState : nsISupports
-{
- readonly attribute boolean valueMissing;
- readonly attribute boolean typeMismatch;
- readonly attribute boolean patternMismatch;
- readonly attribute boolean tooLong;
- readonly attribute boolean tooShort;
- readonly attribute boolean rangeUnderflow;
- readonly attribute boolean rangeOverflow;
- readonly attribute boolean stepMismatch;
- readonly attribute boolean badInput;
- readonly attribute boolean customError;
- readonly attribute boolean valid;
-};
--- a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
@@ -57,17 +57,16 @@
#include "nsIDOMScreen.h"
#include "nsIDOMScrollAreaEvent.h"
#include "nsIDOMSerializer.h"
#include "nsIDOMSimpleGestureEvent.h"
#include "nsIDOMText.h"
#include "nsIDOMTimeRanges.h"
#include "nsIDOMTransitionEvent.h"
#include "nsIDOMUIEvent.h"
-#include "nsIDOMValidityState.h"
#include "nsIDOMWheelEvent.h"
#include "nsIDOMXMLDocument.h"
#include "nsIDOMXULCommandEvent.h"
#include "nsIDOMXULElement.h"
#include "nsIFrameLoader.h"
#include "nsIListBoxObject.h"
#include "nsIMenuBoxObject.h"
#include "nsIScrollBoxObject.h"
@@ -149,17 +148,16 @@
#include "mozilla/dom/StyleSheetListBinding.h"
#include "mozilla/dom/SVGElementBinding.h"
#include "mozilla/dom/TextBinding.h"
#include "mozilla/dom/TimeEventBinding.h"
#include "mozilla/dom/TimeRangesBinding.h"
#include "mozilla/dom/TransitionEventBinding.h"
#include "mozilla/dom/TreeBoxObjectBinding.h"
#include "mozilla/dom/UIEventBinding.h"
-#include "mozilla/dom/ValidityStateBinding.h"
#include "mozilla/dom/WheelEventBinding.h"
#include "mozilla/dom/XMLDocumentBinding.h"
#include "mozilla/dom/XMLHttpRequestEventTargetBinding.h"
#include "mozilla/dom/XMLHttpRequestUploadBinding.h"
#include "mozilla/dom/XMLSerializerBinding.h"
#include "mozilla/dom/XULCommandEventBinding.h"
#include "mozilla/dom/XULDocumentBinding.h"
#include "mozilla/dom/XULElementBinding.h"
@@ -274,17 +272,16 @@ const ComponentsInterfaceShimEntry kComp
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIScrollBoxObject, ScrollBoxObject),
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMSerializer, XMLSerializer),
DEFINE_SHIM(SimpleGestureEvent),
DEFINE_SHIM(Text),
DEFINE_SHIM(TimeRanges),
DEFINE_SHIM(TransitionEvent),
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsITreeBoxObject, TreeBoxObject),
DEFINE_SHIM(UIEvent),
- DEFINE_SHIM(ValidityState),
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIWebBrowserPersistable, FrameLoader),
DEFINE_SHIM(WheelEvent),
DEFINE_SHIM(XMLDocument),
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIXMLHttpRequestEventTarget, XMLHttpRequestEventTarget),
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIXMLHttpRequestUpload, XMLHttpRequestUpload),
DEFINE_SHIM(XULCommandEvent),
DEFINE_SHIM(XULElement),
DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsISelection, Selection),