Closed Bug 1644102 (construct-stylesheets-release) Opened 4 years ago Closed 2 years ago

Enable constructable stylesheets on all channels

Categories

(Core :: DOM: CSS Object Model, task, P3)

task

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

No description provided.

When constructable stylesheets are enabled, we need to make sure to document them on https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet and related pages.

Sebastian

Keywords: dev-doc-needed

I recently added the constructor, replace, and replaceSync methods to the docs.

All known issues have patches. Let's try this after these land.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b5c0bdafaf5e
Turn on constructable stylesheets by default. r=edgar,preferences-reviewers,mstriemer
Failed to create upstream wpt PR due to merge conflicts. This requires fixup from a wpt sync admin.

Backed out for causing mochitest failures in test_parseStyleSheetImport.html

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/26c04f03e9ad
Turn on constructable stylesheets by default. r=edgar,preferences-reviewers,mstriemer
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/5c227c071608
Annotate another test that inadvertently tested constructable stylesheets.
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
Depends on: 1766909
Regressions: 1767176
Regressions: 1769771
See Also: → 1770592

FF101 Docs work for this can be tracked in https://github.com/mdn/content/issues/16624.

We don't have enough time/experience to integrate the concepts into Using the shadow DOM so first docs for release will primarily be:

The "public API" for this feature mentioned in MDN appeared to be the CSSStyleSheet() constructor, CSSStyleSheet.replace() and CSSStyleSheet.replaceSync().

However I found that adoptedStyleSheets also appears to be affected by the preference. Are there any other methods or properties that I have missed?

Flags: needinfo?(emilio)

No, those are all, thanks!

Flags: needinfo?(emilio)

Thanks! Another question from discussion of the docs PR

  1. Is there a way to assign constructed CSS stylesheet rules to a layer?
  2. For calculating the cascade, the explainer says that if there are rules in conflict that would be resolved by order or import, then the adopted stylesheets come last. The question is, can I assume that they are treated as author origin and that that even if imported in inline javascript, they will not be considered to be inline styles? (my knowledge of cascade is from https://developer.mozilla.org/en-US/docs/Web/CSS/Cascade ).
Flags: needinfo?(emilio)

(In reply to Hamish Willee from comment #13)

Thanks! Another question from discussion of the docs PR

  1. Is there a way to assign constructed CSS stylesheet rules to a layer?

Using @layer inside the stylesheet just like in a style element. https://github.com/w3c/csswg-drafts/issues/7002 tracks adding a per-stylesheet layer.

  1. For calculating the cascade, the explainer says that if there are rules in conflict that would be resolved by order or import, then the adopted stylesheets come last. The question is, can I assume that they are treated as author origin and that that even if imported in inline javascript, they will not be considered to be inline styles? (my knowledge of cascade is from https://developer.mozilla.org/en-US/docs/Web/CSS/Cascade ).

Hm? Not sure I follow. Yes, these are always author stylesheets. The order of the stylesheets is

  • Stylesheets in the shadow tree (<link> and <style>, in tree order)
  • Adopted stylesheets (in whatever order the array is).
Flags: needinfo?(emilio)
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/34394 for changes under testing/web-platform/tests
Upstream PR was closed without merging

FYI docs work for this "somewhat" complete. Essentially all the new properties are documented and so the detail work is done.

What is missing is that we really need to integrate guide material for this into the docs on shadow DOM. I've created a placeholder issue for that in https://github.com/mdn/content/issues/16774 - but I don't know when it will become a priority. In the meantime the reference docs link to the web.dev explainers.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: