Open Bug 1788537 Opened 2 years ago Updated 29 days ago

Use "safe" centering (and "safe" -webkit-box-pack:end alignment) in -webkit-box flexbox emulation

Categories

(Core :: Layout: Flexbox, defect)

defect

Tracking

()

ASSIGNED

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(2 files)

We emulate -webkit-box using our same modern flexbox implementation with a few behavioral tweaks.

Just ran up against one place where we need one more behavioral tweak... in modern flexbox (and in our emulation of -webkit-box), we do "true" center- and end-alignment. (i.e. if the content is too large, it overflows off of the start side of the container in order to truly center or end-align)

But it seems Chrome and presumably also WebKit do "safe" alignment[1], i.e. they refuse to overflow the start edge and effectively fall back to start alignment if the content is larger than the container.

We should be able to match this with some special cases.

[1] with one exception, -webkit-box-align:end does "true" end alignment and overflows off of the start (top) of the container.

Summary: Use "safe" centering for webkit-box emulation → Use "safe" centering (and "safe" -webkit-box-pack:end alignment) in -webkit-box flexbox emulation

Firefox faithfully centers/end-aligns the content in both testcases (with the large orange box overflowing off the top/left side of its container to do so).

Chromium and WebKit fall back to "start" alignment for the large orange box here, except that for -webkit-box-align:end they really do end-align and overflow off the top of the box.

Given that this is a legacy compat feature, their behavior is by-definition the EXPECTED RESULTS here.

(In reply to Daniel Holbert [:dholbert] from comment #3)

Chromium and WebKit fall back to "start" alignment for the large orange box here, except that for -webkit-box-align:end they really do end-align and overflow off the top of the box.

(fortunately this behavior & the one exception for -webkit-box-align:end seem to hold up if I add -webkit-box-orient:vertical or a vertical writing mode to the attached testcases. The behavior stays the same -- falling back to "safe" alignment except for -webkit-box-align: end; which gets truly end-aligned)

Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Webcompat Priority: --- → P2

AFAICT the original site is fixed here, so I don't think we have any current known site breakage associated with this issue.

Webcompat Priority: P2 → ?
Webcompat Priority: ? → ---
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: