Skip to content

Layout: flex children with container-type: inline-size get ~142,000px width on vg.no #1288

Open

Description

@max-freddyfire

Environment: moli 1.1.15, moli fetch --layout. The result is the same with --image and --resource.

Repro

moli fetch --timeout 25000 --layout --eval 'JSON.stringify({
  feed: Math.round(document.querySelector("#feed").getBoundingClientRect().width),
  img: [...document.querySelectorAll("#feed img")].slice(0,4).map(i => Math.round(i.getBoundingClientRect().width))
})' https://www.vg.no

Actual: {"feed":734,"img":[142113,142988,170589,128450]}. The #feed section is 734px wide, but the article teasers inside it, their figures and their images are 128k to 170k px wide and about 95k px tall. The feed ends up 463k to 468k px tall, so scrolling shows mostly empty space and lazy content never loads.

Ancestor chain (computed):

IMG._image_…        142113px  display:block
DIV._figure_…       142113px  display:flex  container-type:inline-size
A                   142113px  display:flex
ARTICLE._teaser_…   142113px  display:flex  container-type:inline-size
TRACK-ELEMENT       display:contents
SECTION.feed        734px     display:flex  container-type:inline-size

The site also defines :root { --fluid-unit: 100cqw } inside @supports (container-type:inline-size).

Expected: the teasers should be no wider than the 734px feed, as in Chrome.

A minimal repro with nested flex and container-type: inline-size gives the correct 734px, so another factor is needed to trigger it. display: contents combined with cqw-based font sizes is my guess, but I have not verified it.

Possibly related: #282 (container queries never match).

Activity

  1. BibekPathak commented on Oct 13, 2026

    @BibekPathak
    Contributor

    Hi @ldm0 i wanna pick this up, please assign it to me!!

  2. ldm0 commented on Oct 13, 2026

    @ldm0
    Member

    @BibekPathak Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions