Cannot reference svg icons with xlink:href on file URLs

Originator:darryl
Number:rdar://41299192 Date Originated:20-Jun-2018 12:17
Status:Open Resolved:
Product:iOS + SDK Product Version:11.4
Classification:Other Bug Reproducible:Always
 
Summary:
A common practice with SVG icons is to bundle several icons into a single svgs file as symbols, and then reference them from the HTML using a <use xlink:href=“icons.svg#symbol-name”> tag. This fails in WKWebView on pages loaded from file URLs.

It is possible to load images, audio, and other resources (but not XHRs) from file URLs, so it’s not clear why SVG symbols would be treated differently.

Steps to Reproduce:
See sample project at https://github.com/dpogue/WKFileTest/tree/svg-test (zip file of project attached).

There is a variable in the ViewController.swift file to switch between UIWebView and WKWebView.

Expected Results:
The webkit logo should render in the blue div.

Actual Results:
On UIWebView, the svg file shows.
On WKWebView, the div appears empty.

Version:
11.4

Notes:
This is an issue that is blocking us from moving from UIWebView to WKWebView.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!