Skip to content

curl-css shouldn't wait for readystate == 'complete' #273

@gerges-zz

Description

@gerges-zz

The curl.js CSS plugin currently waits for document.readyState == 'complete' before resolving it's deferred. In the comments, it's mentioned that Chrome won't apply styles until this time. I think this wait may be over the top. If a page contains many high resolution images, Chrome would likely have had the time to download/parse/apply the styles long before complete is fired. I'm proposing one of the following options

  1. The readystate call is changed to include readystate == 'interactive' (since the document claims to be in an interactive state, allowing background images to continue loading)
  2. The call itself is removed as the load event fires once the stylesheet and all of its imported content has been loaded and parsed. (This is immediately before the styles start being applied to the content)

I was hoping to get some feedback before I worked on a PR, let me know what you think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions