Bug 138555

Summary: <Error>: CGContextSetLineDash: invalid dash array: at least one element must be non-zero
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: SVGAssignee: Said Abou-Hallawa <sabouhallawa>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, sabouhallawa, simon.fraser, thorton, webkit-bug-importer, zalan, zimmermann
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://linkedin.com
Attachments:
Description Flags
FusionCharts generated bar chart
none
Simpler test case
none
Patch none

Description Simon Fraser (smfr) 2014-11-09 20:58:03 PST
When loading linkedin.com (signed in) in MiniBrowser, I get lots of:

<Error>: CGContextSetLineDash: invalid dash array: at least one element must be non-zero.

(lldb) p dashes
(DashArray) $0 = { size = 1, capacity = 0 } {
  [0] = 0
  m_size = 1
  m_capacity = 2
  m_buffer = 0x000060800001c3b0
}

so we're giving CG a dash array with a single zero item.

This is from an SVG image; not sure which one.
Comment 1 Joey Korkames 2016-08-17 09:52:29 PDT
Created attachment 286303 [details]
FusionCharts generated bar chart
Comment 2 Simon Fraser (smfr) 2016-08-17 09:58:17 PDT
Thanks for the test case!
Comment 3 Radar WebKit Bug Importer 2016-08-17 09:58:37 PDT
<rdar://problem/27887975>
Comment 4 Joey Korkames 2016-08-17 10:00:56 PDT
I get the same errors on an intranet portal that uses FusionCharts XT.
They seem to repeat for each frame of animation that the FusionChart js does to "grow" each column.

When I load the attached SVG separately into my WKWebKit browser (http://github.com/kfix/MacPin), I see the same CGContextSetLineDash errors on stdout:

$ ~/Applications/MacPin.localized/MacPin.app/Contents/MacOS/MacPin ~/fusionchart_webkit_bug_138555.svg
...
[2016-08-17 16:54:42 +0000] <modules/MacPin/WebViewController.swift:71:102> [_webView(_:logDiagnosticMessage:description:)] navigation || standard
[2016-08-17 16:54:42 +0000] <modules/MacPin/WebViewDelegates.swift:70:9> [webView(_:didStartProvisionalNavigation:)] 'file:///Users/jkorkames/fusionchart_webkit_bug_138555.svg'
Aug 17 09:54:42  com.apple.WebKit.WebContent[5885] <Error>: CGContextSetLineDash: invalid dash array: at least one element must be non-zero.
Aug 17 09:54:42  com.apple.WebKit.WebContent[5885] <Error>: CGContextSetLineDash: invalid dash array: at least one element must be non-zero.
Aug 17 09:54:42  com.apple.WebKit.WebContent[5885] <Error>: CGContextSetLineDash: invalid dash array: at least one element must be non-zero.
Aug 17 09:54:42  com.apple.WebKit.WebContent[5885] <Error>: CGContextSetLineDash: invalid dash array: at least one element must be non-zero.
[2016-08-17 16:54:42 +0000] <modules/MacPin/WebViewDelegates.swift:247:16> [webView(_:didFinishNavigation:)] <MPWebView> `` [file:///Users/jkorkames/fusionchart_webkit_bug_138555.svg]
Comment 5 Said Abou-Hallawa 2016-10-10 14:23:45 PDT
Created attachment 291165 [details]
Simpler test case
Comment 6 Said Abou-Hallawa 2016-10-10 14:28:22 PDT
The error message can be output for a case like this:

<svg xmlns="http://www.w3.org/2000/svg">
    <rect width="100" height="100" fill="yellow" stroke="green" stroke-width="1" stroke-dasharray="0"/>
</svg>

The reason of the error message is adding the attribute: stroke-dasharray="0" or stroke-dasharray="0, 0". At least none-zero element should be in the dash-array.
Comment 7 Said Abou-Hallawa 2016-10-10 14:43:53 PDT
Created attachment 291169 [details]
Patch
Comment 8 WebKit Commit Bot 2016-10-10 16:04:38 PDT
Comment on attachment 291169 [details]
Patch

Clearing flags on attachment: 291169

Committed r207030: <http://trac.webkit.org/changeset/207030>
Comment 9 WebKit Commit Bot 2016-10-10 16:04:43 PDT
All reviewed patches have been landed.  Closing bug.