Commit 83bf26f
committed
Fix SVG clipPath bounding box transform order with objectBoundingBox units
https://bugs.webkit.org/show_bug.cgi?id=304836
rdar://167417135
Reviewed by Simon Fraser.
When a clipPath has both clipPathUnits="objectBoundingBox" and a local transform,
the bounding box calculation applied transforms in the wrong order. The local transform
was applied before the objectBoundingBox transform, causing it to be scaled incorrectly.
The correct order is: OBB transform first (to realize 0-1 coordinates to pixels),
then local transform (in pixel space).
Tests: svg/clip-path/hittest-transformed-clip-objectboundingbox.html
svg/clip-path/transformed-clip-expected.svg
svg/clip-path/transformed-clip.svg
* LayoutTests/svg/clip-path/hittest-transformed-clip-objectboundingbox-expected.txt: Added.
* LayoutTests/svg/clip-path/hittest-transformed-clip-objectboundingbox.html: Added.
* LayoutTests/svg/clip-path/transformed-clip-expected.svg: Added.
* LayoutTests/svg/clip-path/transformed-clip.svg: Added.
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResourceClipper.cpp:
(WebCore::LegacyRenderSVGResourceClipper::calculateClipContentRepaintRect):
(WebCore::LegacyRenderSVGResourceClipper::hitTestClipContent):
(WebCore::LegacyRenderSVGResourceClipper::resourceBoundingBox):
Canonical link: https://commits.webkit.org/305078@main1 parent adac9d9 commit 83bf26f
File tree
5 files changed
+87
-6
lines changed- LayoutTests/svg/clip-path
- Source/WebCore/rendering/svg/legacy
5 files changed
+87
-6
lines changedLines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
Loading
Loading
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
312 | 311 | | |
313 | 312 | | |
314 | 313 | | |
| |||
325 | 324 | | |
326 | 325 | | |
327 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
328 | 331 | | |
329 | 332 | | |
330 | 333 | | |
331 | 334 | | |
332 | 335 | | |
333 | 336 | | |
334 | 337 | | |
335 | | - | |
336 | | - | |
337 | 338 | | |
338 | 339 | | |
339 | 340 | | |
| |||
360 | 361 | | |
361 | 362 | | |
362 | 363 | | |
363 | | - | |
| 364 | + | |
364 | 365 | | |
365 | 366 | | |
366 | 367 | | |
| 368 | + | |
| 369 | + | |
367 | 370 | | |
368 | 371 | | |
369 | 372 | | |
370 | 373 | | |
371 | 374 | | |
372 | | - | |
| 375 | + | |
373 | 376 | | |
374 | 377 | | |
375 | | - | |
| 378 | + | |
376 | 379 | | |
377 | 380 | | |
378 | 381 | | |
0 commit comments