Permalink
Browse files

fixing CSS property name serialization into HTML style attribute: now…

… supporting multi-worded property names
  • Loading branch information...
1 parent e2373c2 commit 6b6e8fc1d2ce12cf93560f47b6f36436010ec693 @jakutis jakutis committed Jul 19, 2010
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/jsdom/browser/domtohtml.js
@@ -19,6 +19,11 @@ var singleTags = {
embed: 1
};
+var uncanon = function(str, letter) {
+ return '-' + letter.toLowerCase();
+};
+
+
var styleIgnore = {
top: 1,
left: 1
@@ -57,7 +62,7 @@ var stringifyElement = function(element) {
use = false;
}
if (use) {
- styleAttrs.push(i + ': ' + element.style[i]);
+ styleAttrs.push(i.replace(/([A-Z])/g, uncanon) + ': ' + element.style[i]);
}
}
}

0 comments on commit 6b6e8fc

Please sign in to comment.