Skip to content

[css-images-4] object-view-box interaction with contain-intrinsic-size #7187

@vmpstr

Description

@vmpstr

object-view-box property says that

When the element is painted, its contents are scaled and translated such that the element’s contents retain the same position and size, relative to the view box’s final size and position, that they had when the view box was determined (above).

My interpretation of this is that we use the element's natural size in conjunction with the viewbox size to do some math and figure out new positions and sizes. My question is what happens if the element has size containment and a specified contain-intrinsic-size, which says that

These properties allow elements with size containment to specify an explicit intrinsic inner size, causing the box to size as if its in-flow content totals to a width and height matching the specified explicit intrinsic inner size (rather than sizing as if it were empty).

So should the math that we do use the original element content size (say original image's natural dimensions), or should it use the contain-intrinsic-size "overrides". And in general, should size-containment and contain-intrinsic-size apply before the object-view-box property? I think that if there is size containment with no contain-intrinsic-size then we would ignore the object-view-box property because it would have 0 intrinsic dimensions. Should be ignore the viewbox even if there is contain-intrinsic-size or is it a matter of which sizes we use for computing the painted output dimensions/positions

I'm not sure if there is a important distinction between "natural" sizes and "intrinsic" sizes that should be called out.

/cc @khushalsagar @tabatkins

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions