From e8ac57caae624dca6509ce1619ae254ffd1fe0f4 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Mon, 12 Apr 2010 19:16:30 -0700 Subject: tests pass on chrome --- test/testabilityPatch.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'test/testabilityPatch.js') diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js index dfa14b97..0c08e39e 100644 --- a/test/testabilityPatch.js +++ b/test/testabilityPatch.js @@ -64,16 +64,12 @@ function sortedHtml(element) { } attrs.sort(); html += attrs.join(''); - var style = []; - for(var name in node.style) { - var value = node.style[name]; - if (value && isString(value) && (name != 1*name) && (name != 'cssText')) { - style.push(name + ': ' + value + ';'); - } - } - style.sort(); - if (style.length) { - html += ' style="' + style.join(' ') + '"'; + if (node.style && node.style.cssText) { + var style = node.style.cssText.split('; '); + style.sort(); + if (style[0] == '') + style.shift(); + html += ' style="' + style.join('; ') + ';"'; } html += '>'; var children = node.childNodes; -- cgit v1.2.3