aboutsummaryrefslogtreecommitdiffstats
path: root/test/testabilityPatch.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/testabilityPatch.js')
-rw-r--r--test/testabilityPatch.js27
1 files changed, 22 insertions, 5 deletions
diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js
index 0c08e39e..89e7d9ea 100644
--- a/test/testabilityPatch.js
+++ b/test/testabilityPatch.js
@@ -64,12 +64,29 @@ function sortedHtml(element) {
}
attrs.sort();
html += attrs.join('');
- if (node.style && node.style.cssText) {
- var style = node.style.cssText.split('; ');
+ if (node.style) {
+ var style = [];
+ if (node.style.cssText) {
+ foreach(node.style.cssText.split(';'), function(value){
+ value = trim(value);
+ if (value) {
+ style.push(value);
+ }
+ });
+ }
+ for(var css in node.style){
+ var value = node.style[css];
+ if (isString(value) && isString(css) && css != 'cssText' && value && (1*css != css)) {
+ var text = css + ': ' + node.style[css];
+ if (indexOf(style, text) == -1) {
+ style.push(text);
+ }
+ }
+ };
style.sort();
- if (style[0] == '')
- style.shift();
- html += ' style="' + style.join('; ') + ';"';
+ if (style.length) {
+ html += ' style="' + style.join('; ') + ';"';
+ }
}
html += '>';
var children = node.childNodes;