Title: [144305] trunk/Source/WebCore
- Revision
- 144305
- Author
- [email protected]
- Date
- 2013-02-28 06:53:35 -0800 (Thu, 28 Feb 2013)
Log Message
Web Inspector: "loadScript" function to load scripts via xhr
https://bugs.webkit.org/show_bug.cgi?id=110879
Patch by Andrey Lushnikov <[email protected]> on 2013-02-28
Reviewed by Pavel Feldman.
Create an alias for "importScript" function and use it in those cases
which assume lazy script loading.
No new tests.
* inspector/front-end/Panel.js:
(WebInspector.PanelDescriptor.prototype.panel):
* inspector/front-end/SourceFrame.js:
(WebInspector.SourceFrame):
* inspector/front-end/utilities.js:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (144304 => 144305)
--- trunk/Source/WebCore/ChangeLog 2013-02-28 14:43:48 UTC (rev 144304)
+++ trunk/Source/WebCore/ChangeLog 2013-02-28 14:53:35 UTC (rev 144305)
@@ -1,3 +1,21 @@
+2013-02-28 Andrey Lushnikov <[email protected]>
+
+ Web Inspector: "loadScript" function to load scripts via xhr
+ https://bugs.webkit.org/show_bug.cgi?id=110879
+
+ Reviewed by Pavel Feldman.
+
+ Create an alias for "importScript" function and use it in those cases
+ which assume lazy script loading.
+
+ No new tests.
+
+ * inspector/front-end/Panel.js:
+ (WebInspector.PanelDescriptor.prototype.panel):
+ * inspector/front-end/SourceFrame.js:
+ (WebInspector.SourceFrame):
+ * inspector/front-end/utilities.js:
+
2013-02-28 Alexei Filippov <[email protected]>
Web Inspector: Move profiler tools into separate panels
Modified: trunk/Source/WebCore/inspector/front-end/Panel.js (144304 => 144305)
--- trunk/Source/WebCore/inspector/front-end/Panel.js 2013-02-28 14:43:48 UTC (rev 144304)
+++ trunk/Source/WebCore/inspector/front-end/Panel.js 2013-02-28 14:53:35 UTC (rev 144305)
@@ -328,7 +328,7 @@
if (this._panel)
return this._panel;
if (this._scriptName)
- importScript(this._scriptName);
+ loadScript(this._scriptName);
this._panel = new WebInspector[this._className];
return this._panel;
},
Modified: trunk/Source/WebCore/inspector/front-end/SourceFrame.js (144304 => 144305)
--- trunk/Source/WebCore/inspector/front-end/SourceFrame.js 2013-02-28 14:43:48 UTC (rev 144304)
+++ trunk/Source/WebCore/inspector/front-end/SourceFrame.js 2013-02-28 14:53:35 UTC (rev 144305)
@@ -44,7 +44,7 @@
var textEditorDelegate = new WebInspector.TextEditorDelegateForSourceFrame(this);
if (WebInspector.experimentsSettings.codemirror.isEnabled()) {
- importScript("CodeMirrorTextEditor.js");
+ loadScript("CodeMirrorTextEditor.js");
this._textEditor = new WebInspector.CodeMirrorTextEditor(this._url, textEditorDelegate);
} else
this._textEditor = new WebInspector.DefaultTextEditor(this._url, textEditorDelegate);
Modified: trunk/Source/WebCore/inspector/front-end/utilities.js (144304 => 144305)
--- trunk/Source/WebCore/inspector/front-end/utilities.js 2013-02-28 14:43:48 UTC (rev 144304)
+++ trunk/Source/WebCore/inspector/front-end/utilities.js 2013-02-28 14:53:35 UTC (rev 144305)
@@ -968,6 +968,12 @@
var _importedScripts = {};
/**
+ * This function behavior depends on the "debug_devtools" flag value.
+ * - In debug mode it loads scripts synchronously via xhr request.
+ * - In release mode every occurrence of "importScript" gets replaced with
+ * the script source code on the compilation phase.
+ *
+ * To load scripts lazily in release mode call "loasScript" function.
* @param {string} scriptName
*/
function importScript(scriptName)
@@ -981,3 +987,5 @@
var sourceURL = WebInspector.ParsedURL.completeURL(window.location.href, scriptName);
window.eval(xhr.responseText + "\n//@ sourceURL=" + sourceURL);
}
+
+var loadScript = importScript;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes