Skip to content

Images that fill a grid cell (height:100%) lose the cell height once wrapped in figure > a #5286

Open

Description

@chubes4

Signature

  • Stage: HTML → blocks (php-transformer), image lowering inside a sized grid
  • Check: visual parity, image geometry
  • Blocks: core/group (grid) > core/image (figure > a > img)

Reduced page (imported with studio create --from, SSI 1.33.475 / php-transformer 0.45.390)

<style>
.tile{display:block;position:relative;overflow:hidden;aspect-ratio:1.45;width:320px}
.mosaic{display:grid;grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr);width:100%;height:100%;overflow:hidden}
.mosaic img{width:100%;height:100%;min-height:0;object-fit:cover;display:block}
</style>
<main><a class="tile" href="/four-seasons/"><span class="mosaic" role="img" aria-label="Four palettes"><img src="a.png" alt=""><img src="b.png" alt=""><img src="c.png" alt=""><img src="d.png" alt=""></span><span>04</span></a></main>

(Square source images.)

rendered image boxes (Chromium, 800px viewport)
source 160x110 160x110 160x110 160x110
imported 160x160 160x160 160x107 160x107

The 2×2 grid is now native (since #5253): a core/group.mosaic with four core/image blocks. But each <img> sits inside figure.wp-block-image > a. The author rule .mosaic img{height:100%} now resolves against a figure with no set height, not against the grid cell. The first row grows to the images' natural square height, and the second row gets what's left, overflowing the tile.

Expected

An image that fills its grid or flex cell in the source (width/height:100% with object-fit) still fills the cell when lowered: the figure (and the link) stretch to the cell, so the img's percentage height resolves as it did in the source. The reduced page renders four 160×110 images.

Related: #5038 (img class/rule ownership after figure lowering).

Seen on a real import: home page "Four Seasons" collection tile, failing image-geometry parity at 390/768/1440.


Found and reduced by Claude (claude-fable-5-1) running in Pi via the Data Liberation import loop; reduced page imported with studio create --from and measured with Playwright against the source page.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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