https://bugs.webkit.org/show_bug.cgi?id=111184
Patch by Andrey Lushnikov <lushnikov@chromium.org> on 2013-03-04
Reviewed by Pavel Feldman.
Source/WebCore:
- Add a file "buildSystemOnly.js" which will be included into
devtools.html only by GYP build system. This script sets a single flag
which essentially means that inspector source files were run
through a build system and flattened.
- Update "importScript" and "registerRequiredCSS" functions to correct
paths according to the "flattenImports" flag.
No new tests: no change in behaviour.
* WebCore.gypi:
* inspector/front-end/CodeMirrorTextEditor.js:
(WebInspector.CodeMirrorTextEditor):
* inspector/front-end/View.js:
(WebInspector.View.prototype.registerRequiredCSS):
* inspector/front-end/buildSystemOnly.js: Added.
* inspector/front-end/utilities.js:
Source/WebKit/chromium:
Included "buildSystemOnly.js" in devtools.html by generate_devtools_html.py script.
* WebKit.gyp:
* scripts/generate_devtools_html.py: Add script tag to include buildSystemOnly.js
(write_devtools_html):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144605
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-03-04 Andrey Lushnikov <lushnikov@chromium.org>
+
+ Web Inspector: add runtime flag to determine if inspector's source files were flattened.
+ https://bugs.webkit.org/show_bug.cgi?id=111184
+
+ Reviewed by Pavel Feldman.
+
+ - Add a file "buildSystemOnly.js" which will be included into
+ devtools.html only by GYP build system. This script sets a single flag
+ which essentially means that inspector source files were run
+ through a build system and flattened.
+ - Update "importScript" and "registerRequiredCSS" functions to correct
+ paths according to the "flattenImports" flag.
+
+ No new tests: no change in behaviour.
+
+ * WebCore.gypi:
+ * inspector/front-end/CodeMirrorTextEditor.js:
+ (WebInspector.CodeMirrorTextEditor):
+ * inspector/front-end/View.js:
+ (WebInspector.View.prototype.registerRequiredCSS):
+ * inspector/front-end/buildSystemOnly.js: Added.
+ * inspector/front-end/utilities.js:
+
2013-03-04 Vsevolod Vlasov <vsevik@chromium.org>
Web Inspector: Fix front-end compilation
'inspector/front-end/inspectorSyntaxHighlight.css',
'inspector/front-end/popover.css',
'<@(webinspector_modules_js_files)',
- '<@(webinspector_standalone_css_files)',
+ '<@(webinspector_standalone_files)',
],
- 'webinspector_standalone_css_files': [
+ 'webinspector_standalone_files': [
'inspector/front-end/auditsPanel.css',
'inspector/front-end/breadcrumbList.css',
+ 'inspector/front-end/buildSystemOnly.js',
'inspector/front-end/cm/cmdevtools.css',
'inspector/front-end/cm/codemirror.css',
'inspector/front-end/cssNamedFlows.css',
this._delegate = delegate;
this._url = url;
- this.registerRequiredCSS("codemirror.css");
- this.registerRequiredCSS("cmdevtools.css");
+ this.registerRequiredCSS("cm/codemirror.css");
+ this.registerRequiredCSS("cm/cmdevtools.css");
this._codeMirror = window.CodeMirror(this.element, {
lineNumbers: true,
registerRequiredCSS: function(cssFile)
{
+ if (window.flattenImports)
+ cssFile = cssFile.split("/").reverse()[0];
this._cssFiles.push(cssFile);
},
--- /dev/null
+/**
+ * This flag notifies inspector that it was deployed with the help
+ * of a build system. Build system flattenes all css and js files,
+ * so in this case inspector has to correct paths for dynamic resource loading.
+ */
+window.flattenImports = true;
return;
var xhr = new XMLHttpRequest();
_importedScripts[scriptName] = true;
- try {
- xhr.open("GET", scriptName, false);
- xhr.send(null);
- } catch (e) {
- // Try to load file from the root directory
+ if (window.flattenImports)
scriptName = scriptName.split("/").reverse()[0];
- xhr.open("GET", scriptName, false);
- xhr.send(null);
- }
+ xhr.open("GET", scriptName, false);
+ xhr.send(null);
var sourceURL = WebInspector.ParsedURL.completeURL(window.location.href, scriptName);
window.eval(xhr.responseText + "\n//@ sourceURL=" + sourceURL);
}
+2013-03-04 Andrey Lushnikov <lushnikov@chromium.org>
+
+ Web Inspector: add runtime flag to determine if inspector's source files were flattened.
+ https://bugs.webkit.org/show_bug.cgi?id=111184
+
+ Reviewed by Pavel Feldman.
+
+ Included "buildSystemOnly.js" in devtools.html by generate_devtools_html.py script.
+
+ * WebKit.gyp:
+ * scripts/generate_devtools_html.py: Add script tag to include buildSystemOnly.js
+ (write_devtools_html):
+
2013-03-03 Alexandre Elias <aelias@chromium.org>
[chromium] Remove WebLayerTreeView::setViewportSize call
'<(PRODUCT_DIR)/resources/inspector/ScriptFormatterWorker.js',
'<(PRODUCT_DIR)/resources/inspector/devTools.css',
'<(PRODUCT_DIR)/resources/inspector/devtools_extension_api.js',
- '<@(webinspector_standalone_css_files)',
+ '<@(webinspector_standalone_files)',
],
'images': [
'<@(webinspector_image_files)',
'copies': [{
'destination': '<(PRODUCT_DIR)/resources/inspector',
'files': [
- '<@(webinspector_standalone_css_files)',
+ '<@(webinspector_standalone_files)',
],
}],
},
devtools_file.write(generate_include_tag("devTools.css"))
devtools_file.write(generate_include_tag("DevTools.js"))
devtools_file.write(line)
+ if '<head>' in line:
+ devtools_file.write(generate_include_tag("buildSystemOnly.js"))
def main(argv):