Bug 138555 - <Error>: CGContextSetLineDash: invalid dash array: at least one element must be non-zero
Summary: <Error>: CGContextSetLineDash: invalid dash array: at least one element must ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL: http://linkedin.com
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-11-09 20:58 PST by Simon Fraser (smfr)
Modified: 2016-10-10 16:04 PDT (History)
7 users (show)

See Also:


Attachments
FusionCharts generated bar chart (14.32 KB, image/svg+xml)
2016-08-17 09:52 PDT, Joey Korkames
no flags Details
Simpler test case (171 bytes, image/svg+xml)
2016-10-10 14:23 PDT, Said Abou-Hallawa
no flags Details
Patch (1.92 KB, patch)
2016-10-10 14:43 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.