diff -r 4ed163dabf93 layout/base/nsPresContext.cpp --- a/layout/base/nsPresContext.cpp Wed Oct 01 17:09:21 2008 -0700 +++ b/layout/base/nsPresContext.cpp Thu Oct 02 00:48:12 2008 -0400 @@ -655,6 +655,9 @@ nsPresContext::GetUserPreferences() nsContentUtils::GetBoolPref("browser.display.focus_ring_on_anything", mFocusRingOnAnything); + mFocusRingStyle = + nsContentUtils::GetIntPref("browser.display.focus_ring_style", + mFocusRingStyle); // * use fonts? mUseDocumentFonts = nsContentUtils::GetIntPref("browser.display.use_document_fonts") != 0; diff -r 4ed163dabf93 layout/base/nsPresContext.h --- a/layout/base/nsPresContext.h Wed Oct 01 17:09:21 2008 -0700 +++ b/layout/base/nsPresContext.h Thu Oct 02 00:48:12 2008 -0400 @@ -373,7 +373,8 @@ public: PRBool GetUseFocusColors() const { return mUseFocusColors; } PRUint8 FocusRingWidth() const { return mFocusRingWidth; } PRBool GetFocusRingOnAnything() const { return mFocusRingOnAnything; } - + PRUint8 GetFocusRingStyle() const { return mFocusRingStyle; } + /** * Set up observers so that aTargetFrame will be invalidated when @@ -893,6 +894,7 @@ protected: unsigned mUnderlineLinks : 1; unsigned mUseFocusColors : 1; unsigned mFocusRingOnAnything : 1; + unsigned mFocusRingStyle : 1; unsigned mDrawImageBackground : 1; unsigned mDrawColorBackground : 1; unsigned mNeverAnimate : 1; diff -r 4ed163dabf93 layout/base/nsPresShell.cpp --- a/layout/base/nsPresShell.cpp Wed Oct 01 17:09:21 2008 -0700 +++ b/layout/base/nsPresShell.cpp Thu Oct 02 00:48:12 2008 -0400 @@ -2089,6 +2089,7 @@ nsresult PresShell::SetPrefFocusRules(vo } PRUint8 focusRingWidth = mPresContext->FocusRingWidth(); PRBool focusRingOnAnything = mPresContext->GetFocusRingOnAnything(); + PRUint8 focusRingStyle = mPresContext->GetFocusRingStyle(); if ((NS_SUCCEEDED(result) && focusRingWidth != 1 && focusRingWidth <= 4 ) || focusRingOnAnything) { PRUint32 index = 0; @@ -2097,7 +2098,10 @@ nsresult PresShell::SetPrefFocusRules(vo strRule.AppendLiteral("*|*:link:focus, *|*:visited"); // If we only want focus rings on the normal things like links strRule.AppendLiteral(":focus {outline: "); // For example 3px dotted WindowText (maximum 4) strRule.AppendInt(focusRingWidth); - strRule.AppendLiteral("px dotted WindowText !important; } "); // For example 3px dotted WindowText + if (focusRingStyle == 0) // solid + strRule.AppendLiteral("px solid -moz-mac-focusring !important; -moz-outline-radius: 3px; -moz-outline-offset: 1px; } "); + else // dotted + strRule.AppendLiteral("px dotted WindowText !important; } "); // insert the rules result = mPrefStyleSheet-> InsertRuleInternal(strRule, sInsertPrefSheetRulesAt, &index); @@ -2108,7 +2112,10 @@ nsresult PresShell::SetPrefFocusRules(vo strRule.AppendLiteral("input[type=\"button\"]::-moz-focus-inner, "); strRule.AppendLiteral("input[type=\"submit\"]::-moz-focus-inner { padding: 1px 2px 1px 2px; border: "); strRule.AppendInt(focusRingWidth); - strRule.AppendLiteral("px dotted transparent !important; } "); + if (focusRingStyle == 0) // solid + strRule.AppendLiteral("px solid transparent !important; } "); + else + strRule.AppendLiteral("px dotted transparent !important; } "); result = mPrefStyleSheet-> InsertRuleInternal(strRule, sInsertPrefSheetRulesAt, &index); NS_ENSURE_SUCCESS(result, result); diff -r 4ed163dabf93 modules/libpref/src/init/all.js --- a/modules/libpref/src/init/all.js Wed Oct 01 17:09:21 2008 -0700 +++ b/modules/libpref/src/init/all.js Thu Oct 02 00:48:13 2008 -0400 @@ -113,6 +113,9 @@ pref("browser.display.focus_text_color", pref("browser.display.focus_text_color", "#ffffff"); pref("browser.display.focus_ring_width", 1); pref("browser.display.focus_ring_on_anything", false); +// focus ring border style. +// 0 = solid border, 1 = dotted border +pref("browser.display.focus_ring_style", 1); pref("browser.helperApps.alwaysAsk.force", false); pref("browser.helperApps.neverAsk.saveToDisk", "");