<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:mrobinson@webkit.org" title="Martin Robinson <mrobinson@webkit.org>"> <span class="fn">Martin Robinson</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - [Cairo] SVG path not rendered with all-zero dasharray"
href="https://bugs.webkit.org/show_bug.cgi?id=146997">bug 146997</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #256903 Flags</td>
<td>review?
</td>
<td>review-
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [Cairo] SVG path not rendered with all-zero dasharray"
href="https://bugs.webkit.org/show_bug.cgi?id=146997#c5">Comment # 5</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [Cairo] SVG path not rendered with all-zero dasharray"
href="https://bugs.webkit.org/show_bug.cgi?id=146997">bug 146997</a>
from <span class="vcard"><a class="email" href="mailto:mrobinson@webkit.org" title="Martin Robinson <mrobinson@webkit.org>"> <span class="fn">Martin Robinson</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=256903&action=diff" name="attach_256903" title="Patch">attachment 256903</a> <a href="attachment.cgi?id=256903&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=256903&action=review">https://bugs.webkit.org/attachment.cgi?id=256903&action=review</a>
Nice. Fix. I have a few small nits.
<span class="quote">> Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp:907
> + // Avoid all-zero patterns that would trigger the CAIRO_STATUS_INVALID_DASH context error state.
> + bool allZero = true;
> + for (auto& dash : dashes) {
> + if (dash) {
> + allZero = false;
> + break;
> + }</span >
I think you could pull this bit out into a helper function that returns a boolean. Something like isDashArrayAllZero.
<span class="quote">> Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp:911
> + if (allZero)
> + return;
> +</span >
What should the behavior of an all-zero dash array be? Should it disable dashes? If so, perhaps in that case you should call cairo_set_dash with num_dashes=0. Either way, I think you need to adjust the state appropriately.
<span class="quote">> LayoutTests/fast/canvas/script-tests/canvas-lineDash.js:107
> +// Verify all-zero dash rendering</span >
Nit: missing period.
<span class="quote">> LayoutTests/fast/canvas/script-tests/canvas-lineDash.js:110
> +ctx.lineWidth = 4; // To make the test immune to plaform anti-aliasing discrepancies</span >
Ditto.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>