14 new revisions:

Revision: 6f92828de428
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 02:57:35 2013
Log: report: faster rendering of test details - seems to be about 3x faster
http://code.google.com/p/robotframework/source/detail?r=6f92828de428

Revision: ab1d3a715fa2
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 05:05:09 2013
Log:      log/report: js performance tuning. mainly affects ie9.
http://code.google.com/p/robotframework/source/detail?r=ab1d3a715fa2

Revision: da0c144af492
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 05:45:54 2013
Log:      log/report: small performance tuning for rendering stats
http://code.google.com/p/robotframework/source/detail?r=da0c144af492

Revision: d8d9645908ab
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 05:54:43 2013
Log:      report: fixed link to critical/all details
http://code.google.com/p/robotframework/source/detail?r=d8d9645908ab

Revision: 4b713d11ff6b
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 06:31:42 2013
Log:      report: js tuning: cache found jquery object.
http://code.google.com/p/robotframework/source/detail?r=4b713d11ff6b

Revision: 41d1fcd17189
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 07:17:14 2013
Log:      report: fixed viewing tags if they contain %
http://code.google.com/p/robotframework/source/detail?r=41d1fcd17189

Revision: 3fb6b4822087
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 07:18:01 2013
Log: report: fixed viewing details table if first row contains internal tab...
http://code.google.com/p/robotframework/source/detail?r=3fb6b4822087

Revision: 3d5c61f08370
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 08:49:51 2013
Log: report: fixed scrolling to correct location when clicking Total/Tags/S...
http://code.google.com/p/robotframework/source/detail?r=3d5c61f08370

Revision: be11f2ef07f4
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 12:41:38 2013
Log: log/report/libdoc/testdoc: use html5 doctype. shorter and apparently e...
http://code.google.com/p/robotframework/source/detail?r=be11f2ef07f4

Revision: 305be54ecb80
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 13:12:03 2013
Log:      report: i accidentally. tablesorting borken.
http://code.google.com/p/robotframework/source/detail?r=305be54ecb80

Revision: 0992f6a52e58
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 14:04:57 2013
Log: log/report: jquery performance tuning (partly to make pycharm happier)...
http://code.google.com/p/robotframework/source/detail?r=0992f6a52e58

Revision: 46f532dd19ea
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 15:47:05 2013
Log: testdoc: removed unnecessary expandElement - can use toggleElement ins...
http://code.google.com/p/robotframework/source/detail?r=46f532dd19ea

Revision: 1e8a887179f1
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 16:14:02 2013
Log: log: performance enhancement to expand. mostly reverting back to old....
http://code.google.com/p/robotframework/source/detail?r=1e8a887179f1

Revision: 2b4c01a7645c
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 16:37:41 2013
Log: log/model: no need to have default implementation for callWhenChildren...
http://code.google.com/p/robotframework/source/detail?r=2b4c01a7645c

==============================================================================
Revision: 6f92828de428
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 02:57:35 2013
Log: report: faster rendering of test details - seems to be about 3x faster
http://code.google.com/p/robotframework/source/detail?r=6f92828de428

Modified:
 /src/robot/htmldata/rebot/report.html

=======================================
--- /src/robot/htmldata/rebot/report.html       Thu Feb 14 01:20:27 2013
+++ /src/robot/htmldata/rebot/report.html       Thu Feb 14 02:57:35 2013
@@ -227,7 +227,8 @@
 function drawTestDetailsTable(tests, sortByStatus) {
     renderTestDetailsHeader();
     window.elementsToRender = tests;
-    renderTestDetails(sortByStatus);
+    var target = $('#test-details > tbody');
+    renderTestDetails(sortByStatus, target);
 }

 function renderTestDetailsHeader() {
@@ -264,23 +265,23 @@
     return util.formatElapsed(totaltime);
 }

