mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 03:24:26 +00:00
Checking in keeda@hotpop.com's fix for bug 179461. Partially implement IE's select.options.add() method. No support for the optional second argument yet. r=caillon@returnzero.com, sr=jst@netscape.com
This commit is contained in:
parent
2970b8921a
commit
447d7e11ca
@ -100,12 +100,13 @@ public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIDOMNSHTMLOptionCollection interface, can't use the macro
|
||||
// NS_DECL_NSIDOMNSHTMLOPTIONLIST here since GetLength() is defined
|
||||
// in mode than one interface
|
||||
// NS_DECL_NSIDOMNSHTMLOPTIONCOLLECTION here since GetLength() is
|
||||
// defined in more than one interface
|
||||
NS_IMETHOD SetLength(PRUint32 aLength);
|
||||
NS_IMETHOD GetSelectedIndex(PRInt32* aSelectedIndex);
|
||||
NS_IMETHOD SetSelectedIndex(PRInt32 aSelectedIndex);
|
||||
NS_IMETHOD SetOption(PRInt32 aIndex, nsIDOMHTMLOptionElement* aOption);
|
||||
NS_IMETHOD Add(nsIDOMHTMLOptionElement* aOption);
|
||||
|
||||
// nsIDOMHTMLCollection interface
|
||||
NS_DECL_NSIDOMHTMLCOLLECTION
|
||||
@ -2396,6 +2397,13 @@ nsHTMLOptionCollection::NamedItem(const nsAString& aName,
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLOptionCollection::Add(nsIDOMHTMLOptionElement *aOption)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNode> ret;
|
||||
return mSelect->AppendChild(aOption, getter_AddRefs(ret));
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLOptionCollection::InsertElementAt(nsIDOMHTMLOptionElement* aOption,
|
||||
PRInt32 aIndex)
|
||||
|
@ -51,4 +51,9 @@ interface nsIDOMNSHTMLOptionCollection : nsISupports
|
||||
|
||||
[noscript] void setOption(in long index,
|
||||
in nsIDOMHTMLOptionElement option);
|
||||
|
||||
// The following exists to give us partial compatibility with the
|
||||
// add method as it exists in IE (we don't yet support the second
|
||||
// argument)
|
||||
void add(in nsIDOMHTMLOptionElement option);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user