DescriptionAdd Image::updateConcreteSize()
For SVG and generated images using the default sizing algorithm to
determine size, a "default object size" is needed to resolve the final
size, also called the concrete object size.
https://drafts.csswg.org/css-images/#default-sizing
This is done in a somewhat adhoc way in Blink, mainly by letting
Image::imageSize() return a bogus* size for these kind of images and
in selected places using
LayoutBoxModelObject::calculateImageIntrinsicDimensions to compute the
real size. But when using canvas.drawImage with an <img> pointing to
an SVG, the bogus size was used when determining the default size
leading to the wrong size being used.
This patch adds an updateConcreteObjectSize method to Image so that
the image can properly size in the context it's in, according to the
specification and use that to size images drawn with
canvas.drawImage().
BUG=581357, 475009
Patch Set 1 #Patch Set 2 : Rebase #Patch Set 3 : Add test #Patch Set 4 : Add some documentation and polish title of test. #
Total comments: 7
Patch Set 5 : Pull test for now, needs changes in upcoming CL to pass. Address nits. #
Total comments: 6
Dependent Patchsets: Messages
Total messages: 19 (5 generated)
|