An SVG element without intrinsic size inherits the container size as its viewport...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Mar 2015 18:15:48 +0000 (18:15 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Mar 2015 18:15:48 +0000 (18:15 +0000)
commit3857472966cd391173611c0ceb5d15eb809b23a6
treef3fcb71cf6f35ee10ea008417cffc41722cc4cf7
parent559895073d99fdbc859538d66ce7c0653ce45359
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
LayoutTests/ChangeLog
LayoutTests/svg/css/svg-css-different-intrinsic-sizes-expected.html [new file with mode: 0644]
LayoutTests/svg/css/svg-css-different-intrinsic-sizes.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/svg/SVGSVGElement.cpp