NV/CSSOM — Issue #29: jQuery 1.7 - Cannot set property cssText
Author: braddunbar
Created: 2011-11-09 15:09:23+00:00
State: open

_cross posted from jsdom issues tmpvar/jsdom:#356_

Using the following, I am receiving an error using jQuery 1.7:

__test.html__

__test.js__

#!/usr/bin/env node

var fs = require('fs');
var jsdom = require('jsdom').jsdom;

var window = jsdom(fs.readFileSync('test.html')).createWindow();

window.onload = function(){
console.log('loaded');
};

The error I receive is:

TypeError: Cannot set property cssText of [object Object] which has only a getter
at Object. (http://code.jquery.com/jquery-1.7.js:1621:27)
at Object. (http://code.jquery.com/jquery-1.7.js:1064:30)
at Object.fireWith (http://code.jquery.com/jquery-1.7.js:1182:7)
at Function.ready (http://code.jquery.com/jquery-1.7.js:437:14)
at Object. (http://code.jquery.com/jquery-1.7.js:927:10)
at Function.dispatch (/Users/brad/dev/test/node_modules/jsdom/lib/jsdom/level2/events.js:195:42)
at Object.dispatchEvent (/Users/brad/dev/test/node_modules/jsdom/lib/jsdom/level2/events.js:285:33)
at Object. (/Users/brad/dev/test/node_modules/jsdom/lib/jsdom/level2/html.js:391:12)
at /Users/brad/dev/test/node_modules/jsdom/lib/jsdom/level2/html.js:48:20
at Object.check (/Users/brad/dev/test/node_modules/jsdom/lib/jsdom/level2/html.js:277:11)

I think this is because CSSOM doesn't define a setter for `cssText`.