whatwg / whatwg/html

Clarification for <link> behavior in Declarative Shadow DOM

Open
#9,232 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

topic: link topic: shadow
Dominant language
HTML
Stars
9.4k
Forks
3.2k
PR merge metrics
PR metrics pending

Description

Hi :),

I'm playing with Declarative shadow dom and found that, if a stylesheet is loaded inside a declarative shadow DOM template, the rendering is blocked. Safari (that also implement declarative shadow DOM) however does not block rendering, which causes a FOUC.

I have been unable to find any note in the specification on which behavior is correct. It would be nice for the stylesheet to be blocking. For now, the only way to avoid the FOUC is to also load the stylesheet at the global scope, but the issue with this approach is that it leaks the style to the main document, which is indesirable.

Thanks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the HTML Standard's treatment of Declarative Shadow DOM and stylesheet loading, then compare the reported rendering behavior with Safari's behavior. Determine which behavior the specification should require and document the normative outcome for link stylesheets inside declarative shadow DOM templates.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.