Skip to content

Define more exactly when document.styleSheets is updated #696

Closed

Description

@zcorpan

https://html.spec.whatwg.org/multipage/semantics.html#link-type-stylesheet

Once a resource has been obtained

See https://bugzilla.mozilla.org/show_bug.cgi?id=958415#c6 onwards

Also https://www.w3.org/Bugs/Public/show_bug.cgi?id=29464 for the bug on the CSSOM side (I suppose both HTML and CSSOM need to be clearer here).

Activity

  1. added
    compatStandard is not web compatible or proprietary feature needs standardizing
    on Feb 15, 2016
  2. self-assigned this
    on Feb 15, 2016
  3. TakayoshiKochi commented on Jul 5, 2018

    @TakayoshiKochi
    Member

    Related: when .sheet property for both <style> and <link rel=stylesheet> becomes available is unclear.

    According to #2997 (comment) CSS parsing should be observed atomic, so things will happen in this order

    1. loading completes
    2. stylesheet is parsed
    3. CSSStyleSheet object is ready (including cssRules being populated)
    4. .sheet is associated with the object
    5. document.styleSheets reflects the object
    6. load or error event is fired against its owner node
  4. emilio commented on Nov 18, 2020

    @emilio
    Contributor
  5. removed their assignment
    on Oct 27, 2021
  6. self-assigned this
    on Nov 26, 2022
  7. domfarolino commented on Nov 26, 2022

    @domfarolino
    Member

    As per #4031 (specifically #4031 (comment)) I think this issue can be closed. Everything in #696 (comment) seems to be properly specified in the way that the comment outlines, with the exception of the CSS parsing particulars, which is tracked by #2997 specifically. But the order of all the other steps, including their relation to the hand-wavy CSS rule parsing, looks right to me.

    I'll close this now, but please re-open if you think I am mistaken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

compatStandard is not web compatible or proprietary feature needs standardizingtopic: style

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions