-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading CSS in a background tab is flaky #3
Comments
I get the I had to add |
Hey Sam, if this is related to the |
I've created an issue for it: #5 |
A similar bug happens on Chrome too: rule.parentStyleSheet is null in cssSupport.changeFontFaceRuleSrc(). It only happens intermittently, but the bug can be reliably reproduced by putting in a delay, which makes me think it could be a concurrency problem of some sort.
If you add breakpoints then you'll see that:
Could it be that some other Promise is completing before this one, and detaching the Any promise called from within a |
Updating exchangeRule in cssSupport as follows fixed the problem: Before:
After:
There doesn't seem to be much of a perf hit at all. However this is more a fix for the symptom than the root cause. |
… sheet for the parsing, instead of using the parentStyleSheet property
Thanks for the thorough debugging and the clean write up. Can you let me know what environment your are testing in? With the proposed delay proposed above it only makes Jasmine run into timeouts for me. |
As you suggest, a better analysis on what happens in parallel in the background might help understanding the effects. However your change helps decouple us from references inside the DOM structure, so this feels definitely safer. |
Hi Chris, Thanks for the quick response and merging this in! I tested it via rasterizeHtml installed in a larger application, rather than by running the unit tests. Would it be possible to bubble this up to rasterizeHtml and create a new release? I can create a PR to bump the version in rasterizeHtml if you like. Quentin |
No worries, I can make a release, maybe today.
|
Fixed for good it seems. Closing |
Loading CSS resources over a HTTP source in a background tab in Firefox seems flaky. The error "Unable to load stylesheet undefined" is returned in some cases. Further debugging around the message makes the message disappear.
cssSupport.changeFontFaceRuleSrc() seems to have problems either retrieving
rule.style.getPropertyValue("font-family")
orrule.parentStyleSheet
, the latter being null.The text was updated successfully, but these errors were encountered: