Closed Bug 1927699 Opened 1 year ago Closed 4 months ago

Overriding line-height doesn't reset the value properly.

Categories

(Core :: CSS Parsing and Computation, defect, P3)

Firefox 132
defect

Tracking

()

RESOLVED FIXED
153 Branch
Tracking Status
firefox153 --- fixed

People

(Reporter: robin, Assigned: salipov)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36

Steps to reproduce:

The following codepen shows that when you set a global line-height in a * selector, and then override it for a specific selector, it still uses the old value.

If you compare the codepen between Chrome and Firefox, you'll notice that in Chrome the lines are really close together (at a line-height of 1), but in Firefox they're really far apart (the old value 5).

https://codepen.io/Robin-Mosterd/pen/eYqMzwK

Actual results:

The line-height was at the wrong, old value.

Expected results:

The line-height should've been overwritten to 1.

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core

The severity field is not set for this bug.
:jwatt, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jwatt)

Weird the cascade would fail for this specific property.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(jwatt)
Priority: -- → P3

Oh, <br> has line-height: 5 which is affecting the layout.

I think we need to take parent's font metric (setting font-size on br has a similar issue) and line height here.

See Also: → 1621387
Assignee: nobody → salipov
Attachment #9595768 - Attachment description: Bug 1927699: Fixing br behaviour with inheritance. r=#style → Bug 1927699: Prevent <br> from having its own block size via its own line-height or font properties. r=#style
Pushed by dshin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c240063f8024 https://hg.mozilla.org/integration/autoland/rev/5571a3bdc2ad Prevent <br> from having its own block size via its own line-height or font properties. r=firefox-style-system-reviewers,layout-reviewers,dshin

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/60517 for changes under testing/web-platform/tests

Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch

Upstream PR merged by moz-wptsync-bot

QA Whiteboard: [qa-triage-done-c154/b153]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: