diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 9456e5489e53..b3786808d7e1 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -2373,18 +2373,13 @@ already_AddRefed nsIFrame::ComputeSelectionStyle( aSelectionStatus != nsISelectionController::SELECTION_DISABLED) { return nullptr; } - // When in high-contrast mode, the style system ends up ignoring the color - // declarations, which means that the ::selection style becomes the inherited - // color, and default background. That's no good. - if (!PresContext()->PrefSheetPrefs().mUseDocumentColors) { - return nullptr; - } Element* element = FindElementAncestorForMozSelection(GetContent()); if (!element) { return nullptr; } - return PresContext()->StyleSet()->ProbePseudoElementStyle( + RefPtr sc = PresContext()->StyleSet()->ProbePseudoElementStyle( *element, PseudoStyleType::selection, Style()); + return sc.forget(); } /******************************************************** diff --git a/layout/reftests/high-contrast/reftest.list b/layout/reftests/high-contrast/reftest.list index 8bf94a2cfd56..396b8bd5c368 100644 --- a/layout/reftests/high-contrast/reftest.list +++ b/layout/reftests/high-contrast/reftest.list @@ -2,7 +2,7 @@ default-preferences test-pref(browser.display.document_color_use,2) test-pref(browser.display.permit_backplate,true) # There are several platform-specific fuzzy-if notations below due to -# anti-aliasing, extra visual overflow, and slightly inacurate reftest +# anti-aliasing, extra visual overflow, and slightly inacurrate reftest # mocking. You can read more about the annotations and their specifics here: # https://bugzilla.mozilla.org/show_bug.cgi?id=1539212#c25 @@ -16,6 +16,3 @@ fuzzy-if(cocoaWidget,255-255,52-52) fuzzy-if(winWidget,15-15,48-48) == backplate fuzzy-if(cocoaWidget,255-255,2842-2842) fuzzy-if(gtkWidget,255-255,620-620) fuzzy-if(winWidget||Android,255-255,480-481) == backplate-bg-image-008.html backplate-bg-image-008-ref.html fuzzy-if(cocoaWidget,255-255,504-504) fuzzy-if(gtkWidget,255-255,1050-1050) fuzzy-if(winWidget||Android,255-255,480-480) == backplate-bg-image-009.html backplate-bg-image-009-ref.html fuzzy-if(cocoaWidget,255-255,621-621) fuzzy-if(winWidget,255-255,128-128) fuzzy-if(Android,255-255,240-240) == backplate-bg-image-010.html backplate-bg-image-010-ref.html - -== selection-001.html selection-001-ref.html -pref(browser.display.document_color_use,0) != selection-001.html selection-001-ref.html diff --git a/layout/reftests/high-contrast/selection-001-ref.html b/layout/reftests/high-contrast/selection-001-ref.html deleted file mode 100644 index 045f00c05ed5..000000000000 --- a/layout/reftests/high-contrast/selection-001-ref.html +++ /dev/null @@ -1,13 +0,0 @@ - -Test reference -

- Some selected text -

- diff --git a/layout/reftests/high-contrast/selection-001.html b/layout/reftests/high-contrast/selection-001.html deleted file mode 100644 index 118b520d11a3..000000000000 --- a/layout/reftests/high-contrast/selection-001.html +++ /dev/null @@ -1,19 +0,0 @@ - -::selection should use native colors in high contrast mode - -

- Some selected text -

-