diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp index 28dd7e43ec5..466770a2e2b 100644 --- a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp +++ b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp @@ -3577,7 +3577,9 @@ nsGenericHTMLElement::SetElementFocus(PRBool aDoFocus) nsresult nsGenericHTMLElement::Blur() { - SetElementFocus(PR_FALSE); + if (ShouldFocus(this)) { + SetElementFocus(PR_FALSE); + } return NS_OK; } @@ -3588,7 +3590,9 @@ nsGenericHTMLElement::Focus() // Generic HTML elements are focusable only if tabindex explicitly set. // SetFocus() will check to see if we're focusable and then // call into esm to do the work of focusing. - SetElementFocus(PR_TRUE); + if (ShouldFocus(this)) { + SetElementFocus(PR_TRUE); + } return NS_OK; } diff --git a/mozilla/content/html/content/src/nsHTMLAnchorElement.cpp b/mozilla/content/html/content/src/nsHTMLAnchorElement.cpp index d120ecc3a97..d124d67a15c 100644 --- a/mozilla/content/html/content/src/nsHTMLAnchorElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLAnchorElement.cpp @@ -207,7 +207,9 @@ nsHTMLAnchorElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent) NS_IMETHODIMP nsHTMLAnchorElement::Blur() { - SetElementFocus(PR_FALSE); + if (ShouldFocus(this)) { + SetElementFocus(PR_FALSE); + } return NS_OK; } diff --git a/mozilla/content/html/content/src/nsHTMLInputElement.cpp b/mozilla/content/html/content/src/nsHTMLInputElement.cpp index 77b584ebcc9..f75f6194950 100644 --- a/mozilla/content/html/content/src/nsHTMLInputElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLInputElement.cpp @@ -1041,7 +1041,9 @@ nsHTMLInputElement::FireOnChange() NS_IMETHODIMP nsHTMLInputElement::Blur() { - SetElementFocus(PR_FALSE); + if (ShouldFocus(this)) { + SetElementFocus(PR_FALSE); + } return NS_OK; } diff --git a/mozilla/content/html/content/src/nsHTMLSelectElement.cpp b/mozilla/content/html/content/src/nsHTMLSelectElement.cpp index 22c375683e5..b071cf2ea49 100644 --- a/mozilla/content/html/content/src/nsHTMLSelectElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLSelectElement.cpp @@ -1545,7 +1545,9 @@ NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLSelectElement, TabIndex, tabindex, 0) NS_IMETHODIMP nsHTMLSelectElement::Blur() { - SetElementFocus(PR_FALSE); + if (ShouldFocus(this)) { + SetElementFocus(PR_FALSE); + } return NS_OK; } diff --git a/mozilla/content/html/content/src/nsHTMLTextAreaElement.cpp b/mozilla/content/html/content/src/nsHTMLTextAreaElement.cpp index 56855aecd6e..0d5ba41ad43 100644 --- a/mozilla/content/html/content/src/nsHTMLTextAreaElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTextAreaElement.cpp @@ -213,7 +213,9 @@ nsHTMLTextAreaElement::GetForm(nsIDOMHTMLFormElement** aForm) NS_IMETHODIMP nsHTMLTextAreaElement::Blur() { - SetElementFocus(PR_FALSE); + if (ShouldFocus(this)) { + SetElementFocus(PR_FALSE); + } return NS_OK; }