Skip to content
This repository was archived by the owner on Jul 3, 2024. It is now read-only.

Asynchronous XHR and domain-relative stylesheets #5

Closed
wants to merge 4 commits into from
Closed

Asynchronous XHR and domain-relative stylesheets #5

wants to merge 4 commits into from

Conversation

jcarnett
Copy link

I made a few changes to eCSStender to fix some issues I ran into while doing some cross-browser testing for a site I'm working on.

  1. I changed XHR to be asynchronous. Because the processing of the next CSS file continues from the XHR callback, synchronous requests cause the call stack to grow deeper as you add more stylesheets. Eventually the JS interpreter will throw an exception. I was seeing this issue with Chrome (~20 stylesheets) and IE (unknown limit, browser hangs). This also has the added benefit of allowing the browser to do other things while stylesheets are being parsed.
  2. IE 6 and 7 were always requesting CSS files relative to the current page, even though the link tag used a domain-relative path. I adjusted your test for domain-relative paths to set the current path to the root of the domain.

…xception when there are too many CSS files. Removed unnecessary onreadystatechange test.
…xception when there are too many CSS files. Removed unnecessary onreadystatechange test.
@aarongustafson
Copy link
Member

Thanks man, I'll take a look at these by the beginning of next week.

@aarongustafson
Copy link
Member

I posted some inline comments, any thoughts or feedback?

@aarongustafson
Copy link
Member

I've incorporated these changes into the current master and will test tomorrow before releasing as 1.2.6.7.

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants