From cd4bcd65ff834a12e999dada1aa0c8ff30104dcb Mon Sep 17 00:00:00 2001 From: "bryner%brianryner.com" Date: Fri, 21 Apr 2006 02:11:59 +0000 Subject: [PATCH] Fix focus-stealing for button elements (bug 299677). Patch by darin, r=me sr=dveditz b181=me. git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@195030 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/html/content/src/nsHTMLButtonElement.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mozilla/content/html/content/src/nsHTMLButtonElement.cpp b/mozilla/content/html/content/src/nsHTMLButtonElement.cpp index c23a2a9fa50..4cea0da78c6 100644 --- a/mozilla/content/html/content/src/nsHTMLButtonElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLButtonElement.cpp @@ -172,7 +172,9 @@ NS_IMPL_STRING_ATTR_DEFAULT_VALUE(nsHTMLButtonElement, Type, type, "submit") NS_IMETHODIMP nsHTMLButtonElement::Blur() { - SetElementFocus(PR_FALSE); + if (ShouldFocus(this)) { + SetElementFocus(PR_FALSE); + } return NS_OK; }