<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[196654] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/196654">196654</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-02-16 13:17:31 -0800 (Tue, 16 Feb 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>JSContext Inspector: Support for inline source maps
https://bugs.webkit.org/show_bug.cgi?id=154303
<rdar://problem/24670392>
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-02-16
Reviewed by Timothy Hatcher.
Source/WebInspectorUI:
* UserInterface/Base/URLUtilities.js:
(parseDataURL):
Break a data URL into components.
* UserInterface/Controllers/SourceMapManager.js:
(WebInspector.SourceMapManager.prototype._loadAndParseSourceMap):
Handle a data URL without using NetworkAgent. Also move references
to a main frame after checking for NetworkAgent.
* UserInterface/Models/SourceMap.js:
(WebInspector.SourceMap.prototype.get sourceMappingBasePathURLComponents):
* UserInterface/Models/SourceMapResource.js:
(WebInspector.SourceMapResource.prototype.get sourceMapDisplaySubpath):
Handle JavaScript debuggable script URLs which may not be complete URLs.
(WebInspector.SourceMapResource.prototype.requestContentFromBackend):
Also handle if NetworkAgent does not exist.
* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel):
When connected to a JavaScript debuggable we were hiding disclosure
triangles as we did not expect resources to have subresources. If
a SourceMap is added, show them again.
LayoutTests:
* inspector/unit-tests/url-utilities-expected.txt: Added.
* inspector/unit-tests/url-utilities.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceBaseURLUtilitiesjs">trunk/Source/WebInspectorUI/UserInterface/Base/URLUtilities.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersSourceMapManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/SourceMapManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsSourceMapjs">trunk/Source/WebInspectorUI/UserInterface/Models/SourceMap.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsSourceMapResourcejs">trunk/Source/WebInspectorUI/UserInterface/Models/SourceMapResource.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsResourceSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectorunittestsurlutilitiesexpectedtxt">trunk/LayoutTests/inspector/unit-tests/url-utilities-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectorunittestsurlutilitieshtml">trunk/LayoutTests/inspector/unit-tests/url-utilities.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (196653 => 196654)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-02-16 21:16:18 UTC (rev 196653)
+++ trunk/LayoutTests/ChangeLog        2016-02-16 21:17:31 UTC (rev 196654)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-02-16 Joseph Pecoraro <pecoraro@apple.com>
+
+ JSContext Inspector: Support for inline source maps
+ https://bugs.webkit.org/show_bug.cgi?id=154303
+ <rdar://problem/24670392>
+
+ Reviewed by Timothy Hatcher.
+
+ * inspector/unit-tests/url-utilities-expected.txt: Added.
+ * inspector/unit-tests/url-utilities.html: Added.
+
</ins><span class="cx"> 2016-02-16 Daniel Bates <dabates@apple.com>
</span><span class="cx">
</span><span class="cx"> CSP: Disallow an empty host in a host-source source expression
</span></span></pre></div>
<a id="trunkLayoutTestsinspectorunittestsurlutilitiesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/unit-tests/url-utilities-expected.txt (0 => 196654)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/unit-tests/url-utilities-expected.txt         (rev 0)
+++ trunk/LayoutTests/inspector/unit-tests/url-utilities-expected.txt        2016-02-16 21:17:31 UTC (rev 196654)
</span><span class="lines">@@ -0,0 +1,74 @@
</span><ins>+
+== Running test suite: URLUtilities
+-- Running test case: parseDataURL
+Test: https://webkit.org
+PASS: Should not be a data URL
+Test: data:
+PASS: Should not be a data URL
+Test: data:text/plain;test
+PASS: Should not be a data URL
+Test: data:text/plain;base64;test
+PASS: Should not be a data URL
+
+Test: data:,
+PASS: mimeType should be: 'text/plain'
+PASS: charset should be: 'US-ASCII'
+PASS: base64 should be: 'false'
+PASS: data should be: ''
+PASS: Resolved content should be: ''
+
+Test: data:,test
+PASS: mimeType should be: 'text/plain'
+PASS: charset should be: 'US-ASCII'
+PASS: base64 should be: 'false'
+PASS: data should be: 'test'
+PASS: Resolved content should be: 'test'
+
+Test: data:text/plain,test
+PASS: mimeType should be: 'text/plain'
+PASS: charset should be: 'US-ASCII'
+PASS: base64 should be: 'false'
+PASS: data should be: 'test'
+PASS: Resolved content should be: 'test'
+
+Test: data:text/plain;charset=TEST,test
+PASS: mimeType should be: 'text/plain'
+PASS: charset should be: 'TEST'
+PASS: base64 should be: 'false'
+PASS: data should be: 'test'
+PASS: Resolved content should be: 'test'
+
+Test: data:application/json,{"name":"test","list":[1,2,3]}
+PASS: mimeType should be: 'application/json'
+PASS: charset should be: 'US-ASCII'
+PASS: base64 should be: 'false'
+PASS: data should be: '{"name":"test","list":[1,2,3]}'
+PASS: Resolved content should be: '{"name":"test","list":[1,2,3]}'
+
+Test: data:application/json,%7B%22name%22%3A%22test%22%2C%22list%22%3A%5B1%2C2%2C3%5D%7D
+PASS: mimeType should be: 'application/json'
+PASS: charset should be: 'US-ASCII'
+PASS: base64 should be: 'false'
+PASS: data should be: '{"name":"test","list":[1,2,3]}'
+PASS: Resolved content should be: '{"name":"test","list":[1,2,3]}'
+
+Test: data:application/json;base64,eyJuYW1lIjoidGVzdCIsImxpc3QiOlsxLDIsM119
+PASS: mimeType should be: 'application/json'
+PASS: charset should be: 'US-ASCII'
+PASS: base64 should be: 'true'
+PASS: data should be: 'eyJuYW1lIjoidGVzdCIsImxpc3QiOlsxLDIsM119'
+PASS: Resolved content should be: '{"name":"test","list":[1,2,3]}'
+
+Test: data:application/json;charset=utf-8;base64,eyJuYW1lIjoidGVzdCIsImxpc3QiOlsxLDIsM119
+PASS: mimeType should be: 'application/json'
+PASS: charset should be: 'utf-8'
+PASS: base64 should be: 'true'
+PASS: data should be: 'eyJuYW1lIjoidGVzdCIsImxpc3QiOlsxLDIsM119'
+PASS: Resolved content should be: '{"name":"test","list":[1,2,3]}'
+
+Test: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==
+PASS: mimeType should be: 'image/png'
+PASS: charset should be: 'US-ASCII'
+PASS: base64 should be: 'true'
+PASS: data should be: 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectorunittestsurlutilitieshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/unit-tests/url-utilities.html (0 => 196654)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/unit-tests/url-utilities.html         (rev 0)
+++ trunk/LayoutTests/inspector/unit-tests/url-utilities.html        2016-02-16 21:17:31 UTC (rev 196654)
</span><span class="lines">@@ -0,0 +1,125 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script>
+function test()
+{
+ let suite = InspectorTest.createSyncSuite("URLUtilities");
+
+ suite.addTestCase({
+ name: "parseDataURL",
+ test: () => {
+ function testInvalid(url) {
+ InspectorTest.log("Test: " + url);
+ InspectorTest.expectThat(parseDataURL(url) === null, "Should not be a data URL");
+ }
+
+ function testValid(url, expected) {
+ InspectorTest.log("");
+ InspectorTest.log("Test: " + url);
+
+ let {mimeType: expectedMimeType, charset: expectedCharset, base64: expectedBase64, data: expectedData, content: expectedContent} = expected;
+ let {mimeType: actualMimeType, charset: actualCharset, base64: actualBase64, data: actualData, scheme: actualScheme} = parseDataURL(url);
+ let actualContent = actualData;
+ if (actualBase64)
+ actualContent = atob(actualContent);
+
+ InspectorTest.assert(actualScheme === "data", "scheme should always be 'data'");
+ InspectorTest.expectThat(actualMimeType === expectedMimeType, `mimeType should be: '${expectedMimeType}'`);
+ InspectorTest.expectThat(actualCharset === expectedCharset, `charset should be: '${expectedCharset}'`);
+ InspectorTest.expectThat(actualBase64 === expectedBase64, `base64 should be: '${expectedBase64}'`);
+ InspectorTest.expectThat(actualData === expectedData, `data should be: '${expectedData}'`);
+ if (expectedContent !== null)
+ InspectorTest.expectThat(actualContent === expectedContent, `Resolved content should be: '${expectedContent}'`);
+ }
+
+ testInvalid("https://webkit.org");
+ testInvalid("data:");
+ testInvalid("data:text/plain;test");
+ testInvalid("data:text/plain;base64;test");
+
+ testValid("data:,", {
+ mimeType: "text/plain",
+ charset: "US-ASCII",
+ base64: false,
+ data: "",
+ content: "",
+ });
+
+ testValid("data:,test", {
+ mimeType: "text/plain",
+ charset: "US-ASCII",
+ base64: false,
+ data: "test",
+ content: "test",
+ });
+
+ testValid("data:text/plain,test", {
+ mimeType: "text/plain",
+ charset: "US-ASCII",
+ base64: false,
+ data: "test",
+ content: "test",
+ });
+
+ testValid("data:text/plain;charset=TEST,test", {
+ mimeType: "text/plain",
+ charset: "TEST",
+ base64: false,
+ data: "test",
+ content: "test",
+ });
+
+ testValid("data:application/json,{\"name\":\"test\",\"list\":[1,2,3]}", {
+ mimeType: "application/json",
+ charset: "US-ASCII",
+ base64: false,
+ data: '{"name":"test","list":[1,2,3]}',
+ content: '{"name":"test","list":[1,2,3]}',
+ });
+
+ InspectorTest.assert(encodeURIComponent('{"name":"test","list":[1,2,3]}') === "%7B%22name%22%3A%22test%22%2C%22list%22%3A%5B1%2C2%2C3%5D%7D");
+ testValid("data:application/json,%7B%22name%22%3A%22test%22%2C%22list%22%3A%5B1%2C2%2C3%5D%7D", {
+ mimeType: "application/json",
+ charset: "US-ASCII",
+ base64: false,
+ data: '{"name":"test","list":[1,2,3]}',
+ content: '{"name":"test","list":[1,2,3]}',
+ });
+
+ testValid("data:application/json;base64,eyJuYW1lIjoidGVzdCIsImxpc3QiOlsxLDIsM119", {
+ mimeType: "application/json",
+ charset: "US-ASCII",
+ base64: true,
+ data: "eyJuYW1lIjoidGVzdCIsImxpc3QiOlsxLDIsM119",
+ content: '{"name":"test","list":[1,2,3]}',
+ });
+
+ testValid("data:application/json;charset=utf-8;base64,eyJuYW1lIjoidGVzdCIsImxpc3QiOlsxLDIsM119", {
+ mimeType: "application/json",
+ charset: "utf-8",
+ base64: true,
+ data: "eyJuYW1lIjoidGVzdCIsImxpc3QiOlsxLDIsM119",
+ content: '{"name":"test","list":[1,2,3]}',
+ });
+
+ testValid("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==", {
+ mimeType: "image/png",
+ charset: "US-ASCII",
+ base64: true,
+ data: "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",
+ content: null, // Skip content check.
+ });
+
+ return true;
+ }
+ });
+
+ suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onLoad="runTest()">
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (196653 => 196654)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2016-02-16 21:16:18 UTC (rev 196653)
+++ trunk/Source/WebInspectorUI/ChangeLog        2016-02-16 21:17:31 UTC (rev 196654)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2016-02-16 Joseph Pecoraro <pecoraro@apple.com>
+
+ JSContext Inspector: Support for inline source maps
+ https://bugs.webkit.org/show_bug.cgi?id=154303
+ <rdar://problem/24670392>
+
+ Reviewed by Timothy Hatcher.
+
+ * UserInterface/Base/URLUtilities.js:
+ (parseDataURL):
+ Break a data URL into components.
+
+ * UserInterface/Controllers/SourceMapManager.js:
+ (WebInspector.SourceMapManager.prototype._loadAndParseSourceMap):
+ Handle a data URL without using NetworkAgent. Also move references
+ to a main frame after checking for NetworkAgent.
+
+ * UserInterface/Models/SourceMap.js:
+ (WebInspector.SourceMap.prototype.get sourceMappingBasePathURLComponents):
+ * UserInterface/Models/SourceMapResource.js:
+ (WebInspector.SourceMapResource.prototype.get sourceMapDisplaySubpath):
+ Handle JavaScript debuggable script URLs which may not be complete URLs.
+
+ (WebInspector.SourceMapResource.prototype.requestContentFromBackend):
+ Also handle if NetworkAgent does not exist.
+
+ * UserInterface/Views/ResourceSidebarPanel.js:
+ (WebInspector.ResourceSidebarPanel):
+ When connected to a JavaScript debuggable we were hiding disclosure
+ triangles as we did not expect resources to have subresources. If
+ a SourceMap is added, show them again.
+
</ins><span class="cx"> 2016-02-16 Nikita Vasilyev <nvasilyev@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: Increase the width of the find banner's search field
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceBaseURLUtilitiesjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Base/URLUtilities.js (196653 => 196654)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Base/URLUtilities.js        2016-02-16 21:16:18 UTC (rev 196653)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/URLUtilities.js        2016-02-16 21:17:31 UTC (rev 196654)
</span><span class="lines">@@ -70,6 +70,25 @@
</span><span class="cx"> return {scheme, host, port};
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+function parseDataURL(url)
+{
+ if (!url.startsWith("data:"))
+ return null;
+
+ // data:[<media type>][;charset=<character set>][;base64],<data>
+ let match = url.match(/^data:([^;,]*)?(?:;charset=([^;,]*?))?(;base64)?,(.*)$/);
+ if (!match)
+ return null;
+
+ let scheme = "data";
+ let mimeType = match[1] || "text/plain";
+ let charset = match[2] || "US-ASCII";
+ let base64 = !!match[3];
+ let data = decodeURIComponent(match[4]);
+
+ return {scheme, mimeType, charset, base64, data};
+}
+
</ins><span class="cx"> function parseURL(url)
</span><span class="cx"> {
</span><span class="cx"> url = url ? url.trim() : "";
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersSourceMapManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/SourceMapManager.js (196653 => 196654)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/SourceMapManager.js        2016-02-16 21:16:18 UTC (rev 196653)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/SourceMapManager.js        2016-02-16 21:17:31 UTC (rev 196654)
</span><span class="lines">@@ -108,6 +108,20 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if (sourceMapURL.startsWith("data:")) {
+ let {mimeType, base64, data} = parseDataURL(sourceMapURL);
+ let content = base64 ? atob(data) : data;
+ sourceMapLoaded.call(this, null, content, mimeType, 0);
+ return;
+ }
+
+ // COMPATIBILITY (iOS 7): Network.loadResource did not exist.
+ // Also, JavaScript Debuggable may reach this.
+ if (!window.NetworkAgent || !NetworkAgent.loadResource) {
+ this._loadAndParseFailed(sourceMapURL);
+ return;
+ }
+
</ins><span class="cx"> var frameIdentifier = null;
</span><span class="cx"> if (originalSourceCode instanceof WebInspector.Resource && originalSourceCode.parentFrame)
</span><span class="cx"> frameIdentifier = originalSourceCode.parentFrame.id;
</span><span class="lines">@@ -115,12 +129,6 @@
</span><span class="cx"> if (!frameIdentifier)
</span><span class="cx"> frameIdentifier = WebInspector.frameResourceManager.mainFrame.id;
</span><span class="cx">
</span><del>- // COMPATIBILITY (iOS 7): Network.loadResource did not exist.
- if (!NetworkAgent.loadResource) {
- this._loadAndParseFailed(sourceMapURL);
- return;
- }
-
</del><span class="cx"> NetworkAgent.loadResource(frameIdentifier, sourceMapURL, sourceMapLoaded.bind(this));
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsSourceMapjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/SourceMap.js (196653 => 196654)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/SourceMap.js        2016-02-16 21:16:18 UTC (rev 196653)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/SourceMap.js        2016-02-16 21:17:31 UTC (rev 196654)
</span><span class="lines">@@ -74,6 +74,11 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> var urlComponents = parseURL(this._sourceMappingURL);
</span><ins>+
+ // Fallback for JavaScript debuggable named scripts that may not have a complete URL.
+ if (!urlComponents.path)
+ urlComponents.path = this._sourceMappingURL;
+
</ins><span class="cx"> urlComponents.path = urlComponents.path.substr(0, urlComponents.path.lastIndexOf(urlComponents.lastPathComponent));
</span><span class="cx"> urlComponents.lastPathComponent = null;
</span><span class="cx"> this._sourceMappingURLBasePathComponents = urlComponents;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsSourceMapResourcejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/SourceMapResource.js (196653 => 196654)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/SourceMapResource.js        2016-02-16 21:16:18 UTC (rev 196653)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/SourceMapResource.js        2016-02-16 21:17:31 UTC (rev 196654)
</span><span class="lines">@@ -61,6 +61,10 @@
</span><span class="cx"> var sourceMappingBasePathURLComponents = this._sourceMap.sourceMappingBasePathURLComponents;
</span><span class="cx"> var resourceURLComponents = this.urlComponents;
</span><span class="cx">
</span><ins>+ // Fallback for JavaScript debuggable named scripts that may not have a complete URL.
+ if (!resourceURLComponents.path)
+ resourceURLComponents.path = this.url;
+
</ins><span class="cx"> // Different schemes / hosts. Return the host + path of this resource.
</span><span class="cx"> if (resourceURLComponents.scheme !== sourceMappingBasePathURLComponents.scheme || resourceURLComponents.host !== sourceMappingBasePathURLComponents.host)
</span><span class="cx"> return resourceURLComponents.host + (resourceURLComponents.port ? (":" + resourceURLComponents.port) : "") + resourceURLComponents.path;
</span><span class="lines">@@ -128,7 +132,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // COMPATIBILITY (iOS 7): Network.loadResource did not exist.
</span><del>- if (!NetworkAgent.loadResource)
</del><ins>+ // Also, JavaScript Debuggable with SourceMaps that do not have inlined content may reach this.
+ if (!window.NetworkAgent || !NetworkAgent.loadResource)
</ins><span class="cx"> return sourceMapResourceLoadError.call(this);
</span><span class="cx">
</span><span class="cx"> var frameIdentifier = null;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsResourceSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js (196653 => 196654)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js        2016-02-16 21:16:18 UTC (rev 196653)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js        2016-02-16 21:17:31 UTC (rev 196654)
</span><span class="lines">@@ -66,8 +66,10 @@
</span><span class="cx"> this.contentTreeOutline.addEventListener(WebInspector.TreeOutline.Event.SelectionDidChange, this._treeSelectionDidChange, this);
</span><span class="cx"> this.contentTreeOutline.includeSourceMapResourceChildren = true;
</span><span class="cx">
</span><del>- if (WebInspector.debuggableType === WebInspector.DebuggableType.JavaScript)
</del><ins>+ if (WebInspector.debuggableType === WebInspector.DebuggableType.JavaScript) {
</ins><span class="cx"> this.contentTreeOutline.disclosureButtons = false;
</span><ins>+ WebInspector.SourceCode.addEventListener(WebInspector.SourceCode.Event.SourceMapAdded, () => { this.contentTreeOutline.disclosureButtons = true }, this);
+ }
</ins><span class="cx">
</span><span class="cx"> if (WebInspector.frameResourceManager.mainFrame)
</span><span class="cx"> this._mainFrameMainResourceDidChange(WebInspector.frameResourceManager.mainFrame);
</span></span></pre>
</div>
</div>
</body>
</html>