Bug 198481 - Loading script blocks rendering on Mobile Safari
Summary: Loading script blocks rendering on Mobile Safari
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-06-03 01:32 PDT by ambar
Modified: 2019-06-03 08:26 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ambar 2019-06-03 01:32:13 PDT
Demo:

https://github.com/ambar/safari-render-blocking-bug/blob/master/views/demo.pug

```html
<body>
  <pre id="firstAFLog"></pre>
  <script>
    requestAnimationFrame(function() {
      firstAFLog.textContent = Date.now() - performance.timing.navigationStart
    })
  </script>
  <script src="/empty.js?networkDelay=2000"></script>
</body>
```


```
## iOS 11.4 Mobile Safari

| method             | firstAF | 
| ------------------ | ------- | 
| script[defer]+hack | 499     | 
| script[async]      | 499     | 
| script[async]+hack | 501     | 
| script+hack        | 504     | 
| script[defer]      | 2039    | 
| script             | 2045    | 

## iOS 12.2 Mobile Safari

| method             | firstAF | 
| ------------------ | ------- | 
| script[async]+hack | 232     | 
| script[defer]+hack | 313     | 
| script+hack        | 320     | 
| script[defer]      | 2042    | 
| script[async]      | 2045    | 
| script             | 2046    | 

## Desktop Safari (Version/12.1.1 Safari/605.1.15)

| method             | firstAF | 
| ------------------ | ------- | 
| script[async]+hack | 37      | 
| script[defer]+hack | 37      | 
| script[defer]      | 38      | 
| script+hack        | 38      | 
| script[async]      | 38      | 
| script             | 38      | 

```

*firstAF*: first animation frame time.
Comment 1 ambar 2019-06-03 02:22:26 PDT
*hack*: fill content with at least 201 characters, which will trigger a paint.
Comment 2 Radar WebKit Bug Importer 2019-06-03 08:26:34 PDT
<rdar://problem/51356236>