Skip to content

Wrong size for replaced element with natural height and aspect ratio, but not natural width #42573

Closed

Description

@Loirooriol
<!DOCTYPE html>
<style>
svg {
  background: black;
  width: auto;
  height: auto;
}
</style>
<svg viewBox="0 0 1 1" height="100"></svg>

It's 300x300 in Servo, but 100x100 in Gecko, Blink and WebKit.

Servo Expected
Image Image

https://drafts.csswg.org/css2/#inline-replaced-height

If height and width both have computed values of auto and the element also has an intrinsic height, then that intrinsic height is the used value of height.

https://drafts.csswg.org/css2/#inline-replaced-width

If height and width both have computed values of auto and the element has no intrinsic width, but does have an intrinsic height and intrinsic ratio; [...] then the used value of width is:

   (used height) * (intrinsic ratio)

Activity

  1. added
    A-layout/2020
    on Feb 12, 2026
  2. added a commit that references this issue on Feb 12, 2026
    28065df
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/2020

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions