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
Setting element border style loses some of the border values #1241
Comments
/cc @chad3814 |
… horizontal lines from being properly displayed. We also need to add controls for scaling and possibly for setting the em size.
Is there a chance on an update (or suggestion) on this? FWIW, still seeing this on jsdom 7.1.0. |
The best thing to do would be to submit a PR to https://github.com/chad3814/CSSStyleDeclaration fixing the issue. |
Thanks for the pointer! |
I spent quite some time looking into this, and it turns out that the issue is not with CSSStyleDeclaration itself, but in how jsdom uses it. The problem seems to be the on-change handler in level2/html.js. If you remove the callback, then the example code above produces the correct results. It appears that these lines are designed to get the updated style definition added to the element as the Although the situation is pretty complicated, it seems that what is happening is that during the My suggested fix is to replace those three lines with
so that recursive calls to If you want me to make a pull request for this, I will. Let me know. |
Thanks so much for looking into this! Right now we have a major refactor that will touch that file, so hold off on a pull request for a bit :). But after that lands (#1333) I'd love a pull request that fixes that and leaves all other tests passing. |
OK, will do. I've subscribed to 1333 and will do a PR after that has been merged (provided my fix still works) :-) |
…ly. Resolves issue jsdom#1241.
If you set
el.style.border = "1px solid back"
, thenel.style.border
will be set toblack
, but the1px
andsolid
are lost. It appears that only the last word in the string is used, soel.style.border = "1px solid"
sets it tosolid
.Here is a test case:
This is with jsdom 6.5.1.
The text was updated successfully, but these errors were encountered: