Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
This repository was archived by the owner on Apr 16, 2026. It is now read-only.

Line heights are calculated wrong with zero-width marker in Firefox #5755

Closed

Description

@thomasjm

Repro here: https://codepen.io/anon/pen/pGvrOa?editors=0110. Try putting the cursor on line 3 in Firefox. I used Firefox 64.0.

This happens when you try to make a TextMarker with replacedWith that a) spans the entire line and b) has zero width.

It works fine in Chrome, but in Firefox it messes up line height calculations and the cursor appears in the wrong place when you try to put it below the marker.

(Note that Chrome renders the line with the marker with normal line height, whereas Firefox renders it with no height. It makes sense to me that this is a weird thing to do and the resulting line height may be undefined--the bug is that the cursor placement is inconsistent with the apparent line height.)

Activity

  1. added a commit that references this issue on Feb 19, 2019
  2. marijnh commented on Feb 19, 2019

    @marijnh
    Member

    Attached patch somewhat fixes this—the line numbers will still overlap when a visible line ends up being less high than a line number, but at least the height calculations will make sense. Does that help?

  3. thomasjm commented on Feb 20, 2019

    @thomasjm
    ContributorAuthor

    That sounds great, thanks! I've been using CSS to hide the line numbers on such collapsed lines so that isn't a problem. Maybe auto-hiding the line number or something could be a separate issue but I'll close this one.

  4. added a commit that references this issue on Jan 6, 2020
  5. added a commit that references this issue on Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions