Created attachment 467192 [details] rect-rxry.svg Safari renders SVG <rect> elements with rx set to a value and ry set to a zero value with rounded corners. They should be drawn without rounded corners. The same happens if ry is set to a value and rx is set to a zero value. The attached test case rect-rxry.svg ( fiddle: https://jsfiddle.net/d82x3nvs/ ) should have two rectangles drawn without rounded corners. Safari draws them with rounded corners. Tested on Safari 16.5.2 (18615.2.9.11.10) and Safari Tech Preview Release 174 (Safari 17.0, WebKit 18616.1.22.1). Firefox 115 and Chrome 115 render the test case correctly without rounded corners. Safari 5.1.7 (7534.57.7) used to render the rectangles correctly without rounded corners. Rendering got broken some time after it and at least Safari 10.1.2 (12603.3.8) is drawing them incorrectly.
<rdar://problem/113396109>
One easy fix is to replace the following condition in LegacyRenderSVGRect::updateShapeFromElement() and RenderSVGRect::updateShapeFromElement() if (rectElement().rx().value(lengthContext) > 0 || rectElement().ry().value(lengthContext) > 0 || hasNonScalingStroke()) { // Fall back to LegacyRenderSVGShape LegacyRenderSVGShape::updateShapeFromElement(); return; } by if ((rectElement().rx().value(lengthContext) > 0 && rectElement().ry().value(lengthContext) > 0) || hasNonScalingStroke()) { // Fall back to LegacyRenderSVGShape LegacyRenderSVGShape::updateShapeFromElement(); return; }
Pull request: https://github.com/WebKit/WebKit/pull/16414
Committed 266641@main (3dc74d79ceb7): <https://commits.webkit.org/266641@main> Reviewed commits have been landed. Closing PR #16414 and removing active labels.