Bug 556007 (1/3) - Add list IDL attribute to HTMLInputElement. r=sicking a2.0=sicking

This commit is contained in:
David Zbarsky 2010-09-10 07:18:10 +02:00
parent 06546aad23
commit 4b77bdf913
3 changed files with 26 additions and 2 deletions

View File

@ -502,6 +502,7 @@ GK_ATOM(level, "level")
GK_ATOM(li, "li")
GK_ATOM(line, "line")
GK_ATOM(link, "link")
GK_ATOM(list, "list")
GK_ATOM(listbox, "listbox")
GK_ATOM(listboxbody, "listboxbody")
GK_ATOM(listcell, "listcell")

View File

@ -1105,6 +1105,28 @@ nsHTMLInputElement::SetValue(const nsAString& aValue)
return NS_OK;
}
NS_IMETHODIMP
nsHTMLInputElement::GetList(nsIDOMHTMLElement** aValue)
{
nsAutoString dataListId;
GetAttr(kNameSpaceID_None, nsGkAtoms::list, dataListId);
if (!dataListId.IsEmpty()) {
nsIDocument* doc = GetCurrentDoc();
if (doc) {
Element* elem = doc->GetElementById(dataListId);
if (elem) {
CallQueryInterface(elem, aValue);
return NS_OK;
}
}
}
*aValue = nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsHTMLInputElement::MozGetFileNameArray(PRUint32 *aLength, PRUnichar ***aFileNames)
{

View File

@ -51,7 +51,7 @@ interface nsIDOMValidityState;
* http://www.w3.org/TR/DOM-Level-2-HTML/
*/
[scriptable, uuid(e5079711-e6a9-4d3a-9b62-b4a8ef08fa7d)]
[scriptable, uuid(613c8e19-53b6-4719-8f6b-3c3e33012536)]
interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
{
attribute DOMString accept;
@ -71,6 +71,7 @@ interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
attribute boolean indeterminate;
readonly attribute nsIDOMHTMLElement list;
attribute long maxLength;
attribute boolean multiple;