Add Get/Set Autocomplete methods

This commit is contained in:
ducarroz%netscape.com 1999-08-19 22:10:56 +00:00
parent 81ec943f78
commit 5be0405534
2 changed files with 76 additions and 0 deletions

View File

@ -104,6 +104,8 @@ public:
NS_IMETHOD SetUseMap(const nsString& aUseMap);
NS_IMETHOD GetValue(nsString& aValue);
NS_IMETHOD SetValue(const nsString& aValue);
NS_IMETHOD GetAutocomplete(nsString& aAutocomplete);
NS_IMETHOD SetAutocomplete(const nsString& aAutocomplete);
NS_IMETHOD Blur();
NS_IMETHOD Focus();
NS_IMETHOD Select();
@ -360,6 +362,42 @@ nsHTMLInputElement::SetValue(const nsString& aValue)
return mInner.SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::value, aValue, PR_TRUE);
}
NS_IMETHODIMP
nsHTMLInputElement::GetAutocomplete(nsString& aAutocomplete)
{
PRInt32 type;
GetType(&type);
if (NS_FORM_INPUT_TEXT == type) {
nsIFormControlFrame* formControlFrame = nsnull;
if (NS_SUCCEEDED(nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame))) {
if (nsnull != formControlFrame) {
formControlFrame->GetProperty(nsHTMLAtoms::autocomplete, aAutocomplete);
}
}
}
else
aAutocomplete = "";
return NS_OK;
}
NS_IMETHODIMP
nsHTMLInputElement::SetAutocomplete(const nsString& aAutocomplete)
{
PRInt32 type;
GetType(&type);
if (NS_FORM_INPUT_TEXT == type) {
nsIFormControlFrame* formControlFrame = nsnull;
if (NS_SUCCEEDED(nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame))) {
if (nsnull != formControlFrame ) {
formControlFrame->SetProperty(nsHTMLAtoms::autocomplete, aAutocomplete);
}
}
}
return NS_OK;
}
NS_IMETHODIMP
nsHTMLInputElement::GetChecked(PRBool* aValue)
{

View File

@ -104,6 +104,8 @@ public:
NS_IMETHOD SetUseMap(const nsString& aUseMap);
NS_IMETHOD GetValue(nsString& aValue);
NS_IMETHOD SetValue(const nsString& aValue);
NS_IMETHOD GetAutocomplete(nsString& aAutocomplete);
NS_IMETHOD SetAutocomplete(const nsString& aAutocomplete);
NS_IMETHOD Blur();
NS_IMETHOD Focus();
NS_IMETHOD Select();
@ -360,6 +362,42 @@ nsHTMLInputElement::SetValue(const nsString& aValue)
return mInner.SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::value, aValue, PR_TRUE);
}
NS_IMETHODIMP
nsHTMLInputElement::GetAutocomplete(nsString& aAutocomplete)
{
PRInt32 type;
GetType(&type);
if (NS_FORM_INPUT_TEXT == type) {
nsIFormControlFrame* formControlFrame = nsnull;
if (NS_SUCCEEDED(nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame))) {
if (nsnull != formControlFrame) {
formControlFrame->GetProperty(nsHTMLAtoms::autocomplete, aAutocomplete);
}
}
}
else
aAutocomplete = "";
return NS_OK;
}
NS_IMETHODIMP
nsHTMLInputElement::SetAutocomplete(const nsString& aAutocomplete)
{
PRInt32 type;
GetType(&type);
if (NS_FORM_INPUT_TEXT == type) {
nsIFormControlFrame* formControlFrame = nsnull;
if (NS_SUCCEEDED(nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame))) {
if (nsnull != formControlFrame ) {
formControlFrame->SetProperty(nsHTMLAtoms::autocomplete, aAutocomplete);
}
}
}
return NS_OK;
}
NS_IMETHODIMP
nsHTMLInputElement::GetChecked(PRBool* aValue)
{