Skip to content

Should vertical-align:middle behave differently when the dominant baseline is not alphabetic? #4495

Closed
@dbaron

Description

@dbaron

In both the definition in CSS 2.1 and the definition in css-inline vertical-align: middle is defined as:

Align the vertical midpoint of the box with the baseline of the parent box plus half the x-height of the parent.

Nothing in the Inline-level alignment section of css-writing-modes appears to modify this definition.

Yet, as far as I can tell, this definition really makes sense primarily when the dominant baseline is alphabetic. If you're starting from an alphabetic baseline, adding half the x-height gives a position that could reasonably described as the "middle". If you're starting from a central baseline... I don't think it does.

In web-platform-tests/wpt@07210df @hshiozawa added tests to web-platform-tests that test this behavior for vertical text with a central baseline. Based on https://wpt.fyi/results/css/css-writing-modes it seems that these tests pass in Chrome (but no other engines). Mozilla bug 1220353 covers making them pass in Gecko.

We could try to implement this to pass these tests... but I'm hesitant to do so given that I don't see how the behavior makes sense.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions