Open Bug 1220353 Opened 10 years ago Updated 3 years ago

vertical-align: middle incorrect when dominant baseline is central (mixed, upright)

Categories

(Core :: Layout: Block and Inline, defect)

defect

Tracking

()

Tracking Status
firefox45 --- affected

People

(Reporter: bugzilla, Unassigned, NeedInfo)

References

(Blocks 1 open bug)

Details

(Keywords: testcase)

Unprefixed tests ---------------- http://test.csswg.org/suites/css-writing-modes-3_dev/nightly-unstable/html/vertical-alignment-vrl-022.htm http://test.csswg.org/suites/css-writing-modes-3_dev/nightly-unstable/html/vertical-alignment-vlr-023.htm http://test.csswg.org/suites/css-writing-modes-3_dev/nightly-unstable/html/vertical-alignment-vrl-024.htm http://test.csswg.org/suites/css-writing-modes-3_dev/nightly-unstable/html/vertical-alignment-vlr-025.htm Expected results ---------------- http://test.csswg.org/suites/css-writing-modes-3_dev/nightly-unstable/html/reference/vertical-alignment-vrl-022-ref.htm Explanations ------------ Valuable explanation image from Hajime Shiozawa (tests author): http://lists.w3.org/Archives/Public/public-css-testsuite/2015Oct/att-0001/verticalAlignMiddleWithCentralBaseline.png When dominant baseline is alphabetic (sideways), then Firefox 45 handles 'vertical-align: middle' correctly: see vertical-alignment-vrl-026 and vertical-alignment-vlr-027 tests at http://test.csswg.org/suites/css-writing-modes-3_dev/nightly-unstable/html/chapter-7.htm#s7.5 Notes ----- - Chrome 48.0.2547.0 passes these 4 tests - I am using Firefox 45.0a1 buildID=20151030030236 and Firefox 45 fails all 4 tests - I use Linux 3.16.0-66-generic x86_64, Qt: 4.8.6, KDE 4.14.3; Kubuntu (trusty) 14.04.03 LTS - I've searched for duplicates and did not find any.
Blocks: writing-mode
Keywords: testcase

Looking at these tests makes me wonder if this behavior is desirable.

In particular, the current definition of the alignment point for vertical-align: middle:

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

seems to assume that the parent has an alphabetic baseline -- that's why it wants to add half the x-height of the parent to get to a "middle" position.

But I don't see why adding half the x-height of the parent is desirable if you're starting from a central baseline.

It seems like a reasonable definition of middle, in a context where the dominant baseline is central, would be either:

  • just use the central baseline directly (probably better), or
  • use the alphabetic baseline and add half the x-height.

I'm inclined to think we should raise a spec issue here rather than fix these tests, but I'm curious what others think.

(...)

  1. The primary objective of the "central" vertical align is to align the center of lines. The value "middle" was defined as the center of x-height, which does not work for CJK use cases. So from my point of view, "central" aligns characters to characters (from user perspective, sometimes <img> are characters.)

  2. Assuming my understanding of "both use cases exist", "middle" already serves one, so making "central" the same as "middle" looses another use case.

  3. I prefer less differences when in horizontal and in vertical, unless it's really needed.
    (...)

https://lists.w3.org/Archives/Public/www-style/2015Jul/0008.html

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.