diff options
author | Ned Batchelder <nedbat@gmail.com> | 2018-05-28 11:12:04 +0000 |
---|---|---|
committer | Ned Batchelder <nedbat@gmail.com> | 2018-05-28 11:12:04 +0000 |
commit | 0ec270a86635d70a8aebc227231feecac6e4c7c5 (patch) | |
tree | 28d4aa03c84d53832019d4cf90bcc0c40dd042b9 | |
parent | 9d2da185cedc973852ed9ae1f2b61cd7f17d6f98 (diff) | |
parent | 1ea419731992fbfa03aed3d92e420965a1eed0c5 (diff) | |
download | python-coveragepy-0ec270a86635d70a8aebc227231feecac6e4c7c5.tar.gz |
Merged in pankajp/coveragepy/pankajp/faster-html-report-ui (pull request #141)
Faster html report ui in browser
-rw-r--r-- | coverage/htmlfiles/coverage_html.js | 9 | ||||
-rw-r--r-- | coverage/htmlfiles/style.css | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/coverage/htmlfiles/coverage_html.js b/coverage/htmlfiles/coverage_html.js index f6f5de2..b7fbd9c 100644 --- a/coverage/htmlfiles/coverage_html.js +++ b/coverage/htmlfiles/coverage_html.js @@ -555,11 +555,14 @@ coverage.resize_scroll_markers = function () { var previous_line = -99, last_mark, - last_top; + last_top, + offsets = {}; + // Calculate line offsets outside loop to prevent relayouts + c.missed_lines.each(function(){offsets[this.id] = $(this).offset().top}); c.missed_lines.each(function () { - var line_top = Math.round($(this).offset().top * marker_scale), - id_name = $(this).attr('id'), + var id_name = $(this).attr('id'), + line_top = Math.round(offsets[id_name] * marker_scale), line_number = parseInt(id_name.substring(1, id_name.length)); if (line_number === previous_line + 1) { diff --git a/coverage/htmlfiles/style.css b/coverage/htmlfiles/style.css index 86b8209..12e9064 100644 --- a/coverage/htmlfiles/style.css +++ b/coverage/htmlfiles/style.css @@ -365,6 +365,7 @@ td.text { height: 100%; background: white; border-left: 1px solid #eee; + will-change: transform; /* for faster scrolling of fixed element in Chrome */ } #scroll_marker .marker { |