当使用 gem 的页面上有 svg 时,我的 Rails 应用程序中的某些页面似乎使 Safari 完全崩溃inline_svg
。
导航到该页面会导致错误消息“Safari Web 内容意外退出”。
这是堆栈跟踪的一部分,它使我相信这是 SVG 渲染的问题:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff8e2c1286 __pthread_kill + 10
1 libsystem_c.dylib 0x00007fff9a58db53 abort + 129
2 libsystem_c.dylib 0x00007fff9a555c39 __assert_rtn + 321
3 com.apple.CoreGraphics 0x00007fff90ff9d0e CGPathCreateMutableCopyByTransformingPath + 242
4 com.apple.CoreGraphics 0x00007fff9101de10 CGContextAddPath + 93
5 com.apple.WebCore 0x00007fff920d70c0 WebCore::GraphicsContext::strokePath(WebCore::Path const&) + 80
6 com.apple.WebCore 0x00007fff929c4140 WebCore::RenderSVGShape::strokeShape(WebCore::GraphicsContext*) const + 160
7 com.apple.WebCore 0x00007fff929c8673 WebCore::RenderSVGPath::strokeShape(WebCore::GraphicsContext*) const + 99
8 com.apple.WebCore 0x00007fff929d0fce WebCore::RenderSVGShape::strokeShape(WebCore::RenderStyle const&, WebCore::GraphicsContext*) + 126
9 com.apple.WebCore 0x00007fff929d116f WebCore::RenderSVGShape::strokeShape(WebCore::GraphicsContext*) + 191
10 com.apple.WebCore 0x00007fff929d11ce WebCore::RenderSVGShape::fillStrokeMarkers(WebCore::PaintInfo&) + 78
11 com.apple.WebCore 0x00007fff91ff927b WebCore::RenderSVGShape::paint(WebCore::PaintInfo&, WebCore::LayoutPoint const&) + 379
12 com.apple.WebCore 0x00007fff92052b03 WebCore::RenderSVGContainer::paint(WebCore::PaintInfo&, WebCore::LayoutPoint const&) + 531
13 com.apple.WebCore 0x00007fff92052b03 WebCore::RenderSVGContainer::paint(WebCore::PaintInfo&, WebCore::LayoutPoint const&) + 531
14 com.apple.WebCore 0x00007fff92052b03 WebCore::RenderSVGContainer::paint(WebCore::PaintInfo&, WebCore::LayoutPoint const&) + 531
15 com.apple.WebCore 0x00007fff91ff8f12 WebCore::RenderSVGRoot::paintReplaced(WebCore::PaintInfo&, WebCore::LayoutPoint const&) + 1330
16 com.apple.WebCore 0x00007fff91f70d32 WebCore::RenderReplaced::paint(WebCore::PaintInfo&, WebCore::LayoutPoint const&) + 722
这是 svg 本身的样子:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" width="91px" height="25px" viewBox="0 0 91 25" version="1.1" class="priority-urgent">
<title>Urgent</title>
<desc>Created with sketchtool.</desc>
<defs></defs>
<g id="1/18" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
<g id="Detail" sketch:type="MSArtboardGroup" transform="translate(-459.000000, -264.000000)">
<g id="Group" sketch:type="MSLayerGroup" transform="translate(429.000000, 103.000000)">
<g id="Urgent_flag" transform="translate(30.000000, 161.000000)">
<rect id="Rectangle-28" fill="#E74C3C" sketch:type="MSShapeGroup" x="0" y="0" width="91" height="25" rx="2"> </rect>
<text id="URGENT" sketch:type="MSTextLayer" font-family="Gotham Book" font-size="16" font-weight="313" sketch:alignment="middle" line-spacing="19" fill="#FFFFFF">
<tspan x="10.508" y="18">URGENT</tspan>
</text>
</g>
</g>
</g>
</g>
</svg>