Bug 1625036 - Tweak background: transparent handling so that color: transparent doesn't override UA sheet backgrounds. r=morgan

Differential Revision: https://phabricator.services.mozilla.com/D68408

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2020-03-30 15:09:33 +00:00
parent 9dd3baaacb
commit cce6ca63f5
4 changed files with 16 additions and 6 deletions

View File

@ -0,0 +1,2 @@
<!doctype html>
<button>ABC</button>

View File

@ -0,0 +1,7 @@
<!doctype html>
<style>
button {
background-color: transparent;
}
</style>
<button>ABC</button>

View File

@ -40,3 +40,5 @@ pref(browser.display.document_color_use,2) == non-themed-button-001.html non-the
pref(browser.display.document_color_use,2) == non-themed-button-002.html non-themed-button-002-ref.html
!= cascade-001.html about:blank
pref(browser.display.document_color_use,2) == background-transparent-form-control.html background-transparent-form-control-ref.html

View File

@ -372,13 +372,12 @@ fn tweak_when_ignoring_colors(
// We honor color and background-color: transparent, and
// "revert-or-initial" otherwise.
PropertyDeclaration::BackgroundColor(ref color) => {
if color.is_transparent() {
return;
if !color.is_transparent() {
let color = builder.device.default_background_color();
declarations_to_apply_unless_overriden.push(
PropertyDeclaration::BackgroundColor(color.into())
)
}
let color = builder.device.default_background_color();
declarations_to_apply_unless_overriden.push(
PropertyDeclaration::BackgroundColor(color.into())
)
}
PropertyDeclaration::Color(ref color) => {
// otherwise.