Changeset 181165 in webkit
- Timestamp:
- Mar 6, 2015 10:15:48 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r181164 r181165 1 2015-03-06 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 An SVG element without intrinsic size inherits the container size as its viewport instead of inheriting the container viewport. 4 https://bugs.webkit.org/show_bug.cgi?id=141725. 5 6 Reviewed by Darin Adler. 7 8 * svg/css/svg-css-different-intrinsic-sizes-expected.html: Added. 9 * svg/css/svg-css-different-intrinsic-sizes.html: Added. 10 The intrinsic size of the <svg> element is overridden by CSS. The elements 11 inside the <svg> should consider the css size (which is equal to the <svg> 12 element viewport) instead of the <svg> element intrinsic size. 13 1 14 2015-03-06 Simon Fraser <simon.fraser@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r181164 r181165 1 2015-03-06 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 An SVG element without intrinsic size inherits the container size as its viewport instead of inheriting the container viewport. 4 https://bugs.webkit.org/show_bug.cgi?id=141725. 5 6 Reviewed by Darin Adler. 7 8 The current viewport of the <svg> element should be retrieved from its 9 renderer if the renderer is available. If the renderer is not created yet, 10 this means the viewport is needed to calculate the size of the renderer. 11 In this case, we should return the element size if it is intrinsic size. 12 13 Test: svg/css/svg-css-different-intrinsic-sizes.html 14 15 * svg/SVGSVGElement.cpp: 16 (WebCore::SVGSVGElement::currentViewportSize): Change the order for 17 returning the viewport of the <svg> element. We should consider the case 18 of a valid renderer before considering the case of an intrinsic size. 19 1 20 2015-03-06 Simon Fraser <simon.fraser@apple.com> 2 21 -
trunk/Source/WebCore/svg/SVGSVGElement.cpp
r179991 r181165 527 527 FloatSize SVGSVGElement::currentViewportSize() const 528 528 { 529 if (hasIntrinsicWidth() && hasIntrinsicHeight()) 530 return FloatSize(floatValueForLength(intrinsicWidth(), 0), floatValueForLength(intrinsicHeight(), 0)); 531 532 if (!renderer()) 529 FloatSize viewportSize; 530 531 if (renderer()) { 532 if (is<RenderSVGRoot>(*renderer())) { 533 auto& root = downcast<RenderSVGRoot>(*renderer()); 534 viewportSize = root.contentBoxRect().size() / root.style().effectiveZoom(); 535 } else 536 viewportSize = downcast<RenderSVGViewportContainer>(*renderer()).viewport().size(); 537 } 538 539 if (!viewportSize.isEmpty()) 540 return viewportSize; 541 542 if (!(hasIntrinsicWidth() && hasIntrinsicHeight())) 533 543 return { }; 534 544 535 if (is<RenderSVGRoot>(*renderer())) { 536 auto& root = downcast<RenderSVGRoot>(*renderer()); 537 return root.contentBoxRect().size() / root.style().effectiveZoom(); 538 } 539 540 return downcast<RenderSVGViewportContainer>(*renderer()).viewport().size(); 545 return FloatSize(floatValueForLength(intrinsicWidth(), 0), floatValueForLength(intrinsicHeight(), 0)); 541 546 } 542 547
Note: See TracChangeset
for help on using the changeset viewer.