Skip to content

Table layout causes diff and line highlight errors #142

Open
@robertg042

Description

@robertg042

Hi, first of all, thanks for the awesome plugin!

While testing in IE and in modern webkit browsers, I discovered few issues. The common culprit seems to be usage of table layout and the fact that relative positioning of elements is not always respected in this layout.

  1. In IE line hightlight is not displayed at all, because of custom variables, which I guess is ok. If you set regular background-color you'll find that grvsc-line::before pseudoelement is mispositioned:

IE with custom background

  1. In modern Chrome, Safari and Edge, however, position: relative on display: table-row on grvsc-line is not respected, which results in width: 100% applied to grvsc-line::before being equal to the width of grvsc-container and not grvsc-line. It causes problems with highlight beyond horizontal overflow:

chrome, diff, not scrolled

chrome, diff, scrolled

chrome, highlight, not scrolled

chrome, highlight, scrolled

Those styles seems to work as a workaround:

  .grvsc-code {
    position: relative;
    width: 100%;
  }
  .grvsc-line {
    position: static;
  }

Firefox has no issues:

firefox

Sources:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedWould love a PR

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions