Bug 1973726 - Set DOM file path for webkitRelativePath. r=sefeng,geckoview-reviewers,webidl,smaug,ohall
Actually, there is no way to set webkitRelativePath from JavaScript.
Since GeckoView's folder picker handles virtual file data, we need to
set relative path from JavaScript directly.
A content URI of System storage document provider only allow file data
access from file/folder picker, so there is no way to test it on
geckoivew-junit.
Also, after landing bug 1591640, GVE always crash when using folder
picker. So this includes a fix for it.
Differential Revision: https://phabricator.services.mozilla.com/D255615
<!DOCTYPE HTML><html><!-- https://bugzilla.mozilla.org/show_bug.cgi?id=1499139 --><head><metacharset="utf-8"><title>Test for Bug 1499169</title><scriptsrc="/tests/SimpleTest/SimpleTest.js"></script><scriptsrc="/tests/SimpleTest/SpecialPowers.js"></script><linkrel="stylesheet"type="text/css"href="/tests/SimpleTest/test.css"/><scripttype="application/javascript">SimpleTest.waitForExplicitFinish();functiontest(){constOBJLC=SpecialPowers.Ci.nsIObjectLoadingContent;letobj=document.getElementById("pdftest");objinstanceofOBJLC;obj=SpecialPowers.wrap(obj);// Make sure we've set our type correctly even though the mime type isn't quite as expected.ok(obj.displayedType==OBJLC.TYPE_DOCUMENT,"expected document type");SimpleTest.finish();}</script></head><body><atarget="_blank"href="https://bugzilla.mozilla.org/show_bug.cgi?id=1499169">Mozilla Bug 1499169</a><objectid="pdftest"onload="test()"data="file_pdfjs_test.pdf"type="application/pdf;charset=UTF-8"width="90%"height="600"></object></body></html>