Commit 0627a679 authored by Emilio Cobos Álvarez's avatar Emilio Cobos Álvarez
Browse files

Bug 1773155 - Ensure highlighter iframe for parent process is transparent. r=nchevobbe a=pascalc

By ensuring that it has color-scheme: light in both the embedder and the
embedded page.

Usually only the outer styling is necessary, but we generally assume
that chrome pages follow the OS color-scheme, so we need to make sure
both are set as light.

This might be able to go away depending on the resolution of
https://github.com/mozilla/wg-decisions/issues/774

Differential Revision: https://phabricator.services.mozilla.com/D148585
parent c9bda5c5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ const XUL_HIGHLIGHTER_STYLES_SHEET = `data:text/css;charset=utf-8,
  width: 100%;
  height: 100%;
  z-index: 2;
  color-scheme: light;
}`;

const STYLESHEET_URI =
@@ -295,6 +296,11 @@ CanvasFrameAnonymousContentHelper.prototype = {

      if (!this._iframe) {
        this._iframe = window.document.createElement("iframe");
        // We need the color-scheme shenanigans to ensure that the iframe is
        // transparent, see bug 1773155, bug 1738380, and
        // https://github.com/mozilla/wg-decisions/issues/774.
        this._iframe.srcdoc =
          "<!doctype html><meta name=color-scheme content=light>";
        this._iframe.classList.add("devtools-highlighter-renderer");
        // If iframe is used for the first time, add ref count of one to its
        // numberOfHighlighters data attribute.