W3C home > Mailing lists > Public > public-css-archive@w3.org > August 2020

[csswg-drafts] [css-fonts] Flash of disappearing text after inserting @font-face rules (#5455)

From: Xiaocheng Hu via GitHub <sysbot+gh@w3.org>
Date: Wed, 19 Aug 2020 19:23:59 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-682109684-1597865038-sysbot+gh@w3.org>
xiaochengh has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-fonts] Flash of disappearing text after inserting @font-face rules ==
Reposted from crbug.com/770003

Browsers (tested with Chrome, Firefox and Safari) currently make text that has already been displayed invisible when a stylesheet loads that provides a font for that text.

Simple example. Try http://output.jsbin.com/qonelib/quiet with cache disabled and network throttling to see the effect.

```
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    
    <title>Flash on disappearing text</title>
    <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
    <style>
      body {
        font-family: "IM Fell DW Pica", serif;
        padding: 3rem;
        line-height: 1.3rem;
      }
    </style>
  </head>
  <body>
    <h1>Some text</h1>
  </body>
  <script>
    var url = 'https://fonts.googleapis.com/css?family=IM+Fell+DW+Pica&x='+Math.random();
    var l = document.createElement('link');
    l.rel = 'stylesheet';
    l.href = url;

    setTimeout(function() {
      document.head.appendChild(l);
    }, 2000)
  </script>
</html>
```    

---

Should browsers make text invisible that has previously been painted as visible?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5455 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 19 August 2020 19:24:01 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:13 UTC