diff --git a/layout/generic/nsCanvasFrame.cpp b/layout/generic/nsCanvasFrame.cpp index c60ed389f17f..e99c8c3251d5 100644 --- a/layout/generic/nsCanvasFrame.cpp +++ b/layout/generic/nsCanvasFrame.cpp @@ -24,7 +24,6 @@ #include "nsPrintfCString.h" #include "mozilla/AccessibleCaretEventHub.h" #include "mozilla/ComputedStyle.h" -#include "mozilla/StaticPrefs_browser.h" #include "mozilla/dom/AnonymousContent.h" #include "mozilla/layers/StackingContextHelper.h" #include "mozilla/layers/RenderRootStateManager.h" @@ -517,19 +516,10 @@ void nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, bool needBlendContainer = false; nsDisplayListBuilder::AutoContainerASRTracker contASRTracker(aBuilder); - // In high-contrast-mode, we suppress background-image on the canvas frame - // (even when backplating), because users expect site backgrounds to conform - // to their HCM background color when a solid color is rendered, and some - // websites use solid-color images instead of an overwritable background - // color. - const bool suppressBackgroundImage = - !PresContext()->PrefSheetPrefs().mUseDocumentColors && - StaticPrefs::browser_display_suppress_canvas_background_image_on_forced_colors(); - // Create separate items for each background layer. const nsStyleImageLayers& layers = bg->StyleBackground()->mImage; NS_FOR_VISIBLE_IMAGE_LAYERS_BACK_TO_FRONT(i, layers) { - if (layers.mLayers[i].mImage.IsNone() || suppressBackgroundImage) { + if (layers.mLayers[i].mImage.IsNone()) { continue; } if (layers.mLayers[i].mBlendMode != NS_STYLE_BLEND_NORMAL) { diff --git a/layout/reftests/high-contrast/backplate-bg-image-001-ref.html b/layout/reftests/high-contrast/backplate-bg-image-001-ref.html index 529b5e5ff894..d47cef8940bf 100644 --- a/layout/reftests/high-contrast/backplate-bg-image-001-ref.html +++ b/layout/reftests/high-contrast/backplate-bg-image-001-ref.html @@ -4,7 +4,7 @@ Reference: Text that overlaps a background image should be backplated. -
ppppp ppppp
+ppppp ppppp diff --git a/layout/reftests/high-contrast/backplate-bg-image-001.html b/layout/reftests/high-contrast/backplate-bg-image-001.html index 93be171d9347..4145ae702b40 100644 --- a/layout/reftests/high-contrast/backplate-bg-image-001.html +++ b/layout/reftests/high-contrast/backplate-bg-image-001.html @@ -4,13 +4,11 @@ Text that overlaps a background image should be backplated. -
- ppppp ppppp -
+ppppp ppppp diff --git a/layout/reftests/high-contrast/backplate-bg-image-010-ref.html b/layout/reftests/high-contrast/backplate-bg-image-010-ref.html index 3dd3871cbd15..040e58c639b4 100644 --- a/layout/reftests/high-contrast/backplate-bg-image-010-ref.html +++ b/layout/reftests/high-contrast/backplate-bg-image-010-ref.html @@ -1,20 +1,23 @@ -Reference: Only lines containing visible content (visibility: visible) should receive backplates. - -
+ + + Reference: Only lines containing visible content (visibility: visible) should receive backplates. + + +
AAAA @@ -48,4 +51,5 @@ 4
-
+ + diff --git a/layout/reftests/high-contrast/backplate-bg-image-010.html b/layout/reftests/high-contrast/backplate-bg-image-010.html index 4b4da75693f4..8639d4c2ab52 100644 --- a/layout/reftests/high-contrast/backplate-bg-image-010.html +++ b/layout/reftests/high-contrast/backplate-bg-image-010.html @@ -1,17 +1,20 @@ -Only lines containing visible content (visibility: visible) should receive backplates. - -
+ + + Only lines containing visible content (visibility: visible) should receive backplates. + + +
AAAA -
+ + diff --git a/layout/reftests/high-contrast/backplate-bg-image-011-ref.html b/layout/reftests/high-contrast/backplate-bg-image-011-ref.html index c40375ebdedd..887612ebe279 100644 --- a/layout/reftests/high-contrast/backplate-bg-image-011-ref.html +++ b/layout/reftests/high-contrast/backplate-bg-image-011-ref.html @@ -1,17 +1,20 @@ -Reference: Backplates should not include margins, indentation, padding, border space, or text-alignment space. - -
+ + + Reference: Backplates should not include margins, indentation, padding, border space, or text-alignment space. + + +
div
div w/ margin-left
span w/ margin-left
@@ -22,4 +25,5 @@
div w/ text-align:right
div w/ RTL & text-align:center
div w/ text-indent
-
+ + diff --git a/layout/reftests/high-contrast/backplate-bg-image-011.html b/layout/reftests/high-contrast/backplate-bg-image-011.html index 5215de261f82..bff6f5692afe 100644 --- a/layout/reftests/high-contrast/backplate-bg-image-011.html +++ b/layout/reftests/high-contrast/backplate-bg-image-011.html @@ -1,14 +1,17 @@ -Backplates should not include margins, indentation, padding, border space, or text-alignment space. - -
+ + + Backplates should not include margins, indentation, padding, border space, or text-alignment space. + + +
div
div w/ margin-left
span w/ margin-left
@@ -19,4 +22,5 @@
div w/ text-align:right
div w/ RTL & text-align:center
div w/ text-indent
-
+ + diff --git a/layout/reftests/high-contrast/backplate-bg-image-012-ref.html b/layout/reftests/high-contrast/backplate-bg-image-012-ref.html index dcd37d11d502..e5c6c3d0a5b6 100644 --- a/layout/reftests/high-contrast/backplate-bg-image-012-ref.html +++ b/layout/reftests/high-contrast/backplate-bg-image-012-ref.html @@ -1,21 +1,25 @@ -Reference: Empty canvas objects and images that do not share lines with text should not receive backplates. - -
+ + + Reference: Empty canvas objects and images that do not share lines with text should not receive backplates. + + +

