aboutsummaryrefslogtreecommitdiffstats
path: root/test/testabilityPatch.js
diff options
context:
space:
mode:
authorMisko Hevery2010-04-15 14:17:33 -0700
committerMisko Hevery2010-04-15 14:17:33 -0700
commit70e401ef100614295fc808e32f0142f07c315461 (patch)
tree7d31580fb512dd535465e4d42afb0252b0cf0071 /test/testabilityPatch.js
parentcd03fe92a5dbd2aba516b64fc8067c5fba1e4a81 (diff)
downloadangular.js-70e401ef100614295fc808e32f0142f07c315461.tar.bz2
added $route service
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;