DescriptionUse viewBox for SVG as intrinsic size when all else fails
In http://crrev.com/308643002 the use of viewBox for intrinsicSize was
removed (which means this is a partial revert of that change). The
reason for the removal was that there wasn't a known cases where it
would be useful.
But then crbug.com/441862 surfaced and showed that using the viewBox
for intrinsic size can indeed be useful and necessary for SVG inside
an image through a relatively complex chain. What in the end happens
is that the intrinsic size is used not as a size but as a ratio when
doing scaling to accommodate for object-fit:cover (see
LayoutReplaced::replacedContentRect).
Ideally, we should only allow use of the ratio from the viewBox, but
we currently have no way of expressing just the ratio for an Image. So
there is potential for the viewBox being misused as size. Putting the
code back should be relatively safe though, since we've had it before.
BUG=441862
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=193030
Patch Set 1 #Patch Set 2 : Rebase #Patch Set 3 : Updated test expectations and added TODOs #
Messages
Total messages: 13 (4 generated)
|