Bug 1384691 - Unconditionally set mHasSelectionShadow when -moz-selection pseudo element is used. r?jfkthame
The HasAuthorSpecifiedRules check was from the initial implementation
of text-shadow support on ::-moz-selection in bug721750. There doesn't
seem to be anything mentioning why this check is necessary.
Also given text-shadow is inherited by default, it doesn't seems this
change would lead to any difference.
MozReview-Commit-ID: 6Qbotdxykwi
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -4108,32 +4108,18 @@ nsTextPaintStyle::InitSelectionColorsAnd
CSSPseudoElementType::mozSelection,
mFrame->StyleContext());
// Use -moz-selection pseudo class.
if (sc) {
mSelectionBGColor =
sc->GetVisitedDependentColor(&nsStyleBackground::mBackgroundColor);
mSelectionTextColor =
sc->GetVisitedDependentColor(&nsStyleText::mWebkitTextFillColor);
- if (auto* geckoStyleContext = sc->GetAsGecko()) {
- mHasSelectionShadow =
- nsRuleNode::HasAuthorSpecifiedRules(geckoStyleContext,
- NS_AUTHOR_SPECIFIED_TEXT_SHADOW,
- true);
- } else {
- NS_WARNING("stylo: Need a way to get HasAuthorSpecifiedRules from a "
- "raw style context");
- // Or at least an element and a pseudo-style, which is probably a bit
- // more doable, since we know that, at least when not in the presence of
- // first-line / first-letter, we're inheriting from selectionElement.
- mHasSelectionShadow = true;
- }
- if (mHasSelectionShadow) {
- mSelectionShadow = sc->StyleText()->mTextShadow;
- }
+ mHasSelectionShadow = true;
+ mSelectionShadow = sc->StyleText()->mTextShadow;
return true;
}
}
nscolor selectionBGColor =
LookAndFeel::GetColor(LookAndFeel::eColorID_TextSelectBackground);
if (selectionStatus == nsISelectionController::SELECTION_ATTENTION) {