Fix for bug 22264. r=hyatt

This commit is contained in:
saari%netscape.com 2000-01-29 04:05:03 +00:00
parent 889fb4dea4
commit d9e9b714fd
2 changed files with 12 additions and 10 deletions

View File

@ -618,17 +618,18 @@ nsHTMLInputElement::Focus()
NS_IMETHODIMP
nsHTMLInputElement::SetFocus(nsIPresContext* aPresContext)
{
// first see if we are disabled or not. If disabled then do nothing.
nsAutoString disabled;
if (NS_CONTENT_ATTR_HAS_VALUE == mInner.GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::disabled, disabled))
return NS_OK;
nsIEventStateManager* esm;
if (NS_OK == aPresContext->GetEventStateManager(&esm)) {
esm->SetContentState(this, NS_EVENT_STATE_FOCUS);
NS_RELEASE(esm);
}
// first see if we are disabled or not. If disabled then do nothing.
nsAutoString disabled;
if (NS_CONTENT_ATTR_HAS_VALUE == mInner.GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::disabled, disabled)) {
return NS_OK;
}
nsIFormControlFrame* formControlFrame = nsnull;
nsresult rv = nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame);
if (NS_SUCCEEDED(rv)) {

View File

@ -618,17 +618,18 @@ nsHTMLInputElement::Focus()
NS_IMETHODIMP
nsHTMLInputElement::SetFocus(nsIPresContext* aPresContext)
{
// first see if we are disabled or not. If disabled then do nothing.
nsAutoString disabled;
if (NS_CONTENT_ATTR_HAS_VALUE == mInner.GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::disabled, disabled))
return NS_OK;
nsIEventStateManager* esm;
if (NS_OK == aPresContext->GetEventStateManager(&esm)) {
esm->SetContentState(this, NS_EVENT_STATE_FOCUS);
NS_RELEASE(esm);
}
// first see if we are disabled or not. If disabled then do nothing.
nsAutoString disabled;
if (NS_CONTENT_ATTR_HAS_VALUE == mInner.GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::disabled, disabled)) {
return NS_OK;
}
nsIFormControlFrame* formControlFrame = nsnull;
nsresult rv = nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame);
if (NS_SUCCEEDED(rv)) {