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