Here is some alt text -
+ + diff --git a/layout/reftests/high-contrast/backplate-bg-image-012.html b/layout/reftests/high-contrast/backplate-bg-image-012.html index b7f358fb36bc..e74457e340e1 100644 --- a/layout/reftests/high-contrast/backplate-bg-image-012.html +++ b/layout/reftests/high-contrast/backplate-bg-image-012.html @@ -1,18 +1,22 @@ -Empty canvas objects and images that do not share lines with text should not receive backplates. - -
+ + + Empty canvas objects and images that do not share lines with text should not receive backplates. + + +

Here is some alt text -
+ + diff --git a/layout/reftests/high-contrast/bg-image-root-001-ref.html b/layout/reftests/high-contrast/bg-image-root-001-ref.html deleted file mode 100644 index c50eddd41fab..000000000000 --- a/layout/reftests/high-contrast/bg-image-root-001-ref.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/layout/reftests/high-contrast/bg-image-root-001.html b/layout/reftests/high-contrast/bg-image-root-001.html deleted file mode 100644 index 7dca7966d1c8..000000000000 --- a/layout/reftests/high-contrast/bg-image-root-001.html +++ /dev/null @@ -1,7 +0,0 @@ - -background-image on canvas is ignored if in high-contrast - diff --git a/layout/reftests/high-contrast/reftest.list b/layout/reftests/high-contrast/reftest.list index 57dd6833acfb..9a9a92440e83 100644 --- a/layout/reftests/high-contrast/reftest.list +++ b/layout/reftests/high-contrast/reftest.list @@ -7,7 +7,7 @@ default-preferences test-pref(browser.display.document_color_use,2) test-pref(br # https://bugzilla.mozilla.org/show_bug.cgi?id=1539212#c25 == backplate-select-001.html backplate-select-001-ref.html -fuzzy-if(cocoaWidget,255-255,20-20) == backplate-bg-image-001.html backplate-bg-image-001-ref.html # bug 1577028 +fuzzy-if(cocoaWidget,255-255,40-40) == backplate-bg-image-001.html backplate-bg-image-001-ref.html # bug 1577028 fuzzy-if(cocoaWidget,255-255,20-20) == backplate-bg-image-002.html backplate-bg-image-002-ref.html fuzzy-if(cocoaWidget,255-255,4-4) == backplate-bg-image-003.html backplate-bg-image-003-ref.html fuzzy-if(cocoaWidget,255-255,20-20) == backplate-bg-image-004.html backplate-bg-image-004-ref.html @@ -16,12 +16,9 @@ fuzzy-if(cocoaWidget,255-255,2912-2912) fuzzy-if(gtkWidget,13-13,3200-3200) fuzz fuzzy-if(cocoaWidget,255-255,40-40) == backplate-bg-image-007.html backplate-bg-image-007-ref.html fuzzy-if(cocoaWidget,255-255,20-20) == backplate-bg-image-008.html backplate-bg-image-008-ref.html fuzzy-if(cocoaWidget,255-255,20-20) == backplate-bg-image-009.html backplate-bg-image-009-ref.html -fuzzy-if(cocoaWidget,255-255,1495-1495) fuzzy-if(winWidget,255-255,353-353) fuzzy-if(Android,255-255,700-700) == backplate-bg-image-010.html backplate-bg-image-010-ref.html -fuzzy-if(cocoaWidget,255-255,288-320) == backplate-bg-image-011.html backplate-bg-image-011-ref.html -fuzzy-if(cocoaWidget,255-255,16-16) == backplate-bg-image-012.html backplate-bg-image-012-ref.html - -test-pref(browser.display.suppress_canvas_background_image_on_forced_colors,true) == bg-image-root-001.html bg-image-root-001-ref.html -test-pref(browser.display.suppress_canvas_background_image_on_forced_colors,false) != bg-image-root-001.html bg-image-root-001-ref.html +fuzzy-if(cocoaWidget,255-255,1578-1578) fuzzy-if(winWidget,255-255,353-353) fuzzy-if(Android,255-255,700-700) == backplate-bg-image-010.html backplate-bg-image-010-ref.html +fuzzy-if(cocoaWidget,255-255,316-320) == backplate-bg-image-011.html backplate-bg-image-011-ref.html +fuzzy-if(cocoaWidget,255-255,32-32) == backplate-bg-image-012.html backplate-bg-image-012-ref.html fails-if(Android) needs-focus == selection-001.html selection-001-ref.html # bug 1602509 pref(browser.display.document_color_use,0) needs-focus != selection-001.html selection-001-ref.html diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 65ffe1bb790d..6e730f6edae9 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -816,18 +816,6 @@ mirror: always rust: true -# Whether we should suppress the background-image of the canvas (the root -# frame) if we're in forced colors mode. -# -# This is important because some sites use background-image with a plain color -# and it causes undesirable results in high-contrast mode. -# -# See bug 1614921 for example. -- name: browser.display.suppress_canvas_background_image_on_forced_colors - type: bool - value: true - mirror: always - - name: browser.display.focus_ring_on_anything type: bool value: false