Bug 654411 - Use text color at 50% opacity instead of graytext to de-emphasize text in the location bar. r=roc ui-r=faaborg
authorDão Gottwald <dao@mozilla.com>
Fri, 17 Jun 2011 08:07:03 +0200
changeset 71711 306bdc7101c3c645083b51366831ce1498ee95bf
parent 71710 c68a54bad24ecec4236781915f44663dbfa9dcd8
child 71752 9ac190a247ad0148909c05389079db1c1e379ff4
push id159
push usereakhgari@mozilla.com
push dateTue, 16 Aug 2011 17:53:11 +0000
treeherdermozilla-beta@8786e3e49240 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, faaborg
bugs654411
milestone7.0a1
first release with
nightly linux32
306bdc7101c3 / 7.0a1 / 20110617030741 / files
nightly linux64
306bdc7101c3 / 7.0a1 / 20110617030741 / files
nightly mac
306bdc7101c3 / 7.0a1 / 20110617030741 / files
nightly win32
306bdc7101c3 / 7.0a1 / 20110617030741 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 654411 - Use text color at 50% opacity instead of graytext to de-emphasize text in the location bar. r=roc ui-r=faaborg
layout/generic/nsTextFrameThebes.cpp
--- a/layout/generic/nsTextFrameThebes.cpp
+++ b/layout/generic/nsTextFrameThebes.cpp
@@ -3317,20 +3317,24 @@ nsTextPaintStyle::GetHighlightColors(nsc
   *aBackColor = backColor;
 }
 
 void
 nsTextPaintStyle::GetURLSecondaryColor(nscolor* aForeColor)
 {
   NS_ASSERTION(aForeColor, "aForeColor is null");
 
-  nsILookAndFeel* look = mPresContext->LookAndFeel();
-  nscolor foreColor;
-  look->GetColor(nsILookAndFeel::eColor_graytext, foreColor);
-  *aForeColor = foreColor;
+  nscolor textColor = GetTextColor();
+  textColor = NS_RGBA(NS_GET_R(textColor),
+                      NS_GET_G(textColor),
+                      NS_GET_B(textColor),
+                      (PRUint8)(255 * 0.5f));
+  // Don't use true alpha color for readability.
+  InitCommonColors();
+  *aForeColor = NS_ComposeColors(mFrameBackgroundColor, textColor);
 }
 
 void
 nsTextPaintStyle::GetIMESelectionColors(PRInt32  aIndex,
                                         nscolor* aForeColor,
                                         nscolor* aBackColor)
 {
   NS_ASSERTION(aForeColor, "aForeColor is null");