1. Marcin Kuzminski
  2. RhodeCode

Issues

Issue #553 new

Annotation lines fail to line up on files which contain italics and windows chrome

Andrew Suffield
created an issue

The conditions needed to reproduce the bug are:

  • a source file which would have some text rendered in italic. I used a C file with many comments in it
  • a windows web browser. I used Chrome 21

The annotated source view will show the line numbers and annotations starting some distance below the top of their box. Closer investigation will show that all columns have the same number of lines in them, but all line numbers and annotations are 15px high, while all bits of source code that are in italics are 16px high, ruining the whole layout.

This is a combination of the unfortunate windows font rendering behavior, where asking for italics makes your text one pixel higher, and some misplaced CSS. Some well-meaning person has placed line-height: 15px on div.code-highlight, but setting line-height on a block element containing inline elements (like the spans wrapping all text) only defines a minimum line height for the text contained within them.

In order to set the line height to a fixed value, either set line-height on the inline span elements themselves, or make the spans inline-block elements. I think.

Comments (14)

  1. Marcin Kuzminski repo owner

    Hmm i see the issues on windows, but setting line-height or height to 15px doesn't really help a lot (some elements still renders as 16px) i think i need some CSS expert

  2. Alexey Larikov

    I've fixed this issue. I've also reworked formatting for annotate and file view. Now it uses table layout, so it won't break anywhere. Check these commits:

    https://bitbucket.org/zinzila/rhodecode-pam-authentication/commits/3fe56ee19692ec4e287efe680235824518b00b87

    https://bitbucket.org/zinzila/rhodecode-pam-authentication/commits/b251b855b3a2332d5fc8d9245ad9581c351dc1ff

    Note: there is also fix in helpers.py in this revision: https://bitbucket.org/zinzila/rhodecode-pam-authentication/commits/b251b855b3a2332d5fc8d9245ad9581c351dc1ff

  3. Log in to comment