Closed Bug 1626146 Opened 5 years ago Closed 5 years ago

New wpt failures from PR 22519: /css/css-flexbox/flexitem-stretch-image.html

Categories

(Core :: Layout: Flexbox, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: wpt-sync, Assigned: dholbert)

References

Details

(Whiteboard: [wpt], [wptsync upstream])

Attachments

(1 file)

The following tests have untriaged failures in the CI runs for wpt PR 22519:

Firefox-only failures

/css/css-flexbox/flexitem-stretch-image.html
.flexbox 1: FAIL

These updates will be on mozilla-central once bug 1625821 lands.

Note: this bug is for tracking fixing the issues and is not
owned by the wpt sync bot.

This bug is linked to the relevant tests by an annotation in
https://github.com/web-platform-tests/wpt-metadata. These annotations
can be edited using the wpt interop dashboard
https://jgraham.github.io/wptdash/

If this bug is split into multiple bugs, please also update the
annotations, otherwise we are unable to track which wpt issues are
already triaged. Resolving as duplicate or closing this issue should
be cause the bot to automatically update or remove the annotation.

Summary: New wpt failures from PR 22519 → New wpt failures from PR 22519: /css/css-flexbox/flexitem-stretch-image.html

So we're disagreeing with the test's expectations about the height of the images here.

Here's a reduced testcase, where Firefox & EdgeHTML (pre-chromium Edge18) both size the image to a 200x200 square while Chrome & Safari size it to a 200x100 rectangle (leaving it at its intrinsic height):

data:text/html,<div style="display:flex;width:200px;border:1px solid black"><img style="flex:1" src="https://placekitten.com/100/100">

(As a fiddle: https://jsfiddle.net/dholbert/r802xo7p/ )

I recall this being a compat issue, though I don't recall what the spec says. [checking]

Yeah, this is a spot where we're doing the right thing.

The question here is: what's the cross-size of the flex line? Is it determined using the pre-flexing or post-flexing size of the image?

The flexbox spec makes it pretty explicit, I think:

Resolve the flexible lengths of all the flex items to find their used main size
9.4. Cross Size Determination

  1. Determine the hypothetical cross size of each item by performing layout with the used main size and the available space, treating auto as fit-content.
  2. Calculate the cross size of each flex line.
    [...] Among all the items [...], find the largest outer hypothetical cross size.
    https://drafts.csswg.org/css-flexbox-1/

In my reduced testcase (data-url / image), the item's used main size is 200px, and when we "perform layout with the used main size" (step 7 quoted above), we get a cross size of 200px, which is then used as this image's cross size and also the line's cross size (which then is reinforced as the image's cross size when it gets stretched to fit the line via default align-self:stretch behavior).

In the WPT test, browsers agree that first item's used main size is 345px, and so "perform layout with the used main size" produces a hypothetical cross size of 345px for that item (since it has a 1:1 aspect ratio). Similarly, the other item has a used main size of 255px and a hypothetical cross size of 245px. So the line's cross size is the largest of these, which is 345px, and both items should be stretched to this height per flexbox section 9.4 step 11.

So the test's expectation is wrong. It should have data-expected-height="345", instead of 100.

The underlying issue is already reported in Chromium's bug tracker as https://bugs.chromium.org/p/chromium/issues/detail?id=721123

This makes the test pass in Gecko and EdgeHTML and fail in Chromium/WebKit.
The test-failure is due to an underlying bug that these engines share, which is
filed as:
https://bugs.chromium.org/p/chromium/issues/detail?id=721123
https://bugs.webkit.org/show_bug.cgi?id=209983

Assignee: wptsync → dholbert
Priority: -- → P3

[setting ni=biesi to be sure he saw the review request]

Flags: needinfo?(cbiesinger)

Sorry for the delay!

Flags: needinfo?(cbiesinger)
Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2613928f24cd Adjust expected height in WPT test flexitem-stretch-image.html to account for image hypothetical height being influenced by its used main size. r=cbiesinger
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/22867 for changes under testing/web-platform/tests
Whiteboard: [wpt] → [wpt], [wptsync upstream]
Upstream PR was closed without merging
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
Upstream PR was closed without merging
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
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: