Closed Bug 1546739 Opened 5 years ago Closed 5 years ago

{inc} Race condition with `min-width:min-content` on `<img>` elements

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox-esr60 --- unaffected
firefox66 --- unaffected
firefox67 --- unaffected
firefox68 + fixed

People

(Reporter: dholbert, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(5 files)

I was just investigating some testcases for Bug 1544719 and I discovered that we don't seem to honor width:min-content reliably -- sometimes it takes a forced incremental layout for it to take effect.

Testcase coming up.

STR:

  1. Load testcase.

EXPECTED RESULTS:
Image should be 800px wide (plus 2px border)

ACTUAL RESULTS:
Image is 50px wide.

If I take additional action to trigger an incremental reflow (e.g. resizing browser horizontally, or opening devtools with F12), then the rendering switches to EXPECTED RESULTS.

Interestingly, Chrome seems to have this bug as well. I can force them to switch from "actual" to "expected" results by toggling one of the img's sizing properties off and then on again, in devtools.

Attached file testcase 1
Attached video screencast of bug
Summary: {inc} Race condition with `width:min-content` on `<img>` elements → {inc} Race condition with `min-width:min-content` on `<img>` elements

Regression range:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=94682e23ba118dcfab3843a3280618b2e1686ecb&tochange=fdc7b66d76a4ded62d0292bef4de0ffb090d9587

fdc7b66d76a4 Emilio Cobos Álvarez — Bug 1395964 - Don't clear the previously painted image on intrinsic size changes. r=tnikkel
3f1e9dae2467 Emilio Cobos Álvarez — Bug 1395964 - Make image loading changes not reframe. r=tnikkel

--> regression from bug 1395964

Note: sometimes I don't see the broken behavior on first load, but if I do a "light" reload (with a simple Ctrl+R) a few times, then I inevitably see the bug at least once, within the first ~5 pageloads. (And at least 3-4 times within the first ~10 reloads)

Has Regression Range: --- → yes
Flags: needinfo?(emilio)
Keywords: regression
Regressed by: 1395964

Was working just by chance, but sure, can fix.

Assignee: nobody → emilio
Flags: needinfo?(emilio)

Thanks!

Fixed width and height is not a strong enough condition.

min/max-width with intrinsic size keywords makes the final size of the image
also depend on the intrinsic size. Don't optimize away reflows when the
intrinsic size changes if they're used.

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d128c93735ff
Fix detection of intrinsic size dependence of images. r=dholbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/16530 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: