Closed Bug 1565826 Opened 5 years ago Closed 5 years ago

css calc() function returns 0 on height attribute with percentage

Categories

(Core :: CSS Parsing and Computation, defect)

68 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1259924

People

(Reporter: matthieu.xillo, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

Steps to reproduce:

Just load the following HTML code:
<html><head></head><body><div style="background-color: #F00;width: 100%;height: 100%;height: calc(100% - 50px);"></div></body></html>

Actual results:

The div doesn't appear, because its height is equal to 0.

Expected results:

The div should appear, with the right height.
The width attribute doesn't have this issue. Strange.

Summary: css calc() function returns 0 on height attribute → css calc() function returns 0 on height attribute with percentage

Actually, using vh instead of % seems to work well.

Hi Matthieu,
i have managed to reproduce the bug also on windows on release version(ie shows div correctly ). I will assign a component in order to make it verified by a developer.

Regards
David

Status: UNCONFIRMED → NEW
Component: Untriaged → CSS Parsing and Computation
Ever confirmed: true
Product: Firefox → Core

This is only on quirks mode, and it's a WebKit/Chromium quirk. If you add <!doctype html>, then Chromium and Firefox behave the same.

So this is ~invalid, we track the Chromium interop issue in bug 1259924.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: