[LNT] r253375 - [html] Move deprecated align/width/bgcolor attributes into the style attribute. NFC.

Arnaud A. de Grandmaison via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 13:02:50 PST 2015


Author: aadg
Date: Tue Nov 17 15:02:49 2015
New Revision: 253375

URL: http://llvm.org/viewvc/llvm-project?rev=253375&view=rev
Log:
[html] Move deprecated align/width/bgcolor attributes into the style attribute. NFC.

The align, width and bgcolor attributes from tags <td> and <th> are obsolete
(refer to http://www.w3.org/TR/html-markup/td.html#td-constraints and
http://www.w3.org/TR/html-markup/th.html#th-constraints). The CSS has
to be used instead. CSS is however not an option in our case because
some mail clients (like Gmail) do not accept them, so we have to pass
those deprecated attributes in the style attribute.

We are now constructing the style attribute from a part coming from the
python script (with the styles dict) plus a part from the template
itself. Should the relevant styles.attr be undefined (or empty), an
empty string will be produced; there will be an extra semicolon, but
this's valid syntax.

Modified:
    lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html
    lnt/trunk/lnt/server/ui/templates/reporting/runs.html
    lnt/trunk/lnt/server/ui/templates/v4_machine.html

Modified: lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html?rev=253375&r1=253374&r2=253375&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html (original)
+++ lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html Tue Nov 17 15:02:49 2015
@@ -71,7 +71,7 @@
       <a href="{{ ts_url }}/{{ key_run.id }}">{{
         key_run.order.llvm_project_revision}}</a></td>
 {%-   else -%}
-    <td style="{{ styles.td }}" bgcolor="#FF0000">N/A</td>
+    <td style="{{ styles.td }}; background-color:#FF0000">N/A</td>
 {%-   endif -%}
 {%- endfor %}
   </tr>
@@ -84,9 +84,9 @@
 
 {%- if (test_status == analysis.REGRESSED or
        test_status == analysis.UNCHANGED_FAIL) %}
-    <td style="{{ styles.td }}" bgcolor="#e98080">FAIL</td>
+    <td style="{{ styles.td }}; background-color:#e98080">FAIL</td>
 {%- else %}
-    <td style="{{ styles.td }}" bgcolor="#d2d2d2"> {#- -#}
+    <td style="{{ styles.td }}; background-color:#d2d2d2"> {#- -#}
       {{ ("%.4f" % cr.current) if cr.current != none else "N/A" }}</td>
 {%- endif -%}
 
@@ -98,9 +98,9 @@
 {%- set value_status = cr.get_value_status() -%}
 {%- if (test_status == analysis.REGRESSED or
        test_status == analysis.UNCHANGED_FAIL) %}
-    <td style="{{ styles.td }}" bgcolor="#e98080">FAIL</td>
+    <td style="{{ styles.td }}; background-color:#e98080">FAIL</td>
 {%- elif test_status == analysis.IMPROVED %}
-    <td style="{{ styles.td }}" bgcolor="#8fdf5f">PASS</td>
+    <td style="{{ styles.td }}; background-color:#8fdf5f">PASS</td>
 {%- else -%}
 {%- if (value_status == analysis.REGRESSED or
        value_status == analysis.IMPROVED) %}

Modified: lnt/trunk/lnt/server/ui/templates/reporting/runs.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/reporting/runs.html?rev=253375&r1=253374&r2=253375&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/reporting/runs.html (original)
+++ lnt/trunk/lnt/server/ui/templates/reporting/runs.html Tue Nov 17 15:02:49 2015
@@ -15,7 +15,7 @@
    <p>
      <table style="{{ styles['table'] }}">
        <tr>
-         <th style="{{ styles['th'] }}" width="500">{{ bucket_name }} - {{ field_display_name }}</th>
+         <th style="{{ styles['th'] }}; width:500px">{{ bucket_name }} - {{ field_display_name }}</th>
        {% if not show_perf %}
          <tbody class="searchable">
          {% for name in test_names %}
@@ -112,9 +112,9 @@
   <thead>
     <tr>
       <th style="{{ styles['th'] }}">Status Group</th>
-      <th style="{{ styles['th'] }}" align="right">#</th>
+      <th style="{{ styles['th'] }}; text-align:right">#</th>
       {% if baseline %}
-        <th style="{{ styles['th'] }}" align="right"># (B)</th>
+        <th style="{{ styles['th'] }}; text-align:right"># (B)</th>
       {% endif %}
     </tr>
   </thead>
@@ -123,9 +123,9 @@
     {% if num_items or num_items_vs_baseline %}
       <tr>
         <td style="{{ styles['td'] }}">{{ name }}</td>
-        <td style="{{ styles['td'] }}" align="right">{{ num_items }}</td>
+        <td style="{{ styles['td'] }}; text-align:right">{{ num_items }}</td>
         {% if baseline %}
-        <td style="{{ styles['td'] }}" align="right">{{ num_items_vs_baseline }}</td>
+        <td style="{{ styles['td'] }}; text-align:right">{{ num_items_vs_baseline }}</td>
         {% endif %}
       </tr>
     {% endif %}
@@ -134,7 +134,7 @@
   <tfoot>
     <tr>
       <td style="{{ styles['td'] }}"><b>Total Tests</b></td>
-      <td style="{{ styles['td'] }}" align="right"><b>{{ num_total_tests }}</b></td>
+      <td style="{{ styles['td'] }}; text-align:right"><b>{{ num_total_tests }}</b></td>
       {% if baseline %}
       <td></td>
       {% endif %}

Modified: lnt/trunk/lnt/server/ui/templates/v4_machine.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_machine.html?rev=253375&r1=253374&r2=253375&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_machine.html (original)
+++ lnt/trunk/lnt/server/ui/templates/v4_machine.html Tue Nov 17 15:02:49 2015
@@ -75,7 +75,7 @@
     {% for run in runs %}
     <tr>
       {% if loop.first %}
-      <td rowspan="{{ runs|length }}" align=right>{{ order.as_ordered_string() }}</td>
+      <td rowspan="{{ runs|length }}" style="text-align:right">{{ order.as_ordered_string() }}</td>
       {% endif %}
       <td><span class="utctime">{{ run.start_time.isoformat() }}</span></td>
       <td>{{ run.end_time - run.start_time }}s</td>




More information about the llvm-commits mailing list