Bug 255640

Summary: Declarative shadow DOM does not block rendering on <link> (browser inconsistency)
Product: WebKit Reporter: mic.gallego
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: annevk, karlcow, rniwa, webkit-bug-importer
Priority: P2 Keywords: BrowserCompat, InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 148695    

Description mic.gallego 2023-04-18 21:06:18 PDT
Hi,

While trying the declarative shadow DOM, I found that Safari does not block rendering if it encounters a <link> external stylesheet, causing FOUC. Chrome, on the other hand, seems to block the rendering until the stylesheet is loaded.

I could not find on the spec which behavior is expected, but having inconsistent behavior makes it hard to properly implement a workaround. From a developer point of view, blocking is more desirable (the only way to avoid blocking is to load the stylesheet in the head in the global scope, which leak all the styles).

I've raised this concern as well in the W3C repo: https://github.com/whatwg/dom/issues/1187

Thanks.
Comment 1 Radar WebKit Bug Importer 2023-04-25 21:07:20 PDT
<rdar://problem/108539923>
Comment 2 Karl Dubost 2023-05-01 18:36:51 PDT
Discussion is started on https://github.com/whatwg/dom/issues/1187

Anne mentioned 
> Looking at https://html.spec.whatwg.org/#contributes-a-script-blocking-style-sheet and #5465 this would constitute a bug in Chromium, though it does seem somewhat logical to update the