Open Bug 1329261 Opened 9 years ago Updated 3 years ago

All auto margins resolve to 0, on elements with vertical writing-mode (in a horizontal writing-mode parent)

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

Tracking Status
firefox53 --- affected

People

(Reporter: dholbert, Unassigned)

Details

(Keywords: DevAdvocacy, Whiteboard: [DevRel:P2])

Attachments

(2 files)

STR: 1. Load attached testacse. EXPECTED RESULTS: The bordered text should be horizontally centered in the viewport. ACTUAL RESULTS: The bordered text is not centered. It seems the auto margins have been treated as 0. Chrome dev 57 gives EXPECTED RESULTS. Firefox Nightly 53.0a1 (2017-01-05) (64-bit) gives ACTUAL RESULTS.
Attachment #8824492 - Attachment description: testcase 1 → testcase 1 (div's horizontal margins are "auto")
For comparison, here's a testcase with *all 4* margins set to "auto" on the vertical-writing-mode div here. I would tentatively expect this to be centered in at least one axis (vertical or horizontal). But Firefox seems to collapse all of the margins to 0, though. And Chrome seems to *try* to center it in *both* axes, though it fails in the vertical axis -- it uses the available *horizontal space* to determine the "centered" y-position. (So for e.g. a wide window, it may position the element at not-initially-visible position, off the bottom of the window.) jfkthame, have you run into this before, & do you know if there's spec text that describes what's supposed to happen here?
Flags: needinfo?(jfkthame)
Summary: Horizontal auto margins collapse to 0, on elements with vertical writing mode → All auto margins collapse to 0, on elements with vertical writing-mode (in a horizontal writing-mode parent)
I think I found the relevant spec text here is in this orthogonal-flows spec section -- it's the spec text around around sizing vs. positioning phase, which has an afterthought about auto margins: # Since 'auto' margins are resolved consistent with the containing block’s # writing mode, a box establishing an orthogonal flow can, once sized, # be aligned or centered within its containing block just like other # block-level boxes by using 'auto' margins. https://drafts.csswg.org/css-writing-modes-3/#orthogonal-flows This backs up comment 0's EXPECTED RESULTS. Basically, it seems like 'auto' margins should behave the same (centering vs. collapsing to 0), regardless of the writing-mode of the box that they apply to.
That sounds right, yes. I'm a bit surprised we don't handle this case at all (and apparently don't have reftests that would cover it), but it's a while now since I looked at any of that code.
Flags: needinfo?(jfkthame)
[updating summary with s/collapse/resolve/ to avoid giving the impression that this has anything to do with margin-collapsing between adjacent elements]
Summary: All auto margins collapse to 0, on elements with vertical writing-mode (in a horizontal writing-mode parent) → All auto margins resolve to 0, on elements with vertical writing-mode (in a horizontal writing-mode parent)
Keywords: DevAdvocacy
Whiteboard: [DevRel:P2]
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: