summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2020-11-26 11:53:54 -0500
committerNed Batchelder <ned@nedbatchelder.com>2020-11-26 11:53:54 -0500
commit954dbf013c4b04779437cb5ce62e53f3ee664235 (patch)
treef71c3276aac37735bd27abecdec27e9a6b3a649e
parent51678eccf354b434012e753161834418c61a01a3 (diff)
downloadpython-coveragepy-git-nedbat/no-select.tar.gz
Use a table. Almost works. Extra blank lines with annotationsnedbat/no-select
-rw-r--r--coverage/htmlfiles/pyfile.html8
-rw-r--r--coverage/htmlfiles/style.css4
-rw-r--r--coverage/htmlfiles/style.scss8
-rw-r--r--tests/gold/html/styled/style.css4
4 files changed, 13 insertions, 11 deletions
diff --git a/coverage/htmlfiles/pyfile.html b/coverage/htmlfiles/pyfile.html
index e19853d1..426ecc07 100644
--- a/coverage/htmlfiles/pyfile.html
+++ b/coverage/htmlfiles/pyfile.html
@@ -68,11 +68,12 @@
</div>
<div id="source">
+ <table>
{% for line in lines -%}
{% joined %}
- <div id="t{{line.number}}" class="p {{line.css_class}}">
+ <tr><td id="t{{line.number}}" class="p {{line.css_class}}">
<span class="n"><a href="#t{{line.number}}">{{line.number}}</a></span>
- <span class="t">{{line.html}}</span><span class="x">&#x2009;</span>
+ <span class="t">{{line.html}}</span>
{% if line.context_list %}
<input type="checkbox" id="ctxs{{line.number}}" />
{% endif %}
@@ -94,9 +95,10 @@
{% endfor %}
</span>
{% endif %}
- </div>
{% endjoined %}
+</td></tr>
{% endfor %}
+ </table>
</div>
<div id="footer">
diff --git a/coverage/htmlfiles/style.css b/coverage/htmlfiles/style.css
index 7f7880a9..ebd58dd3 100644
--- a/coverage/htmlfiles/style.css
+++ b/coverage/htmlfiles/style.css
@@ -124,6 +124,8 @@ h2.stats { margin-top: .5em; font-size: 1em; }
#source { padding: 1em 0 1em 3rem; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
+#source table { width: 100%; }
+
#source .p { position: relative; white-space: pre; }
#source .p * { box-sizing: border-box; }
@@ -202,8 +204,6 @@ h2.stats { margin-top: .5em; font-size: 1em; }
@media (prefers-color-scheme: dark) { #source .p.par.show_par .t:hover { background: #6d5d0c; } }
-#source .p .x { xxuser-select: none; }
-
#source .p .r { position: absolute; top: 0; right: 2.5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; }
#source .p .annotate { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; color: #666; padding-right: .5em; user-select: none; }
diff --git a/coverage/htmlfiles/style.scss b/coverage/htmlfiles/style.scss
index 3615c528..e9b339d5 100644
--- a/coverage/htmlfiles/style.scss
+++ b/coverage/htmlfiles/style.scss
@@ -351,6 +351,10 @@ $border-indicator-width: .2em;
padding: 1em 0 1em $left-gutter;
font-family: $font-code;
+ table {
+ width: 100%;
+ }
+
.p {
// position relative makes position:absolute pop-ups appear in the right place.
position: relative;
@@ -487,10 +491,6 @@ $border-indicator-width: .2em;
}
- .x {
- xxuser-select: none;
- }
-
.r {
position: absolute;
top: 0;
diff --git a/tests/gold/html/styled/style.css b/tests/gold/html/styled/style.css
index 7f7880a9..ebd58dd3 100644
--- a/tests/gold/html/styled/style.css
+++ b/tests/gold/html/styled/style.css
@@ -124,6 +124,8 @@ h2.stats { margin-top: .5em; font-size: 1em; }
#source { padding: 1em 0 1em 3rem; font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
+#source table { width: 100%; }
+
#source .p { position: relative; white-space: pre; }
#source .p * { box-sizing: border-box; }
@@ -202,8 +204,6 @@ h2.stats { margin-top: .5em; font-size: 1em; }
@media (prefers-color-scheme: dark) { #source .p.par.show_par .t:hover { background: #6d5d0c; } }
-#source .p .x { xxuser-select: none; }
-
#source .p .r { position: absolute; top: 0; right: 2.5em; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; }
#source .p .annotate { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; color: #666; padding-right: .5em; user-select: none; }