Skip to content

Code tag height changes with mouse move/window resize #18258

Closed as not planned
Closed as not planned

Description

@BojanKogoj

On github, for example The Rust compiler if you have <code> that breaks line and has padding its height will expand when you move your mouse or resize a window.

image

I was able to reproduce this with a small test case, but only expands height on window resize.

image

Test case:

<html>
    <head>
        <style>
            p {
                width: 150px;
            }
            code {
                padding: 0.2em;
                background-color: rgba(27,31,35,0.05);
                border: 1px solid red;
            }
        </style>
    </head>
    <body>
        <p>This is some <a href="#"><code>test text</code></a>.</p>
    </body>
</html>

Tested with servo nightly on Windows 10.

Activity

  1. BojanKogoj commented on Aug 27, 2017

    @BojanKogoj
    ContributorAuthor

    This is happening on span and strong as well as other inline elements I've tried. Updated test case

    <html>
        <head>
            <style>
                p {
                    width: 150px;
                    float: left;
                }
                span, strong, code {
                    padding: 0.1em;
                    background-color: rgba(27,31,35,0.05);
                    border: 1px solid red;
                }
            </style>
        </head>
        <body>
            <p>This is some <a href="#"><span>test text for span</span></a>.</p>
            <p>This is some <a href="#"><strong>test text for strong</strong></a>.</p>
            <p>This is some <a href="#"><code>test text for code</code></a>.</p>
        </body>
    </html>
    
  2. added
    C-has-manual-testcase
    on Aug 30, 2017
  3. atouchet commented on Nov 5, 2017

    @atouchet
    Contributor

    A similar issue comes up in https://duckduckgo.com/ as well. Part of the Learn More box that pops up when hovering over the DuckDuckGo logo stretches down the page (the text displays Learn More in Firefox and Duck it! in Servo).

    DuckDuckGo span

    <span class="logo_homepage__tt">Learn More</span>

  4. atouchet commented on Jan 17, 2018

    @atouchet
    Contributor

    Is this the same bug as #11840?

  5. lumiscosity commented on Jul 26, 2025

    @lumiscosity
    Member

    Appears to have been fixed. All windows are after moving the cursor. Tested on Arch Linux x86_64, servo built against commit id 9d29017, compared against Firefox 141.0, Epiphany 48.5 and Chromium 138.0.7204.168 (ordered left to right).

    Image
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

    A-layout/incrementalC-has-manual-testcase

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions