Web Inspector: REGRESSION(r252652): Local Overrides: creating a local override for a resource loaded before Web Inspector was opened shows NaN for the Status Code
https://bugs.webkit.org/show_bug.cgi?id=204965
Reviewed by Joseph Pecoraro.
* UserInterface/Views/LocalResourceOverridePopover.js:
(WI.LocalResourceOverridePopover.prototype.show):
Make sure to update the object that holds the resource's original data in addition to the
object that holds the current edited values.
Drive-by: update the popover once all of the `CodeMirror`s have updated to hide scrollbars.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@253229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog
index cf925f8..e561fe6 100644
--- a/Source/WebInspectorUI/ChangeLog
+++ b/Source/WebInspectorUI/ChangeLog
@@ -1,3 +1,16 @@
+2019-12-06 Devin Rousso <drousso@apple.com>
+
+ Web Inspector: REGRESSION(r252652): Local Overrides: creating a local override for a resource loaded before Web Inspector was opened shows NaN for the Status Code
+ https://bugs.webkit.org/show_bug.cgi?id=204965
+
+ Reviewed by Joseph Pecoraro.
+
+ * UserInterface/Views/LocalResourceOverridePopover.js:
+ (WI.LocalResourceOverridePopover.prototype.show):
+ Make sure to update the object that holds the resource's original data in addition to the
+ object that holds the current edited values.
+ Drive-by: update the popover once all of the `CodeMirror`s have updated to hide scrollbars.
+
2019-11-25 Brian Burg <bburg@apple.com>
Web Inspector: TabActivity diagnostic event should sample the active tab uniformly
diff --git a/Source/WebInspectorUI/UserInterface/Views/LocalResourceOverridePopover.js b/Source/WebInspectorUI/UserInterface/Views/LocalResourceOverridePopover.js
index 79c3e65..a471b6d 100644
--- a/Source/WebInspectorUI/UserInterface/Views/LocalResourceOverridePopover.js
+++ b/Source/WebInspectorUI/UserInterface/Views/LocalResourceOverridePopover.js
@@ -131,12 +131,19 @@
if (!data.url)
data.url = this._defaultURL();
+
if (!data.mimeType)
data.mimeType = "text/javascript";
- if (!data.statusCode || data.statusCode === "NaN")
+
+ if (!data.statusCode || data.statusCode === "NaN") {
data.statusCode = "200";
- if (!data.statusText)
+ resourceData.statusCode = undefined;
+ }
+
+ if (!data.statusText) {
data.statusText = WI.HTTPUtilities.statusTextForStatusCode(parseInt(data.statusCode));
+ resourceData.statusText = undefined;
+ }
let responseHeaders = localResource ? localResource.responseHeaders : {};
@@ -382,6 +389,8 @@
this._urlCodeMirror.focus();
this._urlCodeMirror.setCursor(this._urlCodeMirror.lineCount(), 0);
+
+ this.update();
});
}