Skip to content
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

Fix css plugin for IE7 #256

Merged
merged 1 commit into from
May 1, 2013
Merged

Fix css plugin for IE7 #256

merged 1 commit into from
May 1, 2013

Conversation

kate2753
Copy link
Contributor

var style = document.createElement('style');
var useCssText = (style.styleSheet) ? true : false;
style.type = 'text/css';

results in useCssText = false in IE7 which is causing wrong logic to execute for attaching css styles.

var style = document.createElement('style');
style.type = 'text/css';
var useCssText = (style.styleSheet) ? true : false;

results in useCssText = true, hence moving up style.type assignment.

IE7 also throws 'Access denied' exception on

style.styleSheet.cssText = [style.styleSheet.cssText, text].join('\n');

It can not read value of the style.styleSheet.cssText, so replacing it with style.innerHTML.

I've checked value of style.innerHTML before and after adding styles using style.styleSheet.cssText. InnerHTML correctly reflects changes made via cssText so I think it should be a safe change.

@ghost ghost assigned fsimeon and jakobo May 1, 2013
jakobo added a commit that referenced this pull request May 1, 2013
@jakobo jakobo merged commit 1c0a1d4 into LinkedInAttic:master May 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants