Make HTMLButtonElement.type writable. Bug 228174, r+sr=jst

This commit is contained in:
bzbarsky%mit.edu 2004-01-06 17:22:08 +00:00
Родитель db378ea4f9
Коммит a98357b26a
3 изменённых файлов: 18 добавлений и 2 удалений

Просмотреть файл

@ -84,7 +84,12 @@ public:
NS_DECL_NSIDOMHTMLBUTTONELEMENT
// nsIDOMNSHTMLButtonElement
NS_DECL_NSIDOMNSHTMLBUTTONELEMENT
// Can't just use the macro, since it shares GetType with
// nsIDOMHTMLButtonElement
NS_IMETHOD Blur();
NS_IMETHOD Focus();
NS_IMETHOD Click();
NS_IMETHOD SetType(const nsAString& aType);
// overrided nsIFormControl method
NS_IMETHOD_(PRInt32) GetType() { return mType; }
@ -259,6 +264,13 @@ nsHTMLButtonElement::GetType(nsAString& aType)
aType);
}
NS_IMETHODIMP
nsHTMLButtonElement::SetType(const nsAString& aType)
{
return SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, aType, PR_TRUE);
}
NS_IMPL_STRING_ATTR(nsHTMLButtonElement, AccessKey, accesskey)
NS_IMPL_BOOL_ATTR(nsHTMLButtonElement, Disabled, disabled)
NS_IMPL_STRING_ATTR(nsHTMLButtonElement, Name, name)

Просмотреть файл

@ -58,6 +58,9 @@ interface nsIDOMHTMLButtonElement : nsIDOMHTMLElement
attribute boolean disabled;
attribute DOMString name;
attribute long tabIndex;
readonly attribute DOMString type;
// The scriptable version of type is writable and lives on
// nsIDOMNSHTMLButtonElement (have to do it this way because this
// interface is frozen and we don't want to break binary compat).
[noscript] readonly attribute DOMString type;
attribute DOMString value;
};

Просмотреть файл

@ -46,4 +46,5 @@ interface nsIDOMNSHTMLButtonElement : nsISupports
void blur();
void focus();
void click();
attribute DOMString type;
};