From e78e71528864cff13c440a736feee42d3704fb84 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sun, 28 Aug 2022 15:45:24 -0400 Subject: [PATCH 1/3] constructable stylesheets initial draft --- reports/2022.html | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/reports/2022.html b/reports/2022.html index 7b029e0..51de8f0 100644 --- a/reports/2022.html +++ b/reports/2022.html @@ -426,45 +426,66 @@

Links

Previous WCCG Report(s)
2021
GitHub issues:
-
---
+
WICG/webcomponents#468
Browser positions:
-
---
+
Chrome (Shipped)
+
Mozilla (Shipped)
+
Safari

Description

-

---

+

Constructable Stylesheets and adoptedStyleSheets enable adding styles directly to shadow roots without creating new DOM elements. Because a single stylesheet object can be adopted by multiple scopes, it also allows sharing of styles that can be centrally modified.

Status

Initial API Summary/Quick API Proposal

-

Summary or proposal based on current status; paragraph(s) and code.

+

The following is an example of what this would look like in practice.

+
+          const sheet = new CSSStyleSheet();
+          sheet.replaceSync('a { color: red; }');
+          
+          // Apply the stylesheet to a document:
+          document.adoptedStyleSheets = [sheet];
+          
+          // Apply the stylesheet to a Shadow Root:
+          const node = document.createElement('div');
+          const shadow = node.attachShadow({ mode: 'open' });
+          shadow.adoptedStyleSheets = [sheet];
+        

Key Scenarios

-

---

+

Concerns

- +

From their standards position tracker, Safari has highlighted some of the following concerns:

+ +

Dissenting Opinion

- +
  • ---
  • Related Specs

    From 8bde4593e4746ed933bc4a6447fa1c6c99bba4c0 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Sun, 28 Aug 2022 15:53:08 -0400 Subject: [PATCH 2/3] fix build for invalid HTML --- reports/2022.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reports/2022.html b/reports/2022.html index 51de8f0..f9acb20 100644 --- a/reports/2022.html +++ b/reports/2022.html @@ -479,7 +479,9 @@

    Concerns

    Dissenting Opinion

    -
  • ---
  • +

    Related Specs

    From 89dd61b42253ecf739d970e92b7a88240dcd7604 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Wed, 31 Aug 2022 21:12:44 -0400 Subject: [PATCH 3/3] Update reports/2022.html Co-authored-by: Westbrook Johnson --- reports/2022.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reports/2022.html b/reports/2022.html index f9acb20..9b8b3c5 100644 --- a/reports/2022.html +++ b/reports/2022.html @@ -435,7 +435,7 @@

    Links

    Description

    -

    Constructable Stylesheets and adoptedStyleSheets enable adding styles directly to shadow roots without creating new DOM elements. Because a single stylesheet object can be adopted by multiple scopes, it also allows sharing of styles that can be centrally modified.

    +

    Constructable Stylesheets and adoptedStyleSheets enable adding styles directly to DOM trees, e.g. `document` and shadow roots, without creating new DOM elements. Because a single stylesheet object can be adopted by multiple scopes, it also allows sharing of styles that can be centrally modified.

    Status