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

setProperty() is not working for some rules #40

Closed
pgn-vole opened this issue Sep 24, 2014 · 2 comments
Closed

setProperty() is not working for some rules #40

pgn-vole opened this issue Sep 24, 2014 · 2 comments
Assignees
Milestone

Comments

@pgn-vole
Copy link

Hi,

CSSStyleDeclaration.prototype.setProperty is not working on properties with hyphen (margin-left, padding-left ect ...)

It is because the the property name passed to setAttribute must be camel cased.

I noticed the bug on IE8 (real IE8, not a more recent one in IE8 mode)

Test case:

<!DOCTYPE html>
<html>
<body>
<span id="item"> abc </span>
<script>
var item = document.getElementById("item")

item.style.setAttribute('margin-left', '40px') //Not working

item.style.setAttribute('marginLeft', '40px') // Working \o/
</script>
</body>
</html>
@shawnbot shawnbot added the bug label Nov 20, 2014
@shawnbot shawnbot added this to the v2 milestone Nov 20, 2014
@shawnbot shawnbot self-assigned this Nov 20, 2014
shawnbot pushed a commit that referenced this issue Jan 29, 2015
shawnbot pushed a commit that referenced this issue Jan 29, 2015
shawnbot pushed a commit that referenced this issue Jan 30, 2015
@shawnbot
Copy link
Owner

fixed in #49, huzzah!

@pgn-vole
Copy link
Author

awesome ! Thanks @shawnbot

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

2 participants