Fix numerical inaccuracy in background-size auto

We were using intrinsic_width * tile_size / intrinsic_height to
compute the auto size when only one dimension is given. The values
are in LayoutUnits and the expression overflows when the tile is
large and the image is large, resulting in significant distortion
of the background. The effect is most prominant on high-dpi devices
but also manifests at high zoom.

Bug: 921269
Change-Id: I78c2d0adf3c23b1b9d4158d2ffe8d775b3f5b9f4
Reviewed-by: Fredrik Söderquist <>
Reviewed-by: Florin Malita <>
Commit-Queue: Stephen Chenney <>
Cr-Commit-Position: refs/heads/master@{#623564}
5 files changed