An SVG element without intrinsic size inherits the container size as its viewport instead of inheriting the container viewport.
https://bugs.webkit.org/show_bug.cgi?id=141725.
Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-03-06
Reviewed by Darin Adler.
Source/WebCore:
The current viewport of the <svg> element should be retrieved from its
renderer if the renderer is available. If the renderer is not created yet,
this means the viewport is needed to calculate the size of the renderer.
In this case, we should return the element size if it is intrinsic size.
Test: svg/css/svg-css-different-intrinsic-sizes.html
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::currentViewportSize): Change the order for
returning the viewport of the <svg> element. We should consider the case
of a valid renderer before considering the case of an intrinsic size.
LayoutTests:
* svg/css/svg-css-different-intrinsic-sizes-expected.html: Added.
* svg/css/svg-css-different-intrinsic-sizes.html: Added.
The intrinsic size of the <svg> element is overridden by CSS. The elements
inside the <svg> should consider the css size (which is equal to the <svg>
element viewport) instead of the <svg> element intrinsic size.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181165
268f45cc-cd09-0410-ab3c-
d52691b4dbfc