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

Style element left in <head> after tests['fontface'] executes #141

Closed
jkappers opened this issue Nov 9, 2010 · 1 comment
Closed

Style element left in <head> after tests['fontface'] executes #141

jkappers opened this issue Nov 9, 2010 · 1 comment

Comments

@jkappers
Copy link

jkappers commented Nov 9, 2010

I found this in the 'fontface' test:

    // removing it crashes IE browsers
    //head.removeChild(style);

IE dies when the return statement runs the supportAtRule function:

    var supportAtRule = impl.hasFeature('CSS2', '') ?
            function(rule) { ... } :
            function(rule) {
                if (!(sheet && rule)) return false;
                sheet.cssText = rule; //<-- IE DIES HERE IF STYLE REMOVED

                return sheet.cssText.length !== 0 && !(/unknown/i).test(sheet.cssText) &&
                  sheet.cssText
                        .replace(/\r+|\n+/g, '')
                        .indexOf(rule.split(' ')[0]) === 0;
            };

Seems to work okay when I do this:

    var result = supportAtRule('@font-face { font-family: "font"; src: "font.ttf"; }');
    head.removeChild(style);
    return result;
@paulirish
Copy link
Member

remove extra style element from head. closed by 09fe568

This issue was closed.
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

No branches or pull requests

2 participants