Skip to content

Percentage quirk should only apply when preferred size is a percentage #49025

Closed

Description

@Loirooriol

I don't think it makes much sense, but consider:

<!-- quirks -->
<style>.test { display: inline-block; vertical-align: top; background: cyan }</style>
<div style="border: solid 2px; height: 100px;">
  <div>
    <div class="test" style="height: 100%">text</div>
    <div class="test" style="min-height: 100%">text</div>
    <canvas class="test" height="20" width="20" style="height: 100%"></canvas>
    <canvas class="test" height="20" width="20" style="min-height: 100%"></canvas>
  </div>
</div>
Servo Gecko Blink & WebKit
Image Image Image

We treat 100% the same way in min-height vs height. However, min-height: 100% doesn't trigger the quirk in other browsers if height doesn't have a percentage. Or at least for replaced elements, Blink and WebKit are like Servo for non-replaced (which seems even weirder).

https://quirks.spec.whatwg.org/#the-percentage-height-calculation-quirk

the specified value for the height property of element is a <percentage>

So Gecko seems right.

Activity

  1. added
    C-has-manual-testcase
    A-layout/2020
    on Oct 19, 2026
  2. added a commit that references this issue on Nov 4, 2026
    6d3581d
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/2020C-has-manual-testcase

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions