summaryrefslogtreecommitdiffstats
path: root/layout/generic
diff options
context:
space:
mode:
Diffstat (limited to 'layout/generic')
-rw-r--r--layout/generic/nsTextFrame.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp
index fcce7f3f6..4decdc8ec 100644
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -3947,11 +3947,18 @@ nsTextPaintStyle::InitSelectionColorsAndShadow()
if (selectionElement &&
selectionStatus == nsISelectionController::SELECTION_ON) {
RefPtr<nsStyleContext> sc = nullptr;
+ // Probe for both selection and -moz-selection
sc = mPresContext->StyleSet()->
ProbePseudoElementStyle(selectionElement,
- CSSPseudoElementType::mozSelection,
+ CSSPseudoElementType::selection,
mFrame->StyleContext());
- // Use -moz-selection pseudo class.
+ if (!sc) {
+ sc = mPresContext->StyleSet()->
+ ProbePseudoElementStyle(selectionElement,
+ CSSPseudoElementType::mozSelection,
+ mFrame->StyleContext());
+ }
+ // Use selection pseudo class.
if (sc) {
mSelectionBGColor =
sc->GetVisitedDependentColor(eCSSProperty_background_color);