Bug 566128. 'action' IDL attribute should reflect content attribute. r=sicking

This commit is contained in:
Mounir Lamouri 2010-06-01 11:45:25 +12:00
Родитель 16916eaa39
Коммит a343d9b2d0
1 изменённых файлов: 6 добавлений и 18 удалений

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

@ -353,28 +353,12 @@ nsHTMLFormElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
}
NS_IMPL_STRING_ATTR(nsHTMLFormElement, AcceptCharset, acceptcharset)
NS_IMPL_STRING_ATTR(nsHTMLFormElement, Action, action)
NS_IMPL_STRING_ATTR(nsHTMLFormElement, Enctype, enctype)
NS_IMPL_STRING_ATTR(nsHTMLFormElement, Method, method)
NS_IMPL_STRING_ATTR(nsHTMLFormElement, Name, name)
NS_IMPL_STRING_ATTR(nsHTMLFormElement, Target, target)
NS_IMETHODIMP
nsHTMLFormElement::GetAction(nsAString& aValue)
{
GetAttr(kNameSpaceID_None, nsGkAtoms::action, aValue);
if (aValue.IsEmpty()) {
// Avoid resolving action="" to the base uri, bug 297761.
return NS_OK;
}
return GetURIAttr(nsGkAtoms::action, nsnull, aValue);
}
NS_IMETHODIMP
nsHTMLFormElement::SetAction(const nsAString& aValue)
{
return SetAttr(kNameSpaceID_None, nsGkAtoms::action, aValue, PR_TRUE);
}
NS_IMETHODIMP
nsHTMLFormElement::Submit()
{
@ -1338,7 +1322,11 @@ nsHTMLFormElement::GetActionURL(nsIURI** aActionURL)
// Grab the URL string
//
nsAutoString action;
GetAction(action);
GetAttr(kNameSpaceID_None, nsGkAtoms::action, action);
// Avoid resolving action="" to the base uri, bug 297761.
if (!action.IsEmpty()) {
GetURIAttr(nsGkAtoms::action, nsnull, action);
}
//
// Form the full action URL