Skip to content

[css-values][quirks] Should calc() be affected by percentage height calculation quirk? #12420

Open
@Loirooriol

Description

@Loirooriol

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

In quirks mode, for the purpose of calculating the height of an element element, if [...] the specified value for the height property of element is a <percentage> [...] the containing block of element must be calculated using the following algorithm

It mentions <percentage>, but suspect this was written with CSS2 in mind. What should happen with a calc() that mixes a length and a percentage? https://drafts.csswg.org/css-values/#calc-func

Browsers don't agree: Blink and WebKit keep applying the quirk, while Firefox does not.

I think I prefer the Blink/WebKit behavior, it seems more self-consistent.

<!-- quirks -->
<div style="height: calc(50% + 10px); background: cyan">foo</div>

Note that as per CSS Values, calc(50% + 0px) computes to 50% so it has the quirk even in Firefox.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions