Diff
Modified: trunk/LayoutTests/ChangeLog (141999 => 142000)
--- trunk/LayoutTests/ChangeLog 2013-02-06 15:50:56 UTC (rev 141999)
+++ trunk/LayoutTests/ChangeLog 2013-02-06 15:52:27 UTC (rev 142000)
@@ -1,3 +1,13 @@
+2013-02-06 Vsevolod Vlasov <[email protected]>
+
+ Web Inspector: Remove isSnippet field from FileDescriptor and UISourceCode.
+ https://bugs.webkit.org/show_bug.cgi?id=109045
+
+ Reviewed by Pavel Feldman.
+
+ * inspector/debugger/scripts-file-selector.html:
+ * inspector/debugger/scripts-sorting.html:
+
2013-02-06 Marja Hölttä <[email protected]>
[WK2] New tests introduced in r100895 fail
Modified: trunk/LayoutTests/inspector/debugger/scripts-file-selector.html (141999 => 142000)
--- trunk/LayoutTests/inspector/debugger/scripts-file-selector.html 2013-02-06 15:50:56 UTC (rev 141999)
+++ trunk/LayoutTests/inspector/debugger/scripts-file-selector.html 2013-02-06 15:52:27 UTC (rev 142000)
@@ -12,10 +12,20 @@
WebInspector.showPanel("scripts");
var navigator = new WebInspector.ScriptsNavigator();
+ var MockProject = function() {}
+ MockProject.prototype.name = function()
+ {
+ return "network";
+ }
+
var uiSourceCodes = [];
function addUISourceCode(url, isContentScript)
{
var uiSourceCode = new WebInspector.UISourceCode(WebInspector.workspace, url, url, url, WebInspector.resourceTypes.Script, null);
+ uiSourceCode.project = function()
+ {
+ return new MockProject();
+ }
uiSourceCode.isContentScript = isContentScript;
navigator.addUISourceCode(uiSourceCode);
uiSourceCodes.push(uiSourceCode);
Modified: trunk/LayoutTests/inspector/debugger/scripts-sorting.html (141999 => 142000)
--- trunk/LayoutTests/inspector/debugger/scripts-sorting.html 2013-02-06 15:50:56 UTC (rev 141999)
+++ trunk/LayoutTests/inspector/debugger/scripts-sorting.html 2013-02-06 15:52:27 UTC (rev 142000)
@@ -12,10 +12,20 @@
var navigator = new WebInspector.ScriptsNavigator();
+ var MockProject = function() {}
+ MockProject.prototype.name = function()
+ {
+ return "network";
+ }
+
var uiSourceCodes = [];
function addUISourceCode(url, isContentScript)
{
var uiSourceCode = new WebInspector.UISourceCode(WebInspector.workspace, url, url, url, WebInspector.resourceTypes.Script, null);
+ uiSourceCode.project = function()
+ {
+ return new MockProject();
+ }
uiSourceCode.isContentScript = isContentScript;
navigator.addUISourceCode(uiSourceCode);
uiSourceCodes.push(uiSourceCode);
Modified: trunk/Source/WebCore/ChangeLog (141999 => 142000)
--- trunk/Source/WebCore/ChangeLog 2013-02-06 15:50:56 UTC (rev 141999)
+++ trunk/Source/WebCore/ChangeLog 2013-02-06 15:52:27 UTC (rev 142000)
@@ -1,3 +1,36 @@
+2013-02-06 Vsevolod Vlasov <[email protected]>
+
+ Web Inspector: Remove isSnippet field from FileDescriptor and UISourceCode.
+ https://bugs.webkit.org/show_bug.cgi?id=109045
+
+ Reviewed by Pavel Feldman.
+
+ Snippets are now distinguished based on uiSourceCode project.
+
+ * inspector/front-end/_javascript_SourceFrame.js:
+ (WebInspector._javascript_SourceFrame.prototype._supportsEnabledBreakpointsWhileEditing):
+ * inspector/front-end/NavigatorView.js:
+ * inspector/front-end/ScriptSnippetModel.js:
+ (WebInspector.ScriptSnippetModel.prototype._addScriptSnippet):
+ * inspector/front-end/ScriptsNavigator.js:
+ (WebInspector.ScriptsNavigator.prototype._navigatorViewForUISourceCode):
+ (WebInspector.ScriptsNavigator.prototype.addUISourceCode):
+ (WebInspector.ScriptsNavigator.prototype.removeUISourceCode):
+ (WebInspector.ScriptsNavigator.prototype.revealUISourceCode):
+ (WebInspector.ScriptsNavigator.prototype.rename):
+ (WebInspector.SnippetsNavigatorView.prototype._handleEvaluateSnippet):
+ (WebInspector.SnippetsNavigatorView.prototype._handleRemoveSnippet):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype._showFile):
+ (WebInspector.ScriptsPanel.prototype._createSourceFrame):
+ (WebInspector.ScriptsPanel.prototype.set _fileRenamed):
+ * inspector/front-end/SimpleWorkspaceProvider.js:
+ (WebInspector.SimpleWorkspaceProvider.prototype.addFile):
+ (WebInspector.SimpleWorkspaceProvider.prototype.addFileForURL):
+ * inspector/front-end/Workspace.js:
+ (WebInspector.FileDescriptor):
+ (WebInspector.Project.prototype._fileAdded):
+
2013-02-06 Sheriff Bot <[email protected]>
Unreviewed, rolling out r141983.
Modified: trunk/Source/WebCore/inspector/front-end/_javascript_SourceFrame.js (141999 => 142000)
--- trunk/Source/WebCore/inspector/front-end/_javascript_SourceFrame.js 2013-02-06 15:50:56 UTC (rev 141999)
+++ trunk/Source/WebCore/inspector/front-end/_javascript_SourceFrame.js 2013-02-06 15:52:27 UTC (rev 142000)
@@ -234,7 +234,7 @@
_supportsEnabledBreakpointsWhileEditing: function()
{
- return this._uiSourceCode.isSnippet;
+ return this._uiSourceCode.project().name() === WebInspector.projectNames.Snippets;
},
_restoreBreakpointsAfterEditing: function()
Modified: trunk/Source/WebCore/inspector/front-end/NavigatorView.js (141999 => 142000)
--- trunk/Source/WebCore/inspector/front-end/NavigatorView.js 2013-02-06 15:50:56 UTC (rev 141999)
+++ trunk/Source/WebCore/inspector/front-end/NavigatorView.js 2013-02-06 15:52:27 UTC (rev 142000)
@@ -161,16 +161,7 @@
/**
* @param {WebInspector.UISourceCode} uiSourceCode
- * @return {boolean}
*/
- isScriptSourceAdded: function(uiSourceCode)
- {
- return !!this._uiSourceCodes[uiSourceCode.uri()];
- },
-
- /**
- * @param {WebInspector.UISourceCode} uiSourceCode
- */
revealUISourceCode: function(uiSourceCode)
{
if (this._scriptsTree.selectedTreeElement)
Modified: trunk/Source/WebCore/inspector/front-end/ScriptSnippetModel.js (141999 => 142000)
--- trunk/Source/WebCore/inspector/front-end/ScriptSnippetModel.js 2013-02-06 15:50:56 UTC (rev 141999)
+++ trunk/Source/WebCore/inspector/front-end/ScriptSnippetModel.js 2013-02-06 15:52:27 UTC (rev 142000)
@@ -83,7 +83,7 @@
*/
_addScriptSnippet: function(snippet)
{
- var uiSourceCode = this._workspaceProvider.addFile(snippet.name, snippet.name, new WebInspector.SnippetContentProvider(snippet), true, false, true);
+ var uiSourceCode = this._workspaceProvider.addFile(snippet.name, snippet.name, new WebInspector.SnippetContentProvider(snippet), true);
var scriptFile = new WebInspector.SnippetScriptFile(this, uiSourceCode);
uiSourceCode.setScriptFile(scriptFile);
this._snippetIdForUISourceCode.put(uiSourceCode, snippet.id);
Modified: trunk/Source/WebCore/inspector/front-end/ScriptsNavigator.js (141999 => 142000)
--- trunk/Source/WebCore/inspector/front-end/ScriptsNavigator.js 2013-02-06 15:50:56 UTC (rev 141999)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsNavigator.js 2013-02-06 15:52:27 UTC (rev 142000)
@@ -80,11 +80,11 @@
/**
* @param {WebInspector.UISourceCode} uiSourceCode
*/
- _snippetsNavigatorViewForUISourceCode: function(uiSourceCode)
+ _navigatorViewForUISourceCode: function(uiSourceCode)
{
if (uiSourceCode.isContentScript)
return this._contentScriptsView;
- else if (uiSourceCode.isSnippet)
+ else if (uiSourceCode.project().name() === WebInspector.projectNames.Snippets)
return this._snippetsView;
else
return this._scriptsView;
@@ -95,7 +95,7 @@
*/
addUISourceCode: function(uiSourceCode)
{
- this._snippetsNavigatorViewForUISourceCode(uiSourceCode).addUISourceCode(uiSourceCode);
+ this._navigatorViewForUISourceCode(uiSourceCode).addUISourceCode(uiSourceCode);
},
/**
@@ -103,27 +103,18 @@
*/
removeUISourceCode: function(uiSourceCode)
{
- this._snippetsNavigatorViewForUISourceCode(uiSourceCode).removeUISourceCode(uiSourceCode);
+ this._navigatorViewForUISourceCode(uiSourceCode).removeUISourceCode(uiSourceCode);
},
/**
* @param {WebInspector.UISourceCode} uiSourceCode
- * @return {boolean}
*/
- isScriptSourceAdded: function(uiSourceCode)
- {
- return this._snippetsNavigatorViewForUISourceCode(uiSourceCode).isScriptSourceAdded(uiSourceCode);
- },
-
- /**
- * @param {WebInspector.UISourceCode} uiSourceCode
- */
revealUISourceCode: function(uiSourceCode)
{
- this._snippetsNavigatorViewForUISourceCode(uiSourceCode).revealUISourceCode(uiSourceCode);
+ this._navigatorViewForUISourceCode(uiSourceCode).revealUISourceCode(uiSourceCode);
if (uiSourceCode.isContentScript)
this._tabbedPane.selectTab(WebInspector.ScriptsNavigator.ContentScriptsTab);
- else if (uiSourceCode.isSnippet)
+ else if (uiSourceCode.project().name() === WebInspector.projectNames.Snippets)
this._tabbedPane.selectTab(WebInspector.ScriptsNavigator.SnippetsTab);
else
this._tabbedPane.selectTab(WebInspector.ScriptsNavigator.ScriptsTab);
@@ -135,7 +126,7 @@
*/
rename: function(uiSourceCode, callback)
{
- this._snippetsNavigatorViewForUISourceCode(uiSourceCode).rename(uiSourceCode, callback);
+ this._navigatorViewForUISourceCode(uiSourceCode).rename(uiSourceCode, callback);
},
/**
@@ -219,7 +210,7 @@
*/
_handleEvaluateSnippet: function(uiSourceCode)
{
- if (!uiSourceCode.isSnippet)
+ if (!uiSourceCode.project().name() === WebInspector.projectNames.Snippets)
return;
WebInspector.scriptSnippetModel.evaluateScriptSnippet(uiSourceCode);
},
@@ -237,7 +228,7 @@
*/
_handleRemoveSnippet: function(uiSourceCode)
{
- if (!uiSourceCode.isSnippet)
+ if (!uiSourceCode.project().name() === WebInspector.projectNames.Snippets)
return;
WebInspector.scriptSnippetModel.deleteScriptSnippet(uiSourceCode);
},
Modified: trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js (141999 => 142000)
--- trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js 2013-02-06 15:50:56 UTC (rev 141999)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js 2013-02-06 15:52:27 UTC (rev 142000)
@@ -437,8 +437,7 @@
if (this._currentUISourceCode === uiSourceCode)
return sourceFrame;
this._currentUISourceCode = uiSourceCode;
-
- if (this._navigator.isScriptSourceAdded(uiSourceCode))
+ if (!uiSourceCode.project().isServiceProject())
this._navigator.revealUISourceCode(uiSourceCode);
this._editorContainer.showFile(uiSourceCode);
this._updateScriptViewStatusBarItems();
@@ -455,7 +454,7 @@
var sourceFrame;
switch (uiSourceCode.contentType()) {
case WebInspector.resourceTypes.Script:
- if (uiSourceCode.isSnippet)
+ if (uiSourceCode.project().name() === WebInspector.projectNames.Snippets)
sourceFrame = new WebInspector.SnippetJavaScriptSourceFrame(this, uiSourceCode);
else
sourceFrame = new WebInspector._javascript_SourceFrame(this, uiSourceCode);
@@ -1034,7 +1033,7 @@
{
var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data.uiSourceCode);
var name = /** @type {string} */ (event.data.name);
- if (!uiSourceCode.isSnippet)
+ if (!uiSourceCode.project().name() === WebInspector.projectNames.Snippets)
return;
WebInspector.scriptSnippetModel.renameScriptSnippet(uiSourceCode, name);
},
Modified: trunk/Source/WebCore/inspector/front-end/SimpleWorkspaceProvider.js (141999 => 142000)
--- trunk/Source/WebCore/inspector/front-end/SimpleWorkspaceProvider.js 2013-02-06 15:50:56 UTC (rev 141999)
+++ trunk/Source/WebCore/inspector/front-end/SimpleWorkspaceProvider.js 2013-02-06 15:52:27 UTC (rev 142000)
@@ -90,12 +90,11 @@
* @param {WebInspector.ContentProvider} contentProvider
* @param {boolean} isEditable
* @param {boolean=} isContentScript
- * @param {boolean=} isSnippet
*/
- addFile: function(uri, url, contentProvider, isEditable, isContentScript, isSnippet)
+ addFile: function(uri, url, contentProvider, isEditable, isContentScript)
{
console.assert(!this._contentProviders[uri]);
- var fileDescriptor = new WebInspector.FileDescriptor(uri, url, url, contentProvider.contentType(), isEditable, isContentScript, isSnippet);
+ var fileDescriptor = new WebInspector.FileDescriptor(uri, url, url, contentProvider.contentType(), isEditable, isContentScript);
this._contentProviders[uri] = contentProvider;
this.dispatchEventToListeners(WebInspector.WorkspaceProvider.Events.FileAdded, fileDescriptor);
return this._workspace.uiSourceCodeForURI(uri);
@@ -106,12 +105,11 @@
* @param {WebInspector.ContentProvider} contentProvider
* @param {boolean} isEditable
* @param {boolean=} isContentScript
- * @param {boolean=} isSnippet
*/
- addFileForURL: function(url, contentProvider, isEditable, isContentScript, isSnippet)
+ addFileForURL: function(url, contentProvider, isEditable, isContentScript)
{
var uri = WebInspector.SimpleWorkspaceProvider.uriForURL(url);
- return this.addFile(uri, url, contentProvider, isEditable, isContentScript, isSnippet);
+ return this.addFile(uri, url, contentProvider, isEditable, isContentScript);
},
/**
Modified: trunk/Source/WebCore/inspector/front-end/Workspace.js (141999 => 142000)
--- trunk/Source/WebCore/inspector/front-end/Workspace.js 2013-02-06 15:50:56 UTC (rev 141999)
+++ trunk/Source/WebCore/inspector/front-end/Workspace.js 2013-02-06 15:52:27 UTC (rev 142000)
@@ -55,9 +55,8 @@
* @param {WebInspector.ResourceType} contentType
* @param {boolean} isEditable
* @param {boolean=} isContentScript
- * @param {boolean=} isSnippet
*/
-WebInspector.FileDescriptor = function(uri, originURL, url, contentType, isEditable, isContentScript, isSnippet)
+WebInspector.FileDescriptor = function(uri, originURL, url, contentType, isEditable, isContentScript)
{
this.uri = uri;
this.originURL = originURL;
@@ -65,7 +64,6 @@
this.contentType = contentType;
this.isEditable = isEditable;
this.isContentScript = isContentScript || false;
- this.isSnippet = isSnippet || false;
}
/**
@@ -167,7 +165,6 @@
}
uiSourceCode = new WebInspector.UISourceCode(this._workspace, fileDescriptor.uri, fileDescriptor.originURL, fileDescriptor.url, fileDescriptor.contentType, fileDescriptor.isEditable);
uiSourceCode.isContentScript = fileDescriptor.isContentScript;
- uiSourceCode.isSnippet = fileDescriptor.isSnippet;
this._uiSourceCodesForURI[uiSourceCode.uri()] = uiSourceCode;
this._workspace.dispatchEventToListeners(WebInspector.UISourceCodeProvider.Events.UISourceCodeAdded, uiSourceCode);
},