From b8280e301397e3aff8ba367e660cc801c03fedb4 Mon Sep 17 00:00:00 2001 From: "masayuki%d-toybox.com" Date: Sun, 22 May 2005 17:17:46 +0000 Subject: [PATCH] Bug 289652 [regression] -moz-selection fails to work r+sr=bzbarsky, a=asa git-svn-id: svn://10.0.0.236/trunk@173684 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsTextFrame.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index 31c0ec2661c..0e107fbbdfa 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -1306,12 +1306,7 @@ DrawSelectionIterator::GetSelectionColors(nscolor *aForeColor, return PR_FALSE; } - PRBool dontChangeTextColor = mOldStyle.mSelectionTextColor == NS_DONT_CHANGE_COLOR; - - // If the selection text color is NS_DONT_CHANGE_COLOR, - // we don't accept the ::selection pseudo element. - if (!dontChangeTextColor && - mSelectionPseudoStyle && + if (mSelectionPseudoStyle && mSelectionStatus == nsISelectionController::SELECTION_ON) { *aForeColor = mSelectionPseudoFGcolor; *aBackColor = mSelectionPseudoBGcolor; @@ -1319,6 +1314,9 @@ DrawSelectionIterator::GetSelectionColors(nscolor *aForeColor, return PR_TRUE; } + PRBool dontChangeTextColor = + mOldStyle.mSelectionTextColor == NS_DONT_CHANGE_COLOR; + if (dontChangeTextColor) *aForeColor = mOldStyle.mColor->mColor; else