haikuwebkit/LayoutTests/svg/as-image/img-relative-height-expecte...

7 lines
152 B
HTML
Raw Permalink Normal View History

<img style='width: 100%' src='foo.svg'> gets pixellated when stretched https://bugs.webkit.org/show_bug.cgi?id=81631 Reviewed by Antti Koivisto. Source/WebCore: Final cleanup of RenderReplaced after the intrinsic size negotiation patch series from some weeks/months ago. Stop tracking whether a RenderReplaced has an intrinsic size or not with an extra-bool, instead assume each RenderReplaced derived class has an intrinsic size. If not, the class should override computeIntrinsicRatioInformation() for any custom logic - currently only done by RenderImage. Remove all logic depending on m_hasIntrinsicSize from computeReplacedLogicalWidth/Height, which was used to support different sizing models depending on if the replaced element is a RenderImage or a RenderPart. Unify all of this in computeIntrinsicRatioInformation right in RenderReplaced. This allows to remove a hack from RenderImage::computeReplacedLogicalWidth(), which forced the synchroniziation of the intrinsicSize() before calling the base classes RenderReplaced::computeReplacedLogicalWidth(). Now RenderImage just overrides the layout() method, calls RenderReplaced::layout() and then sets the container size of the image resources to [contentWidth(), contentHeight()] - reflecting the actual result of the layout. Furthermore this now allows us to unify CachedImage::imageSizeForRenderer() again for both SVG and non-SVG images. Propagating the right container size to the image resource fixes the actual bug, that the SVGImage got pixellated. Adding new tests covering percentage width or height set on an <img> embedding an external SVG, no more pixelation. Tests: svg/as-image/img-relative-height-expected.html svg/as-image/img-relative-height.html svg/as-image/img-relative-width-expected.html svg/as-image/img-relative-width.html * loader/cache/CachedImage.cpp: (WebCore::CachedImage::imageSizeForRenderer): * rendering/RenderEmbeddedObject.cpp: (WebCore::RenderEmbeddedObject::RenderEmbeddedObject): * rendering/RenderImage.cpp: (WebCore::RenderImage::layout): (WebCore::RenderImage::computeIntrinsicRatioInformation): * rendering/RenderImage.h: (RenderImage): * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::RenderReplaced): (WebCore::rendererHasAspectRatio): (WebCore): (WebCore::RenderReplaced::computeIntrinsicRatioInformationForRenderBox): (WebCore::RenderReplaced::computeIntrinsicRatioInformation): (WebCore::RenderReplaced::computeReplacedLogicalWidth): (WebCore::RenderReplaced::computeReplacedLogicalHeight): * rendering/RenderReplaced.h: (WebCore::RenderReplaced::intrinsicSize): (RenderReplaced): (WebCore::RenderReplaced::setIntrinsicSize): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::setContainerSize): * svg/graphics/SVGImage.h: (WebCore::SVGImage::usesContainerSize): LayoutTests: Add new tests covering setting only one of width/height to a percentage when embedding SVGs into <img>s. * platform/chromium/test_expectations.txt: Update expectations. * platform/mac/fast/repaint/block-layout-inline-children-replaced-expected.txt: Update changed result - slight rounding difference. * platform/mac/fast/table/quote-text-around-iframe-expected.png: Update changed result, now the default intrinsic size respects scaling. * platform/mac/fast/table/quote-text-around-iframe-expected.txt: Ditto. * svg/as-image/img-relative-height-expected.html: Added. * svg/as-image/img-relative-height.html: Added. * svg/as-image/img-relative-width-expected.html: Added. * svg/as-image/img-relative-width.html: Added. * svg/as-image/resources/island.svg: Added. * svg/as-image/svg-non-integer-scaled-image-expected.png: * svg/as-image/svg-non-integer-scaled-image-expected.txt: Canonical link: https://commits.webkit.org/99666@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-03-27 09:24:46 +00:00
<!DOCTYPE html>
<html>
<body style="margin: 0; overflow: hidden;">
<img style='width: 800px; height: 600px' src='resources/island.svg'>
</body>
</html>