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

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