Skip to content

Commit

Permalink
Bug 1866063 - Prevent flickering of the source editor by hiding it ti…
Browse files Browse the repository at this point in the history
…ll loaded. r=devtools-reviewers,nchevobbe

Much like we we do here:

  https://searchfox.org/mozilla-central/rev/d7f837add602d270f2b2958b3ab5206dc85965c0/devtools/client/framework/toolbox.js#2605

This is not an ideal fix but it fixes the immediate flicker.

The real fix would be addressing
w3c/csswg-drafts#9624

Depends on D194395

Differential Revision: https://phabricator.services.mozilla.com/D194396
  • Loading branch information
emilio committed Nov 23, 2023
1 parent d620fed commit 8a5d8dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions devtools/client/shared/sourceeditor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,16 @@ Editor.prototype = {
}

const onLoad = () => {
// Prevent flickering by showing the iframe once loaded.
// See https://github.com/w3c/csswg-drafts/issues/9624
env.style.visibility = "";
const win = env.contentWindow.wrappedJSObject;
this.container = env;
this._setup(win.document.body, el.ownerDocument);
resolve();
};

env.style.visibility = "hidden";
env.addEventListener("load", onLoad, { capture: true, once: true });
env.src = CM_IFRAME;
el.appendChild(env);
Expand Down

0 comments on commit 8a5d8dc

Please sign in to comment.