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

Assigning null to element.style.background throws an error #1499

Closed
fordbzd opened this issue May 23, 2016 · 2 comments
Closed

Assigning null to element.style.background throws an error #1499

fordbzd opened this issue May 23, 2016 · 2 comments

Comments

@fordbzd
Copy link

fordbzd commented May 23, 2016

In my mocha test case, if I have the following code:

    document.body.innerHTML = "<div id=\"ctrl\" style=\"background:#111;border:1px\"></div>";
    var a = document.body.firstChild;
    a.style['background'] = null;

Then I will get:

TypeError: Cannot read property 'split' of null

In our code, the last statement is used to invalid and thus clean the value of the specific style. It can be achieved by other ways, but the problem is that it works in previous build (8.0.2 and before) and in Chrome. It seems in latest implementation String.split() is used when assigning values to style without null check.

@domenic
Copy link
Member

domenic commented May 24, 2016

Thank you for the report. This is a bug in the cssstyle module maintained by @chad3814. I will open another issue over there.

@domenic domenic changed the title Assign null to HTMLElement.style Returns Error Assigning null to element.style.background throws an error May 24, 2016
@chad3814
Copy link
Contributor

cssstyle@0.2.35 published with fix

nhunzaker pushed a commit to nhunzaker/jsdom that referenced this issue Dec 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants