Changeset 278271 in webkit
- Timestamp:
- May 30, 2021, 11:39:50 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/svg/bounding-rect-for-path-with-only-move-command-expected.txt (added)
-
LayoutTests/fast/svg/bounding-rect-for-path-with-only-move-command.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/Path.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r278268 r278271 1 2021-05-30 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 REGRESSION (r258118): SVG paths that contain a single move command incorrect client bounding rects 4 https://bugs.webkit.org/show_bug.cgi?id=226447 5 rdar://72112744 6 7 Reviewed by Alan Bujtas. 8 9 Add a layout test to exercise the bug. 10 11 * fast/svg/bounding-rect-for-path-with-only-move-command-expected.txt: Added. 12 * fast/svg/bounding-rect-for-path-with-only-move-command.html: Added. 13 1 14 2021-05-30 Sam Weinig <weinig@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r278270 r278271 1 2021-05-30 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 REGRESSION (r258118): SVG paths that contain a single move command incorrect client bounding rects 4 https://bugs.webkit.org/show_bug.cgi?id=226447 5 rdar://72112744 6 7 Reviewed by Alan Bujtas. 8 9 r258118 introduced a fast path for computing the bounding rect of a `WebCore::Path` without having to 10 materialize a platform path object (e.g. `CGPathRef` on platforms that use CoreGraphics). To do this, we 11 introduce `InlinePathData` -- a variant capable of representing several types of simple `Path` objects without 12 allocating a platform path. 13 14 However, in the case where a `Path` only consists of a single `moveTo` command, this fast path for computing the 15 bounding rect currently returns the zero rect (an empty rect at the origin), rather than an empty rect at the 16 location we've moved to. This causes the offset of the bounding rect of an SVG path element that contains only a 17 single `M` drawing command to be incorrect. 18 19 Simply fix this by returning an empty rect that is offset by the `moveTo` location, rather than the origin. 20 21 Test: fast/svg/bounding-rect-for-path-with-only-move-command.html 22 23 * platform/graphics/Path.cpp: 24 (WebCore::Path::boundingRectFromInlineData const): 25 1 26 2021-05-30 Youenn Fablet <youenn@apple.com> 2 27 -
trunk/Source/WebCore/platform/graphics/Path.cpp
r278253 r278271 491 491 492 492 if (hasInlineData<MoveData>()) 493 return FloatRect {};493 return {{ inlineData<MoveData>().location, FloatSize { } }}; 494 494 495 495 if (hasInlineData<LineData>()) {
Note:
See TracChangeset
for help on using the changeset viewer.