Closed Bug 1788187 Opened 2 years ago Closed 1 year ago

Orthogonal content's block size that contributes to the intrinsic inline size of an element should be transferred

Categories

(Core :: Layout, defect)

Firefox 106
defect

Tracking

()

RESOLVED DUPLICATE of bug 1310551

People

(Reporter: zsun, Unassigned)

References

Details

Attachments

(1 file)

(deleted), text/html
Details
Attached file test.html (deleted) —

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0

Steps to reproduce:

Run attached test file in Firefox.

Actual results:

Inline size of the element for the vertical writing mode cases (1st and 2nd sub cases) are smaller than the content block size. The block size of the content is not transferred to the element's inline size.

Expected results:

In the case that inline size of an element is intrinsic and the content of the element is orthogonal, if the content has the block size that contributes to the inline size of the element, the content's block size should be transferred to the inline size of the element.

This issue also causes the failure of wpt test -
testing/web-platform/tests/css/css-sizing/contain-intrinsic-size/contain-intrinsic-size-008.html

Ah, no, it doesn't, nvm. This is a bit tricky, I think, because generally we don't have a good way of computing that block size without running layout. Do you know how other engines deal with this? Do they just check for explicit lengths or something? Or do they actually flow the orthogonal element?

I'm pretty sure we have a bug on file for this, let me try to find it...

Flags: needinfo?(ziran.sun)

WebKit is also affected.
I guess Blink addresses this with

void LayoutBlock::ComputeChildPreferredLogicalWidths(
    LayoutObject& child,
    LayoutUnit& min_preferred_logical_width,
    LayoutUnit& max_preferred_logical_width) const {
  NOT_DESTROYED();
  if (child.IsBox() &&
      child.IsHorizontalWritingMode() != IsHorizontalWritingMode()) {
    // If the child is an orthogonal flow, child's height determines the width,
    // but the height is not available until layout.
    // https://drafts.csswg.org/css-writing-modes/#orthogonal-shrink-to-fit
    if (!child.NeedsLayout()) {
      min_preferred_logical_width = max_preferred_logical_width =
          To<LayoutBox>(child).LogicalHeight();
      return;
    }
    min_preferred_logical_width = max_preferred_logical_width =
        To<LayoutBox>(child).ComputeLogicalHeightWithoutLayout();
    return;
  }
Severity: -- → S3
Flags: needinfo?(ziran.sun)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #4)

I think this is just bug 1473789.

I think so. bug 1310551 is the older version of this bug; duping there.

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1310551
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: