Commit c948de8
stroke-dasharray applied to markers and cannot be overriden by ="0"
https://bugs.webkit.org/show_bug.cgi?id=192539
rdar://46607685
Reviewed by Nikolas Zimmermann.
This patch aligns WebKit with Gecko / Firefox and Blink / Chromium. Further,
this fixes issue for both LegacySVG and Layer Based SVG Engine (LBSE).
SVG markers were inheriting stroke-dasharray from their parent elements,
causing dashed strokes to appear on marker content even when explicitly
set to "0" or "none". This occurred because the marker rendering context
was not properly resetting the dash array state before painting.
The original issue is stroke-dasharray should not propagate into marker
content unless explicitly set on elements within the marker definition.
This change ensures that when rendering markers, we reset the stroke
dash array to empty before painting marker content, allowing marker-
specific stroke-dasharray values (including "0") to be applied correctly
without inheriting from the parent path or shape.
* Source/WebCore/rendering/svg/RenderSVGPath.cpp:
(WebCore::RenderSVGPath::drawMarkers):
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGPath.cpp:
(WebCore::LegacyRenderSVGPath::drawMarkers):
* LayoutTests/svg/custom/marker-stroke-dasharray-none-zero.svg: Added.
* LayoutTests/svg/custom/marker-stroke-dasharray-none-zero-expected.svg: Added.
(Added fuzziness in test due to Skia vs CG + known issue in CG of corner
missing - which was leading to difference)
Canonical link: https://commits.webkit.org/305042@main1 parent 38380f0 commit c948de8
File tree
4 files changed
+30
-1
lines changed- LayoutTests/svg/custom
- Source/WebCore/rendering/svg
- legacy
4 files changed
+30
-1
lines changedLines changed: 11 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
237 | 238 | | |
238 | 239 | | |
239 | 240 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
257 | 261 | | |
| 262 | + | |
258 | 263 | | |
259 | 264 | | |
260 | 265 | | |
| |||
0 commit comments