Closed Bug 1747934 Opened 2 years ago Closed 2 years ago

::marker does not support CSS property line-height

Categories

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

Firefox 95
defect

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: bugzilla, Assigned: emilio, Mentored)

References

Details

(Keywords: good-first-bug)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0

Steps to reproduce:

Set the line-height property on a list marker using this:

li::marker {
    content: '*';
    line-height: 30px;
}

Actual results:

The vertical position of the marker stays the same whatever value line-height has. The value for line-height does not matter, 50px or 2 also have no effect.

The result is that the character is positioned too high, above the center of the first line of the list item content.

Expected results:

The vertical position should change depending on the value for line-height.

That is based on this MDN description, which states that ::marker supports All font properties, which explicitly lists line-height as one of the properties.

The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core
Attached file Test-case

MDN is not the spec. The marker spec mentions only the css-fonts spec, but line-height doesn't live in the fonts spec, it lives here. The marker spec really says:

Inheritable properties that apply to text can be set on the ::marker pseudo-element: these will inherit to and take effect on its text contents.

Which is quite hand-wavy IMO :/

Anyways, this is probably not problematic to support. Should be a matter of special-casing line-height here, so a one-liner, and adding a test if there isn't one.

At the very least there's testing/web-platform/tests/css/css-pseudo/marker-line-height.html.ini and css/css-pseudo/parsing/marker-supported-properties.html that should have new passes.

Mentor: emilio
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: good-first-bug
Priority: -- → P3

There are other properties tested there which should be straight-forward to support too.

MDN is not the spec.

Perhaps change the text on MDN?

See Also: → 1750905
Assignee: nobody → emilio
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fdb8148fec20
Apply line-height to ::marker. r=layout-reviewers,jfkthame
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/c0f50e1142c9
set some line-height/font marker test steps as passing. CLOSED TREE
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/97ee782e42e8
Make marker-line-height pass reliably in all platforms.
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/32459 for changes under testing/web-platform/tests
Pushed by mlaza@mozilla.com:
https://hg.mozilla.org/mozilla-central/rev/cc33400f0ff8
Make marker-line-height pass reliably in all platforms.
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: