diff options
author | Moonchild <moonchild@palemoon.org> | 2020-10-19 19:35:03 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-10-20 09:49:51 +0000 |
commit | fe57f39a18340dd6049edaac729e8d70ed97de16 (patch) | |
tree | f09f4243b691c447df8d5f26c683df645d9113d8 /layout/generic | |
parent | 46331793269f1c28b2eb738489708653bb4ca75a (diff) | |
download | aura-central-fe57f39a18340dd6049edaac729e8d70ed97de16.tar.gz |
Issue mcp-graveyard/UXP%1671 - Unprefix ::-moz-selection
This actually keeps both pseudo-elements for now, since the prefixed version is
still used internally, but we need the unprefixed version for web compat.
Note: while unprefixing a non-spec-compliant pseudo here, it's exactly in line
with what other browsers do. Nobody is following the spec here and at least
we'll be doing what everyone else is with our unprefixed version.
Diffstat (limited to 'layout/generic')
-rw-r--r-- | layout/generic/nsTextFrame.cpp | 11 |
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); |