Closed Bug 1095937 Opened 11 years ago Closed 1 year ago

improve inline-sizing of orthogonal flows

Categories

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

defect

Tracking

()

RESOLVED FIXED
138 Branch
Tracking Status
firefox138 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

References

(Blocks 1 open bug)

Details

Attachments

(4 files, 1 obsolete file)

When we reflow an orthogonal flow, we currently apply an mOrthogonalLimit from a parent reflow state that is based on the top-level viewport size. This leads to poor results when the orthogonal flow's parent is itself a smaller block, not the page as a whole. See attached testcase.
Attachment #8519464 - Flags: review?(smontagu)
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Comment on attachment 8519464 [details] [diff] [review] Apply better inline-size limits to orthogonal flows. Cancelling r? for now, as this appears to have a bad effect on other examples I've been playing with. Needs further investigation.
Attachment #8519464 - Flags: review?(smontagu)
Attached file testcase

Hi jfkthame,
I'm not sure what you were trying to do here, but css-writing-modes has some fairly specific rules about orthogonal flow sizing in https://www.w3.org/TR/css-writing-modes-3/#orthogonal-flows

I've attached a testcase which shows some interesting ways in which the current mOrthogonalLimit system fails. In particular the code you're trying to modify in Initi() doesn't work if the frame that has an mOrthogonalLimit set doesn't happen to be orthogonal to an orthogonal flow (because we've nested orthogonal writing modes). You can see this case in the 'auto' example of the testcase, which ends up sizing as max-content instead of as the ICB height due to the nesting.

Assignee: jfkthame → fantasai.bugs

This patch brings us in line with css-writing-modes-3 wrt orthogonal limits.

(It doesn't handle resizing of the ICB correctly, but that's an existing problem. Fixing that requires invalidating layout of the orthogonal flow at appropriate times, which is a bit tricky since the frame relationship is quite indirect, which is probably why we don't do it right now. I can try to figure that out, but I'd prefer to land this first and handle that separately.)

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: fantasai.bugs → nobody
Status: ASSIGNED → NEW
Severity: normal → S3

Jonathan, this bug came to mind. Do you feel fantasai's patch might help bug 1310551?

Flags: needinfo?(jfkthame)

I think the approach in D45948 isn't quite right, as it "accumulates" constraints from successive scroll frames, but the spec actually says to consider only the closest ancestor scroll frame. That led to the WPT failure fantasai noted in https://phabricator.services.mozilla.com/D45948#1524904. The patch also didn't account for a fixed size of the immediate containing block, and as a result it didn't fix examples like bug 1949064.

I'm landing an alternative patch in bug 1949064 that should fix these issues. I notice that fantasai's patch also included some new WPT reftests, so we should extract those and add them to the suite, for increased test coverage.

Flags: needinfo?(jfkthame)
Attachment #8519464 - Attachment is obsolete: true

These are the new tests that were included in fantasai's patch D45948.
With the patch that landed in bug 1949064 they should all now pass.

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Blocks: 1953570
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bb95e001c526 Add new WPT reftests for orthogonal-flow available-size constraints. r=layout-reviewers,emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/51315 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 138 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: