From 3ee6f4f68e8b985a438817a4f22ebe298983bb17 Mon Sep 17 00:00:00 2001 From: Benjamin Smedberg Date: Tue, 19 Jul 2011 11:44:55 +0200 Subject: [PATCH] Bug 617539 - Combine nsIRadioGroupContainer_MOZILLA_2_0_BRANCH; r=bz --- content/base/src/nsDocument.cpp | 1 - content/base/src/nsDocument.h | 2 +- .../content/public/nsIRadioGroupContainer.h | 21 ++++--------------- .../html/content/src/nsHTMLFormElement.cpp | 5 ++--- content/html/content/src/nsHTMLFormElement.h | 2 +- .../html/content/src/nsHTMLInputElement.cpp | 12 +++-------- 6 files changed, 11 insertions(+), 32 deletions(-) diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index ef198b56b16f..252d32ee14de 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -1691,7 +1691,6 @@ NS_INTERFACE_TABLE_HEAD(nsDocument) NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMEventTarget) NS_INTERFACE_TABLE_ENTRY(nsDocument, nsISupportsWeakReference) NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIRadioGroupContainer) - NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIRadioGroupContainer_MOZILLA_2_0_BRANCH) NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIMutationObserver) NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIApplicationCacheContainer) NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentTouch) diff --git a/content/base/src/nsDocument.h b/content/base/src/nsDocument.h index 83c580ae3e8e..27762d877bd4 100644 --- a/content/base/src/nsDocument.h +++ b/content/base/src/nsDocument.h @@ -490,7 +490,7 @@ class nsDocument : public nsIDocument, public nsIDOMDocumentXBL, public nsSupportsWeakReference, public nsIScriptObjectPrincipal, - public nsIRadioGroupContainer_MOZILLA_2_0_BRANCH, + public nsIRadioGroupContainer, public nsIApplicationCacheContainer, public nsStubMutationObserver, public nsIDOMDocumentTouch diff --git a/content/html/content/public/nsIRadioGroupContainer.h b/content/html/content/public/nsIRadioGroupContainer.h index 2f519b50e7f4..731a5504014d 100644 --- a/content/html/content/public/nsIRadioGroupContainer.h +++ b/content/html/content/public/nsIRadioGroupContainer.h @@ -45,8 +45,8 @@ class nsIRadioVisitor; class nsIFormControl; #define NS_IRADIOGROUPCONTAINER_IID \ -{ 0x06de7839, 0xd0db, 0x47d3, \ - { 0x82, 0x90, 0x3c, 0xb8, 0x62, 0x2e, 0xd9, 0x66 } } +{ 0x22924a01, 0x4360, 0x401b, \ + { 0xb1, 0xd1, 0x56, 0x8d, 0xf5, 0xa3, 0xda, 0x71 } } /** * A container that has multiple radio groups in it, defined by name. @@ -132,19 +132,6 @@ public: NS_IMETHOD GetPositionInGroup(nsIDOMHTMLInputElement *aRadio, PRInt32 *aPositionIndex, PRInt32 *aItemsInGroup) = 0; -}; - -NS_DEFINE_STATIC_IID_ACCESSOR(nsIRadioGroupContainer, - NS_IRADIOGROUPCONTAINER_IID) - -#define NS_IRADIOGROUPCONTAINER_MOZILLA_2_0_BRANCH_IID \ -{ 0xaa9ec446, 0xcdc7, 0x4030, \ - { 0xab, 0x02, 0xda, 0x44, 0xee, 0xb1, 0x80, 0x0a } } - -class nsIRadioGroupContainer_MOZILLA_2_0_BRANCH : public nsIRadioGroupContainer -{ -public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IRADIOGROUPCONTAINER_MOZILLA_2_0_IID) virtual PRUint32 GetRequiredRadioCount(const nsAString& aName) const = 0; virtual void RadioRequiredChanged(const nsAString& aName, @@ -153,7 +140,7 @@ public: virtual void SetValueMissingState(const nsAString& aName, bool aValue) = 0; }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIRadioGroupContainer_MOZILLA_2_0_BRANCH, - NS_IRADIOGROUPCONTAINER_MOZILLA_2_0_BRANCH_IID) +NS_DEFINE_STATIC_IID_ACCESSOR(nsIRadioGroupContainer, + NS_IRADIOGROUPCONTAINER_IID) #endif /* nsIRadioGroupContainer_h__ */ diff --git a/content/html/content/src/nsHTMLFormElement.cpp b/content/html/content/src/nsHTMLFormElement.cpp index 78874fe5341c..d976dca57587 100644 --- a/content/html/content/src/nsHTMLFormElement.cpp +++ b/content/html/content/src/nsHTMLFormElement.cpp @@ -328,12 +328,11 @@ DOMCI_NODE_DATA(HTMLFormElement, nsHTMLFormElement) // QueryInterface implementation for nsHTMLFormElement NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLFormElement) - NS_HTML_CONTENT_INTERFACE_TABLE5(nsHTMLFormElement, + NS_HTML_CONTENT_INTERFACE_TABLE4(nsHTMLFormElement, nsIDOMHTMLFormElement, nsIForm, nsIWebProgressListener, - nsIRadioGroupContainer, - nsIRadioGroupContainer_MOZILLA_2_0_BRANCH) + nsIRadioGroupContainer) NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLFormElement, nsGenericHTMLElement) NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLFormElement) diff --git a/content/html/content/src/nsHTMLFormElement.h b/content/html/content/src/nsHTMLFormElement.h index 6ce99c6cf8c3..11ff52c6e868 100644 --- a/content/html/content/src/nsHTMLFormElement.h +++ b/content/html/content/src/nsHTMLFormElement.h @@ -94,7 +94,7 @@ class nsHTMLFormElement : public nsGenericHTMLElement, public nsIDOMHTMLFormElement, public nsIWebProgressListener, public nsIForm, - public nsIRadioGroupContainer_MOZILLA_2_0_BRANCH + public nsIRadioGroupContainer { public: nsHTMLFormElement(already_AddRefed aNodeInfo); diff --git a/content/html/content/src/nsHTMLInputElement.cpp b/content/html/content/src/nsHTMLInputElement.cpp index f2b122618cc2..d870b64c0df9 100644 --- a/content/html/content/src/nsHTMLInputElement.cpp +++ b/content/html/content/src/nsHTMLInputElement.cpp @@ -883,9 +883,7 @@ nsHTMLInputElement::AfterSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, } if (mType == NS_FORM_INPUT_RADIO && aName == nsGkAtoms::required) { - nsIRadioGroupContainer* c = GetRadioGroupContainer(); - nsCOMPtr container = - do_QueryInterface(c); + nsCOMPtr container = GetRadioGroupContainer(); if (container) { nsAutoString name; @@ -3343,10 +3341,8 @@ nsHTMLInputElement::AddedToRadioGroup() // We initialize the validity of the element to the validity of the group // because we assume UpdateValueMissingState() will be called after. - nsCOMPtr container2 = - do_QueryInterface(container); SetValidityState(VALIDITY_STATE_VALUE_MISSING, - container2->GetValueMissingState(name)); + container->GetValueMissingState(name)); } } @@ -3733,9 +3729,7 @@ nsHTMLInputElement::UpdateValueMissingValidityStateForRadio(bool aIgnoreSelf) : HasAttr(kNameSpaceID_None, nsGkAtoms::required); bool valueMissing = false; - nsIRadioGroupContainer* c = GetRadioGroupContainer(); - nsCOMPtr container = - do_QueryInterface(c); + nsCOMPtr container = GetRadioGroupContainer(); if (!container) { SetValidityState(VALIDITY_STATE_VALUE_MISSING, required && !selected);