Bug 1799425. Only set checkboard flag when adding background color item for root content document. r=emilio

Webrender uses this flag as a hint to separate mix blend containers so it should only be present on the root content document.

Differential Revision: https://phabricator.services.mozilla.com/D162046
This commit is contained in:
Timothy Nikkel 2022-11-15 23:03:49 +00:00
parent 9c44d165bb
commit 1358ce8ff1
5 changed files with 50 additions and 4 deletions

View file

@ -5428,7 +5428,8 @@ void PresShell::AddCanvasBackgroundColorItem(
if (!addedScrollingBackgroundColor || forceUnscrolledItem) {
nsDisplaySolidColor* item = MakeDisplayItem<nsDisplaySolidColor>(
aBuilder, aFrame, aBounds, bgcolor);
if (addedScrollingBackgroundColor) {
if (addedScrollingBackgroundColor &&
mPresContext->IsRootContentDocumentCrossProcess()) {
item->SetIsCheckerboardBackground();
}
AddDisplayItemToBottom(aBuilder, aList, item);

View file

@ -0,0 +1,21 @@
<style>
body,
html {
background-color: white;
}
.wrapper {
mix-blend-mode: difference;
}
.text {
color: white;
}
</style>
<div class="wrapper">
<div class="text">This text should always be black
</div>
</div>
<div id="video">
<div>Hover here to make video disappear</div>
<iframe srcdoc="<div style='width: 100px; height: 100px; background: blue;'></div>">
</div>

View file

@ -0,0 +1,26 @@
<style>
body,
html {
background-color: white;
}
.wrapper {
mix-blend-mode: difference;
}
.text {
color: white;
}
</style>
<div class="wrapper">
<div class="text">This text should always be black
</div>
</div>
<div id="video">
<div>Hover here to make video disappear</div>
<iframe srcdoc="<style>
html, body {
background: white;
}
</style>
<div style='width: 100px; height: 100px; background: blue;'></div>">
</div>

View file

@ -2132,4 +2132,5 @@ pref(layout.css.prefers-color-scheme.content-override,2) == 1787127.html 1787127
== 1792643-1.html 1792643-1-ref.html
skip-if(!/^Windows\x20NT\x2010\.0/.test(http.oscpu)) == 1798297-1.html 1798297-1-ref.html
skip-if(!/^Windows\x20NT\x2010\.0/.test(http.oscpu)) != 1798297-1.html 1798297-1-notref.html
== 1799425-1.html 1799425-1-ref.html
== 1800437-1.html 1800437-1-ref.html

View file

@ -1,3 +0,0 @@
[root-canvas-001.xht]
fuzzy:
if os == "win": maxDifference=91-93;totalPixels=2250-2300