Backed out 2 changesets (bug 1614921) for causing reftest failures at layout/reftests/high-contrast/backplate-bg-image-001.html

Backed out changeset 1221e1369f08 (bug 1614921)
Backed out changeset 0551e1798d61 (bug 1614921)

--HG--
extra : rebase_source : 0781cc7d28bbc49af8a2a111a4449e71e1484bce
This commit is contained in:
Daniel Varga 2020-02-20 06:32:00 +02:00
parent b83fb2379a
commit 8ae244478e
13 changed files with 116 additions and 127 deletions

View File

@ -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) {

View File

@ -4,7 +4,7 @@
<link rel="stylesheet" type="text/css" href="ahem.css" />
<title>Reference: Text that overlaps a background image should be backplated.</title>
<style>
div {
body {
font: 20px Ahem;
background-image: linear-gradient(blue, blue);
}
@ -21,5 +21,5 @@
* discussion on bug 1577028.) */
</style>
</head>
<div><span class="fake-backplate">ppppp ppppp </span></div>
<body><span class="fake-backplate">ppppp ppppp </span></body>
</html>

View File

@ -4,13 +4,11 @@
<link rel="stylesheet" type="text/css" href="ahem.css" />
<title>Text that overlaps a background image should be backplated.</title>
<style>
div {
body {
font: 20px Ahem;
background-image: linear-gradient(blue, blue);
}
</style>
</head>
<div>
ppppp ppppp
</div>
<body>ppppp ppppp</body>
</html>

View File

@ -1,20 +1,23 @@
<!DOCTYPE html>
<title>Reference: Only lines containing visible content (visibility: visible) should receive backplates.</title>
<style>
.outer {
background-image: linear-gradient(blue, blue);
}
.hidden {
visibility: hidden;
}
.visible {
visibility: visible;
}
.fake-backplate {
background-color: white;
}
</style>
<div class="outer">
<html>
<head>
<title>Reference: Only lines containing visible content (visibility: visible) should receive backplates.</title>
<style>
body {
background-image: linear-gradient(blue, blue);
}
.hidden {
visibility: hidden;
}
.visible {
visibility: visible;
}
.fake-backplate {
background-color: white;
}
</style>
</head>
<body>
<div>
<span class="fake-backplate">AAAA</span>
<div class="hidden">BBBB</div>
@ -48,4 +51,5 @@
4
</span>
</div>
</div>
</body>
</html>

View File

@ -1,17 +1,20 @@
<!DOCTYPE html>
<title>Only lines containing visible content (visibility: visible) should receive backplates.</title>
<style>
.outer {
background-image: linear-gradient(blue, blue);
}
.hidden {
visibility: hidden;
}
.visible {
visibility: visible;
}
</style>
<div class="outer">
<html>
<head>
<title>Only lines containing visible content (visibility: visible) should receive backplates.</title>
<style>
body {
background-image: linear-gradient(blue, blue);
}
.hidden {
visibility: hidden;
}
.visible {
visibility: visible;
}
</style>
</head>
<body>
<div>
AAAA<!-- no whitespace between elements
--><div class="hidden">BBBB</div><!-- no whitespace between elements
@ -43,4 +46,5 @@
</span>
4<!-- no whitespace between elements
--></span>
</div>
</body>
</html>

View File

@ -1,17 +1,20 @@
<!DOCTYPE html>
<title>Reference: Backplates should not include margins, indentation, padding, border space, or text-alignment space.</title>
<style>
.outer {
background: linear-gradient(blue,blue);
}
div {
margin-bottom: 30px;
}
.fake-backplate {
background-color: white;
}
</style>
<div class="outer">
<html>
<head>
<title>Reference: Backplates should not include margins, indentation, padding, border space, or text-alignment space.</title>
<style>
body {
background:linear-gradient(blue,blue);
}
div {
margin-bottom: 30px;
}
.fake-backplate {
background-color: white;
}
</style>
</head>
<body>
<div><span class="fake-backplate">div</span></div>
<div style="margin-left: 30px"><span class="fake-backplate">div w/ margin-left</span></div>
<div><span style="margin-left: 100px" class="fake-backplate">span w/ margin-left</span></div>
@ -22,4 +25,5 @@
<div style="text-align: right"><span class="fake-backplate">div w/ text-align:right</span></div>
<div style="direction: rtl; text-align: center"><span class="fake-backplate">div w/ RTL &amp; text-align:center</span></div>
<div style="text-indent: 200px"><span class="fake-backplate">div w/ text-indent</span></div>
</div>
</body></html>

View File

@ -1,14 +1,17 @@
<!DOCTYPE html>
<title>Backplates should not include margins, indentation, padding, border space, or text-alignment space.</title>
<style>
.outer {
background:linear-gradient(blue,blue);
}
div {
margin-bottom: 30px;
}
</style>
<div class="outer">
<html>
<head>
<title>Backplates should not include margins, indentation, padding, border space, or text-alignment space.</title>
<style>
body {
background:linear-gradient(blue,blue);
}
div {
margin-bottom: 30px;
}
</style>
</head>
<body>
<div>div</div>
<div style="margin-left: 30px">div w/ margin-left</div>
<div><span style="margin-left: 100px">span w/ margin-left</span></div>
@ -19,4 +22,5 @@
<div style="text-align: right">div w/ text-align:right</div>
<div style="direction: rtl; text-align: center">div w/ RTL &amp; text-align:center</div>
<div style="text-indent: 200px">div w/ text-indent</div>
</div>
</body></html>

View File

@ -1,21 +1,25 @@
<!DOCTYPE html>
<title>Reference: Empty canvas objects and images that do not share lines with text should not receive backplates.</title>
<style>
.outer {
background-image: linear-gradient(blue, blue);
}
canvas {
height: 100px;
width: 100px;
}
.fake-backplate {
background-color: white;
}
</style>
<div class="outer">
<html>
<head>
<title>Reference: Empty canvas objects and images that do not share lines with text should not receive backplates.</title>
<style>
body {
background-image: linear-gradient(blue, blue);
}
canvas {
height: 100px;
width: 100px;
}
.fake-backplate {
background-color: white;
}
</style>
</head>
<body>
<canvas></canvas>
<br>
<img src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>" style="border:1px solid black; height:100px; width:100px;">
<br>
<span class="fake-backplate">Here is some alt text</span>
</div>
</body>
</html>

View File

@ -1,18 +1,22 @@
<!DOCTYPE html>
<title>Empty canvas objects and images that do not share lines with text should not receive backplates.</title>
<style>
.outer {
background-image: linear-gradient(blue, blue);
}
canvas {
height: 100px;
width: 100px;
}
</style>
<div class="outer">
<html>
<head>
<title>Empty canvas objects and images that do not share lines with text should not receive backplates.</title>
<style>
body {
background-image: linear-gradient(blue, blue);
}
canvas {
height: 100px;
width: 100px;
}
</style>
</head>
<body>
<canvas></canvas>
<br>
<img src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>" style="border:1px solid black; height:100px; width:100px;">
<br>
<img src="data:image/png," alt="Here is some alt text">
</div>
</body>
</html>

View File

@ -1 +0,0 @@
<!doctype html>

View File

@ -1,7 +0,0 @@
<!doctype html>
<title>background-image on canvas is ignored if in high-contrast</title>
<style>
body {
background-image: linear-gradient(red, red);
}
</style>

View File

@ -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

View File

@ -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