[Webkit-unassigned] [Bug 265386] Streaming HTML only works in iframe elements. Safari waits to buffer all HTML before rendering.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 25 14:05:37 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=265386

Konnor Rogers <konnor5456 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |konnor5456 at gmail.com

--- Comment #3 from Konnor Rogers <konnor5456 at gmail.com> ---
To add to this, the problem is very specific.

Safari seems to need about 512bytes of HTML to start streaming, otherwise it will remain buffered as noted here:

https://lamplightdev.com/blog/2024/01/10/streaming-html-out-of-order-without-javascript/


*BUT* the problem is even more speific than "512 bytes", Safari seems to want 512 bytes of displayable HTML.

That is, any element in the `<head>` is ignored, any element that is default hidden IE: `<script>`, `<template>`, HTML comments, etc are all ignored. Even `<canvas>` with text in it is ignored.

The "easiest" way of triggering HTML streaming seems to be with a height / width of 0 div, with no overflow. Like this:

```html
<body>
<div style="height: 0; width: 0; overflow: hidden;" hidden>
 {{ 512 bytes of data }}
</div>
<!-- stream the rest -->
</body>
```

This seems to be Safari / WebKit specific and is a pretty big gotcha.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240925/a2260db2/attachment-0001.htm>


More information about the webkit-unassigned mailing list