haikuwebkit/LayoutTests/fast/svg/bounding-rect-for-path-with...

9 lines
134 B
Plaintext
Raw Permalink Normal View History

REGRESSION (r258118): SVG paths that contain a single move command incorrect client bounding rects https://bugs.webkit.org/show_bug.cgi?id=226447 rdar://72112744 Reviewed by Alan Bujtas. Source/WebCore: r258118 introduced a fast path for computing the bounding rect of a `WebCore::Path` without having to materialize a platform path object (e.g. `CGPathRef` on platforms that use CoreGraphics). To do this, we introduce `InlinePathData` -- a variant capable of representing several types of simple `Path` objects without allocating a platform path. However, in the case where a `Path` only consists of a single `moveTo` command, this fast path for computing the bounding rect currently returns the zero rect (an empty rect at the origin), rather than an empty rect at the location we've moved to. This causes the offset of the bounding rect of an SVG path element that contains only a single `M` drawing command to be incorrect. Simply fix this by returning an empty rect that is offset by the `moveTo` location, rather than the origin. Test: fast/svg/bounding-rect-for-path-with-only-move-command.html * platform/graphics/Path.cpp: (WebCore::Path::boundingRectFromInlineData const): LayoutTests: Add a layout test to exercise the bug. * fast/svg/bounding-rect-for-path-with-only-move-command-expected.txt: Added. * fast/svg/bounding-rect-for-path-with-only-move-command.html: Added. Canonical link: https://commits.webkit.org/238308@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278271 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-31 06:39:50 +00:00
PASS rect.top is 108
PASS rect.left is 108
PASS rect.width is 0
PASS rect.height is 0
PASS successfullyParsed is true
TEST COMPLETE