-function renderTestDetails(sortByStatus) {
+function renderTestDetails(sortByStatus, target) {
     if (!window.elementsToRender.length)
         return;
-    var tests = popUpTo(window.elementsToRender, 10);
-    renderTestDetailsRows(tests);
+    var tests = popUpTo(window.elementsToRender, 50);
+    renderTestDetailsRows(tests, target);
     if (window.elementsToRender.length)
-        setTimeout(function () {renderTestDetails(sortByStatus);}, 0);
+ setTimeout(function () {renderTestDetails(sortByStatus, target);}, 0);
     else
         configureTableSorter(sortByStatus);
 }

-function renderTestDetailsRows(tests) {
+function renderTestDetailsRows(tests, target) {
     var rows = $.tmpl('testDetailsTableRowTemplate', tests,
                       {logURL: window.settings.logURL});
     rows.find('a').click(stopPropagation);
     hideHiddenDetailsColumns(rows);
-    rows.appendTo('#test-details > tbody');
+    rows.appendTo(target);
 }

 function configureTableSorter(sortByStatus) {

==============================================================================
Revision: ab1d3a715fa2
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 05:05:09 2013
Log:      log/report: js performance tuning. mainly affects ie9.
http://code.google.com/p/robotframework/source/detail?r=ab1d3a715fa2

Modified:
 /src/robot/htmldata/rebot/report.html
 /src/robot/htmldata/rebot/util.js

=======================================
--- /src/robot/htmldata/rebot/report.html       Thu Feb 14 02:57:35 2013
+++ /src/robot/htmldata/rebot/report.html       Thu Feb 14 05:05:09 2013
@@ -258,11 +258,10 @@
 }

 function calculateTotalTime(tests) {
-    var totaltime = 0;
-    $.map(tests, function (test) {
-        totaltime += test.times.elapsedMillis;
-    });
-    return util.formatElapsed(totaltime);
+    var total = 0;
+    for (var i = 0, len = tests.length; i < len; i++)
+        total += tests[i].times.elapsedMillis;
+    return util.formatElapsed(total);
 }

 function renderTestDetails(sortByStatus, target) {
=======================================
--- /src/robot/htmldata/rebot/util.js   Fri Nov 23 05:17:46 2012
+++ /src/robot/htmldata/rebot/util.js   Thu Feb 14 05:05:09 2013
@@ -1,8 +1,8 @@
 window.util = function () {

-    function map(elems, func){
+    function map(elems, func) {
         var ret = [];
-        for (var i=0; i<elems.length; i++) {
+        for (var i = 0, len = elems.length; i < len; i++) {
             ret[i] = func(elems[i]);
         }
         return ret;
@@ -10,7 +10,7 @@

     function filter(elems, predicate) {
         var ret = [];
-        for (var i=0; i<elems.length; i++) {
+        for (var i = 0, len = elems.length; i < len; i++) {
             if (predicate(elems[i]))
                 ret.push(elems[i]);
         }
@@ -18,7 +18,7 @@
     }

     function all(elems) {
-        for (var i=0; i<elems.length; i++) {
+        for (var i = 0, len = elems.length; i < len; i++) {
             if (!elems[i])
                 return false;
         }
@@ -26,7 +26,7 @@
     }

     function any(elems) {
-        for (var i=0; i<elems.length; i++) {
+        for (var i = 0, len = elems.length; i < len; i++) {
             if (elems[i])
                 return elems[i];
         }
@@ -34,7 +34,7 @@
     }

     function contains(elems, e) {
-        for (var i=0; i<elems.length; i++) {
+        for (var i = 0, len = elems.length; i < len; i++) {
             if (elems[i] == e)
                 return true;
         }

==============================================================================
Revision: da0c144af492
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 05:45:54 2013
Log:      log/report: small performance tuning for rendering stats
http://code.google.com/p/robotframework/source/detail?r=da0c144af492

Modified:
 /src/robot/htmldata/rebot/view.js

=======================================
--- /src/robot/htmldata/rebot/view.js   Thu Feb 14 01:20:27 2013
+++ /src/robot/htmldata/rebot/view.js   Thu Feb 14 05:45:54 2013
@@ -71,13 +71,13 @@
         '<h2>Test Statistics</h2>' +
         '<table class="statistics" id="total-stats"><thead><tr>' +
         '<th class="stats-col-name">Total Statistics</th>' + statHeaders +
-        '</tr></thead><tbody></tbody></table>' +
+        '</tr></thead></table>' +
         '<table class="statistics" id="tag-stats"><thead><tr>' +
         '<th class="stats-col-name">Statistics by Tag</th>' + statHeaders +
-        '</tr></thead><tbody></tbody></table>' +
+        '</tr></thead></table>' +
         '<table class="statistics" id="suite-stats"><thead><tr>' +
'<th class="stats-col-name">Statistics by Suite</th>' + statHeaders +
-        '</tr></thead><tbody></tbody></table>';
+        '</tr></thead></table>';
     $(statTable).appendTo('#statistics-container');
     $.map(['total', 'tag', 'suite'], addStatTable);
     stopStatLinkClickPropagation();
@@ -127,7 +127,7 @@
 }

 function renderNoTagStatTable() {
-    $('<tr class="row-0">' +
+    $('<tbody><tr class="row-0">' +
         '<td class="stats-col-name">No Tags</td>' +
         '<td class="stats-col-stat"></td>' +
         '<td class="stats-col-stat"></td>' +
@@ -136,16 +136,16 @@
         '<td class="stats-col-graph">' +
           '<div class="empty-graph"></div>' +
         '</td>' +
-      '</tr>').appendTo($('#tag-stats > tbody'));
+      '</tr></tbody>').appendTo('#tag-stats');
 }

 function renderStatTable(tableName, stats) {
     var template = tableName + 'StatisticsRowTemplate';
-    var target = $('#' + tableName + '-stats > tbody');
- // Need explicit for loop because $.tmpl() does not handle very large lists
-    for (var i = 0; stats !== undefined && i < stats.length; i++) {
-        $.tmpl(template, stats[i], {index: i}).appendTo(target);
+    var tbody = $('<tbody></tbody>');
+    for (var i = 0, len = stats.length; i < len; i++) {
+        $.tmpl(template, stats[i], {index: i}).appendTo(tbody);
     }
+    tbody.appendTo('#' + tableName + '-stats');
 }

 $.template('statColumnsTemplate',

==============================================================================
Revision: d8d9645908ab
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 05:54:43 2013
Log:      report: fixed link to critical/all details
http://code.google.com/p/robotframework/source/detail?r=d8d9645908ab

Modified:
 /src/robot/htmldata/rebot/report.html

=======================================
--- /src/robot/htmldata/rebot/report.html       Thu Feb 14 05:05:09 2013
+++ /src/robot/htmldata/rebot/report.html       Thu Feb 14 05:54:43 2013
@@ -327,13 +327,13 @@
     <tr>
       <th>Status:</th>
       {{if criticalFailed}}
- <td><a href="#total-critical" onclick="totalDetailSelected('critical')" + <td><a href="#total_critical" onclick="totalDetailSelected('critical')" class="fail">${criticalFailed} critical test{{if criticalFailed != 1}}s{{/if}} failed</a></td>
       {{else totalFailed}}
- <td><a href="#total-critical" onclick="totalDetailSelected('critical')" + <td><a href="#total_critical" onclick="totalDetailSelected('critical')"
              class="pass">All critical tests passed</a></td>
       {{else}}
-      <td><a href="#total-all" onclick="totalDetailSelected('all')"
+      <td><a href="#total_all" onclick="totalDetailSelected('all')"
              class="pass">All tests passed</a></td>
       {{/if}}
     </tr>

==============================================================================
Revision: 4b713d11ff6b
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 06:31:42 2013
Log:      report: js tuning: cache found jquery object.
http://code.google.com/p/robotframework/source/detail?r=4b713d11ff6b

Modified:
 /src/robot/htmldata/rebot/report.html

=======================================
--- /src/robot/htmldata/rebot/report.html       Thu Feb 14 05:54:43 2013
+++ /src/robot/htmldata/rebot/report.html       Thu Feb 14 06:31:42 2013
@@ -219,9 +219,10 @@

 function renderSelector(args, template, stats) {
     window.elementsToRender = [];
-    $('#test-details-container').empty();
- $.tmpl('detailsHeaderTemplate', args).appendTo('#test-details-container');
-    $.tmpl(template, stats).appendTo('#test-details-container');
+    var container = $('#test-details-container');
+    container.empty();
+    $.tmpl('detailsHeaderTemplate', args).appendTo(container);
+    $.tmpl(template, stats).appendTo(container);
 }

 function drawTestDetailsTable(tests, sortByStatus) {

==============================================================================
Revision: 41d1fcd17189
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 07:17:14 2013
Log:      report: fixed viewing tags if they contain %
http://code.google.com/p/robotframework/source/detail?r=41d1fcd17189

Modified:
 /src/robot/htmldata/rebot/report.html

=======================================
--- /src/robot/htmldata/rebot/report.html       Thu Feb 14 06:31:42 2013
+++ /src/robot/htmldata/rebot/report.html       Thu Feb 14 07:17:14 2013
@@ -106,7 +106,8 @@
 function showDetailsByHash() {
     if (window.location.hash == window.prevLocationHash)
         return;
- var hashParts = decodeURI(window.location.hash.substring(1)).split('_');
+    var hash = window.location.hash.substring(1).replace('%', '%25');
+    var hashParts = decodeURI(hash).split('_');
     var key = hashParts.shift();
     var arg = hashParts.join('_');
     var action = {'totals': showTotalSelector,

==============================================================================
Revision: 3fb6b4822087
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 07:18:01 2013
Log: report: fixed viewing details table if first row contains internal table.

this is a workaround for tablesorter bug:
https://github.com/Mottie/tablesorter/issues/238
http://code.google.com/p/robotframework/source/detail?r=3fb6b4822087

Modified:
 /src/robot/htmldata/rebot/report.html

=======================================
--- /src/robot/htmldata/rebot/report.html       Thu Feb 14 07:17:14 2013
+++ /src/robot/htmldata/rebot/report.html       Thu Feb 14 07:18:01 2013
@@ -292,7 +292,11 @@
                   selectorSort: '.details-col-header'};
     if (sortByStatus)
         config['sortList'] = [[4, 0], [3, 0]];
-    $("#test-details").tablesorter(config);
+    var table = $('test-details');
+    table.tablesorter(config);
+    // remove possibly invalid colgroup added by tablesorter
+    // https://github.com/Mottie/tablesorter/issues/238
+    table.find('colgroup').remove();
 }

 function popUpTo(list, upTo) {

==============================================================================
Revision: 3d5c61f08370
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 08:49:51 2013
Log: report: fixed scrolling to correct location when clicking Total/Tags/Suites tabs or navigating to #totals/#tags/#suites directly
http://code.google.com/p/robotframework/source/detail?r=3d5c61f08370

Modified:
 /src/robot/htmldata/rebot/report.html

=======================================
--- /src/robot/htmldata/rebot/report.html       Thu Feb 14 07:18:01 2013
+++ /src/robot/htmldata/rebot/report.html       Thu Feb 14 08:49:51 2013
@@ -144,7 +144,8 @@
 }

 function renderTotalSelector(name) {
- var args = {linkTarget: 'total_'+name, totalTabStatus: 'detail-tab-selected'}; + var args = {linkTarget: (name !== undefined) ? 'total_'+name : 'totals',
+                totalTabStatus: 'detail-tab-selected'};
     renderSelector(args, 'totalDetailsSelectorTemplate', {selected: name});
 }

@@ -174,10 +175,11 @@
     scrollToSelector('tag_'+name);
 }

-function renderTagSelector(tagName) {
- var args = {linkTarget: 'tag_'+tagName, tagTabStatus: 'detail-tab-selected'}; - var tagstats = {tags: window.testdata.statistics().tag, selected: tagName};
-    renderSelector(args, 'tagDetailsSelectorTemplate', tagstats);
+function renderTagSelector(name) {
+    var args = {linkTarget: (name !== undefined) ? 'tag_'+name : 'tags',
+                tagTabStatus: 'detail-tab-selected'};
+    var stats = {tags: window.testdata.statistics().tag, selected: name};
+    renderSelector(args, 'tagDetailsSelectorTemplate', stats);
 }

 function renderTagDetails(tag) {
@@ -196,7 +198,8 @@
 }

 function renderSuiteSelector(id) {
- var args = {linkTarget: 'suite_'+id, suiteTabStatus: 'detail-tab-selected'};
+    var args = {linkTarget: (id !== undefined) ? 'suite_'+id : 'suites',
+                suiteTabStatus: 'detail-tab-selected'};
     var stats = {suites: window.testdata.statistics().suite,
                  selected: id};
     renderSelector(args, 'suiteDetailsSelectorTemplate', stats);

==============================================================================
Revision: be11f2ef07f4
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 12:41:38 2013
Log: log/report/libdoc/testdoc: use html5 doctype. shorter and apparently enough to put all browsers into standards mode.
http://code.google.com/p/robotframework/source/detail?r=be11f2ef07f4

Modified:
 /src/robot/htmldata/libdoc/libdoc.html
 /src/robot/htmldata/rebot/log.html
 /src/robot/htmldata/rebot/report.html
 /src/robot/htmldata/testdoc/testdoc.html

=======================================
--- /src/robot/htmldata/libdoc/libdoc.html      Fri Dec 28 03:58:38 2012
+++ /src/robot/htmldata/libdoc/libdoc.html      Thu Feb 14 12:41:38 2013
@@ -1,4 +1,4 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd";>
+<!DOCTYPE html>
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
=======================================
--- /src/robot/htmldata/rebot/log.html  Thu Feb 14 01:20:27 2013
+++ /src/robot/htmldata/rebot/log.html  Thu Feb 14 12:41:38 2013
@@ -1,4 +1,4 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd";>
+<!DOCTYPE html>
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
=======================================
--- /src/robot/htmldata/rebot/report.html       Thu Feb 14 08:49:51 2013
+++ /src/robot/htmldata/rebot/report.html       Thu Feb 14 12:41:38 2013
@@ -1,4 +1,4 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd";>
+<!DOCTYPE html>
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
=======================================
--- /src/robot/htmldata/testdoc/testdoc.html    Thu Feb 14 02:03:22 2013
+++ /src/robot/htmldata/testdoc/testdoc.html    Thu Feb 14 12:41:38 2013
@@ -1,4 +1,4 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd";>
+<!DOCTYPE html>
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

==============================================================================
Revision: 305be54ecb80
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 13:12:03 2013
Log:      report: i accidentally. tablesorting borken.
http://code.google.com/p/robotframework/source/detail?r=305be54ecb80

Modified:
 /src/robot/htmldata/rebot/report.html

=======================================
--- /src/robot/htmldata/rebot/report.html       Thu Feb 14 12:41:38 2013
+++ /src/robot/htmldata/rebot/report.html       Thu Feb 14 13:12:03 2013
@@ -295,7 +295,7 @@
                   selectorSort: '.details-col-header'};
     if (sortByStatus)
         config['sortList'] = [[4, 0], [3, 0]];
-    var table = $('test-details');
+    var table = $('#test-details');
     table.tablesorter(config);
     // remove possibly invalid colgroup added by tablesorter
     // https://github.com/Mottie/tablesorter/issues/238

==============================================================================
Revision: 0992f6a52e58
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 14:04:57 2013
Log: log/report: jquery performance tuning (partly to make pycharm happier) and also whitespace
http://code.google.com/p/robotframework/source/detail?r=0992f6a52e58

Modified:
 /src/robot/htmldata/rebot/log.html
 /src/robot/htmldata/rebot/log.js
 /src/robot/htmldata/rebot/report.html

=======================================
--- /src/robot/htmldata/rebot/log.html  Thu Feb 14 12:41:38 2013
+++ /src/robot/htmldata/rebot/log.html  Thu Feb 14 14:04:57 2013
@@ -80,7 +80,7 @@
     }
 }

-function drawErrorsRecursively(){
+function drawErrorsRecursively() {
     if (!window.errorsToRender.hasNext())
         return;
     var elements = popFromIterator(window.errorsToRender, 10);
@@ -119,9 +119,9 @@
 }

 function addTestExecutionLog(main) {
-    $('<h2>Test Execution Log</h2>').appendTo($('body'));
-    var root = $.tmpl('suiteTemplate', main);
-    root.appendTo($('body'));
+    var body = $('body');
+    $('<h2>Test Execution Log</h2>').appendTo(body);
+    $.tmpl('suiteTemplate', main).appendTo(body);
 }
 </script>

@@ -145,8 +145,7 @@
       </div>
       <div class="tag-links">
         {{each links}}
-        <span>[<a href="${$value.url}"
-                  title="${$value.url}">{{html $value.title}}</a>]</span>
+ <span>[<a href="${$value.url}" title="${$value.url}">{{html $value.title}}</a>]</span>
         {{/each}}
       </div>
     </td>
@@ -174,8 +173,7 @@
   <tr>
     <td class="error-time">
       {{if link}}
-      <a onclick="makeElementVisible('${link}')" href="#${link}"
-         title="Link to details">${date} ${time}</a>
+ <a onclick="makeElementVisible('${link}')" href="#${link}" title="Link to details">${date} ${time}</a>
       {{else}}
       ${date} ${time}
       {{/if}}
=======================================
--- /src/robot/htmldata/rebot/log.js    Thu Feb 14 01:20:27 2013
+++ /src/robot/htmldata/rebot/log.js    Thu Feb 14 14:04:57 2013
@@ -20,9 +20,9 @@

 function toggleElement(elementId, childrenNames) {
     var element = $('#' + elementId);
-    var children = element.find('> .children');
+    var children = element.children('.children');
     children.toggle(100, '', function () {
- element.find('> .element-header
.folding-button').toggleClass('closed');
+ element.children('.element-header').children('.folding-button').toggleClass('closed');
     });
     populateChildren(elementId, children, childrenNames);
 }
@@ -68,9 +68,9 @@

 function expandElement(item) {
     var element = $('#' + item.id);
-    var children = element.find('> .children');
+    var children = element.children('.children');
     children.show(0, '', function () {
- element.find('> .element-header
.folding-button').removeClass('closed');
+ element.children('.element-header').children('.folding-button').removeClass('closed');
     });
     populateChildren(item.id, children, item.childrenNames);
 }
=======================================
--- /src/robot/htmldata/rebot/report.html       Thu Feb 14 13:12:03 2013
+++ /src/robot/htmldata/rebot/report.html       Thu Feb 14 14:04:57 2013
@@ -59,12 +59,14 @@
 });

 function setBackground(topsuite) {
+    var color;
     if (topsuite.criticalFailed)
-        $("body").css("background-color", window.settings.background.fail);
+        color = window.settings.background.fail;
     else if (topsuite.totalFailed)
- $("body").css("background-color", window.settings.background.nonCriticalFail);
+        color = window.settings.background.nonCriticalFail;
     else
-        $("body").css("background-color", window.settings.background.pass);
+        color = window.settings.background.pass;
+    $('body').css('background-color', color);
 }

 function addSummary(topsuite) {
@@ -232,7 +234,7 @@
 function drawTestDetailsTable(tests, sortByStatus) {
     renderTestDetailsHeader();
     window.elementsToRender = tests;
-    var target = $('#test-details > tbody');
+    var target = $('#test-details').find('tbody');
     renderTestDetails(sortByStatus, target);
 }


==============================================================================
Revision: 46f532dd19ea
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 15:47:05 2013
Log: testdoc: removed unnecessary expandElement - can use toggleElement instead
http://code.google.com/p/robotframework/source/detail?r=46f532dd19ea

Modified:
 /src/robot/htmldata/testdoc/testdoc.html

=======================================
--- /src/robot/htmldata/testdoc/testdoc.html    Thu Feb 14 12:41:38 2013
+++ /src/robot/htmldata/testdoc/testdoc.html    Thu Feb 14 15:47:05 2013
@@ -41,7 +41,7 @@
     addTitle(window.testdoc.title);
     addGenerated(window.testdoc.generated, window.testdoc.generatedMillis);
     addSuite(window.testdoc.suite, 'body');
-    expandElement(window.testdoc.suite.id);
+    toggleElement(window.testdoc.suite.id);
 });

 function parseTemplates() {
@@ -98,14 +98,6 @@
element.find('> .element-header
.folding-button').toggleClass('closed');
     });
 }
-
-function expandElement(elementId) {
-    var element = $('#' + elementId);
-    var children = element.find('> .children');
-    children.show(0, '', function () {
- element.find('> .element-header
.folding-button').removeClass('closed');
-    });
-}

 function expandAllChildren(elementId) {
     var element = $('#' + elementId);

==============================================================================
Revision: 1e8a887179f1
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 16:14:02 2013
Log: log: performance enhancement to expand. mostly reverting back to old.

1) unique ids to folding buttons and children - faster to select than via parent 2) avoid .show() w/ callback because it slowed down performance a lot. this was noticed in tests and also mentioned in [1] 3) avoid .show() in general and use .css({'display': 'block'}) instead. according to [1], and based on tests, this is a bit faster.

[1] http://www.learningjquery.com/2010/05/now-you-see-me-showhide-performance
http://code.google.com/p/robotframework/source/detail?r=1e8a887179f1

Modified:
 /src/robot/htmldata/rebot/log.html
 /src/robot/htmldata/rebot/log.js

=======================================
--- /src/robot/htmldata/rebot/log.html  Thu Feb 14 14:04:57 2013
+++ /src/robot/htmldata/rebot/log.html  Thu Feb 14 16:14:02 2013
@@ -186,7 +186,7 @@
 <script type="text/x-jquery-tmpl" id="suiteTemplate">
   <div id="${id}" class="suite">
<div class="element-header" onclick="toggleSuite('${id}')" title="${fullName}">
-      <div class="folding-button closed"></div>
+      <div id="${id}-folding-button" class="folding-button closed"></div>
       <div class="element-header-text">
         <span class="${status.toLowerCase()}">TEST SUITE: </span>
         <span class="name">{{html name}}</span>
@@ -194,7 +194,7 @@
       <a class="expand" href="javascript:expandAllChildren('${id}')"
          onclick="stopPropagation(event)">Expand All</a>
     </div>
-    <div class="children">
+    <div id="${id}-children" class="children">
       <table class="metadata">
         <tr>
           <th>Full Name:</th>
@@ -244,7 +244,7 @@
 <script type="text/x-jquery-tmpl" id="testTemplate">
   <div id="${id}" class="test">
<div class="element-header" onclick="toggleTest('${id}')" title="${fullName}">
-      <div class="folding-button closed"></div>
+      <div id="${id}-folding-button" class="folding-button closed"></div>
       <div class="element-header-text">
         <span class="${status.toLowerCase()}">TEST CASE: </span>
         <span class="name">{{html name}}</span>
@@ -253,7 +253,7 @@
       <a class="expand" href="javascript:expandAllChildren('${id}')"
          onclick="stopPropagation(event)">Expand All</a>
     </div>
-    <div class="children">
+    <div id="${id}-children" class="children">
       <table class="metadata">
         <tr>
           <th>Full Name:</th>
@@ -299,7 +299,7 @@
 <script type="text/x-jquery-tmpl" id="keywordTemplate">
   <div id="${id}" class="keyword">
<div class="element-header" onclick="toggleKeyword('${id}')" title="${name}">
-      <div class="folding-button closed"></div>
+      <div id="${id}-folding-button" class="folding-button closed"></div>
       <div class="element-header-text">
         <span class="${status.toLowerCase()}">${type}: </span>
         <span class="name">{{html name}}</span>
@@ -308,7 +308,7 @@
       <a class="expand" href="javascript:expandAllChildren('${id}')"
          onclick="stopPropagation(event)">Expand All</a>
     </div>
-    <div class="children">
+    <div id="${id}-children" class="children">
       <table class="metadata keyword-metadata">
         {{if doc()}}
         <tr>
=======================================
--- /src/robot/htmldata/rebot/log.js    Thu Feb 14 14:04:57 2013
+++ /src/robot/htmldata/rebot/log.js    Thu Feb 14 16:14:02 2013
@@ -19,10 +19,9 @@
 }

 function toggleElement(elementId, childrenNames) {
-    var element = $('#' + elementId);
-    var children = element.children('.children');
+    var children = $('#' + elementId + '-children');
     children.toggle(100, '', function () {
- element.children('.element-header').children('.folding-button').toggleClass('closed');
+        $('#' + elementId + '-folding-button').toggleClass('closed');
     });
     populateChildren(elementId, children, childrenNames);
 }
@@ -67,12 +66,11 @@
 }

 function expandElement(item) {
-    var element = $('#' + item.id);
-    var children = element.children('.children');
-    children.show(0, '', function () {
- element.children('.element-header').children('.folding-button').removeClass('closed');
-    });
+    var children = $('#' + item.id + '-children');
+ // .css is faster than .show and .show w/ callback would be terribly slow
+    children.css({'display': 'block'});
     populateChildren(item.id, children, item.childrenNames);
+    $('#' + item.id + '-folding-button').removeClass('closed');
 }

 function expandElementWithId(elementid) {

==============================================================================
Revision: 2b4c01a7645c
Branch:   default
Author:   Pekka Klärck
Date:     Thu Feb 14 16:37:41 2013
Log: log/model: no need to have default implementation for callWhenChildrenReady in base model object when only suite uses it and others override
http://code.google.com/p/robotframework/source/detail?r=2b4c01a7645c

Modified:
 /src/robot/htmldata/rebot/model.js

=======================================
--- /src/robot/htmldata/rebot/model.js  Wed Jun 27 14:59:00 2012
+++ /src/robot/htmldata/rebot/model.js  Thu Feb 14 16:37:41 2013
@@ -11,6 +11,7 @@
         suite.populateTests = createIterablePopulator("Test");
         suite.populateSuites = createIterablePopulator("Suite");
         suite.childrenNames = ['keyword', 'suite', 'test'];
+        suite.callWhenChildrenReady = function (callable) { callable(); };
         suite.message = data.message;
         suite.children = function () {
return suite.keywords().concat(suite.tests()).concat(suite.suites());
@@ -94,8 +95,7 @@
             doc: data.doc,
             status: data.status,
             times: data.times,
- id: data.parent ? data.parent.id + "-" + symbol + (data.index + 1) : symbol + "1",
-            callWhenChildrenReady: function (callable) { callable(); }
+ id: data.parent ? data.parent.id + "-" + symbol + (data.index + 1) : symbol + "1"
         };
     }

--

--- You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to robotframework-commit+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to