Edgewall Software

Opened 9 years ago

Last modified 8 years ago

#11406 closed defect

diff.css is added twice on the diff_view page — at Version 1

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.1.2
Component: general Version:
Severity: normal Keywords: css
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

On a page such as /wiki/WikiStart?action=diff&version=2, the diff.css stylsheet is added to the page twice. I noticed this when trying to modify the CSS in the browser while working on #11403.

The issue happens for all the cases in which diff_view.html is used, since for each case there is a call to add_stylesheet in the Python code as well as the linking of the stylesheet in the template code:

$ grep -R "diff_view\.html" trac --exclude-dir=locale --exclude=*.pyc
trac/ticket/web_ui.py:        return 'diff_view.html', data, None
trac/ticket/web_ui.py:        return 'diff_view.html', data, None
trac/wiki/templates/wiki_diff.html:    <xi:include href="diff_view.html" />

The proposed change is:

  • trac/templates/diff_view.html

    diff --git a/trac/templates/diff_view.html b/trac/templates/diff_view.html
    index 3c74b8a..40542a2 100644
    a b  
    88  <xi:include href="layout.html" />
    99  <head>
    1010    <title>$title</title>
    11     <link rel="stylesheet" type="text/css" href="${chrome.htdocs_location}css/d
    1211    <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
    1312  </head>

The issue seems to have been present ever since the template was added in [4347] (it was named ticket_diff.html at that time). #11126 also suggests making this change, but doesn't mention that diff.css is added to the page twice.

It might be better to make the change on the trunk rather than on 1.0-stable since we might be concerned that a plugin utilizing diff_view.html is expecting diff.css to be added by the template.

Change History (1)

comment:1 by Ryan J Ollos, 9 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.