summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/inspector/front-end
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/inspector/front-end')
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/ConsoleView.js45
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/DOMStorage.js46
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/DOMStorageDataGrid.js42
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/DOMStorageItemsView.js85
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/ElementsTreeOutline.js11
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/ImageView.js1
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/Images/errorRedDot.pngbin0 -> 549 bytes
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/Images/successGreenDot.pngbin0 -> 585 bytes
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/Images/warningOrangeDot.pngbin0 -> 580 bytes
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/InjectedScript.js88
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/InjectedScriptAccess.js1
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/ObjectProxy.js8
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/Resource.js63
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/ResourceView.js50
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/ScriptsPanel.js8
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/StoragePanel.js110
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/inspector.css31
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/inspector.js99
-rw-r--r--src/3rdparty/webkit/WebCore/inspector/front-end/utilities.js6
19 files changed, 462 insertions, 232 deletions
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/ConsoleView.js b/src/3rdparty/webkit/WebCore/inspector/front-end/ConsoleView.js
index 41b14ef..575b13a 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/ConsoleView.js
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/ConsoleView.js
@@ -61,6 +61,14 @@ WebInspector.ConsoleView = function(drawer)
// Will hold the list of filter elements
this.filterBarElement = document.getElementById("console-filter");
+ function createDividerElement() {
+ var dividerElement = document.createElement("div");
+
+ dividerElement.addStyleClass("divider");
+
+ this.filterBarElement.appendChild(dividerElement);
+ }
+
function createFilterElement(category) {
var categoryElement = document.createElement("li");
categoryElement.category = category;
@@ -77,6 +85,9 @@ WebInspector.ConsoleView = function(drawer)
}
this.allElement = createFilterElement.call(this, "All");
+
+ createDividerElement.call(this);
+
this.errorElement = createFilterElement.call(this, "Errors");
this.warningElement = createFilterElement.call(this, "Warnings");
this.logElement = createFilterElement.call(this, "Logs");
@@ -291,24 +302,10 @@ WebInspector.ConsoleView.prototype = {
}
}
- function parsingCallback(result, isException)
- {
- if (!isException)
- result = JSON.parse(result);
- reportCompletions(result, isException);
- }
-
- this.evalInInspectedWindow(
- "(function() {" +
- "var props = {};" +
- "for (var prop in (" + expressionString + ")) props[prop] = true;" +
- ((!dotNotation && !bracketNotation) ?
- "for (var prop in window._inspectorCommandLineAPI)" +
- "if (prop.charAt(0) !== '_') props[prop] = true;"
- : "") +
- "return JSON.stringify(props);" +
- "})()",
- parsingCallback);
+ var includeInspectorCommandLineAPI = (!dotNotation && !bracketNotation);
+ if (WebInspector.panels.scripts && WebInspector.panels.scripts.paused)
+ var callFrameId = WebInspector.panels.scripts.selectedCallFrameId();
+ InjectedScriptAccess.getCompletions(expressionString, includeInspectorCommandLineAPI, callFrameId, reportCompletions);
},
_reportCompletions: function(bestMatchOnly, completionsReadyCallback, dotNotation, bracketNotation, prefix, result, isException) {
@@ -611,7 +608,7 @@ WebInspector.ConsoleMessage.prototype = {
this.formattedMessage = span;
break;
case WebInspector.ConsoleMessage.MessageType.Object:
- this.formattedMessage = this._format(["%O", args[0]]);
+ this.formattedMessage = this._format([WebInspector.ObjectProxy.wrapPrimitiveValue("%O"), args[0]]);
break;
default:
this.formattedMessage = this._format(args);
@@ -644,7 +641,7 @@ WebInspector.ConsoleMessage.prototype = {
return WebInspector.console._format(obj, true);
}
- if (typeof parameters[0] === "string") {
+ if (Object.proxyType(parameters[0]) === "string") {
var formatters = {}
for (var i in String.standardFormatters)
formatters[i] = String.standardFormatters[i];
@@ -665,7 +662,7 @@ WebInspector.ConsoleMessage.prototype = {
return a;
}
- var result = String.format(parameters[0], parameters.slice(1), formatters, formattedResult, append);
+ var result = String.format(parameters[0].description, parameters.slice(1), formatters, formattedResult, append);
formattedResult = result.formattedResult;
parameters = result.unusedSubstitutions;
if (parameters.length)
@@ -673,8 +670,8 @@ WebInspector.ConsoleMessage.prototype = {
}
for (var i = 0; i < parameters.length; ++i) {
- if (typeof parameters[i] === "string")
- formattedResult.appendChild(WebInspector.linkifyStringAsFragment(parameters[i]));
+ if (Object.proxyType(parameters[i]) === "string")
+ formattedResult.appendChild(WebInspector.linkifyStringAsFragment(parameters[i].description));
else
formattedResult.appendChild(formatForConsole(parameters[i]));
@@ -916,7 +913,7 @@ WebInspector.ConsoleTextMessage.prototype.__proto__ = WebInspector.ConsoleMessag
WebInspector.ConsoleCommandResult = function(result, exception, originatingCommand)
{
var level = (exception ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log);
- var message = (exception ? String(result) : result);
+ var message = result;
var line = (exception ? result.line : -1);
var url = (exception ? result.sourceURL : null);
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/DOMStorage.js b/src/3rdparty/webkit/WebCore/inspector/front-end/DOMStorage.js
index 5207b69..03a10bf 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/DOMStorage.js
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/DOMStorage.js
@@ -26,24 +26,22 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-WebInspector.DOMStorage = function(domStorage, domain, isLocalStorage)
+WebInspector.DOMStorage = function(id, domain, isLocalStorage)
{
- this.domStorage = domStorage;
- this.domain = domain;
- this.isLocalStorage = isLocalStorage;
+ this._id = id;
+ this._domain = domain;
+ this._isLocalStorage = isLocalStorage;
}
WebInspector.DOMStorage.prototype = {
- get domStorage()
+ get id()
{
- return this._domStorage;
+ return this._id;
},
- set domStorage(x)
+ get domStorage()
{
- if (this._domStorage === x)
- return;
- this._domStorage = x;
+ return this._domStorage;
},
get domain()
@@ -51,22 +49,30 @@ WebInspector.DOMStorage.prototype = {
return this._domain;
},
- set domain(x)
+ get isLocalStorage()
+ {
+ return this._isLocalStorage;
+ },
+
+ getEntries: function(callback)
{
- if (this._domain === x)
- return;
- this._domain = x;
+ var callId = WebInspector.Callback.wrap(callback);
+ InspectorController.getDOMStorageEntries(callId, this._id);
},
- get isLocalStorage()
+ setItem: function(key, value, callback)
{
- return this._isLocalStorage;
+ var callId = WebInspector.Callback.wrap(callback);
+ InspectorController.setDOMStorageItem(callId, this._id, key, value);
},
- set isLocalStorage(x)
+ removeItem: function(key, callback)
{
- if (this._isLocalStorage === x)
- return;
- this._isLocalStorage = x;
+ var callId = WebInspector.Callback.wrap(callback);
+ InspectorController.removeDOMStorageItem(callId, this._id, key);
}
}
+
+WebInspector.didGetDOMStorageEntries = WebInspector.Callback.processCallback;
+WebInspector.didSetDOMStorageItem = WebInspector.Callback.processCallback;
+WebInspector.didRemoveDOMStorageItem = WebInspector.Callback.processCallback;
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/DOMStorageDataGrid.js b/src/3rdparty/webkit/WebCore/inspector/front-end/DOMStorageDataGrid.js
index efdd090..45a9ba1 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/DOMStorageDataGrid.js
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/DOMStorageDataGrid.js
@@ -23,10 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-WebInspector.DOMStorageDataGrid = function(columns)
+WebInspector.DOMStorageDataGrid = function(columns, domStorage, keys)
{
WebInspector.DataGrid.call(this, columns);
this.dataTableBody.addEventListener("dblclick", this._ondblclick.bind(this), false);
+ this._domStorage = domStorage;
+ this._keys = keys;
}
WebInspector.DOMStorageDataGrid.prototype = {
@@ -44,7 +46,6 @@ WebInspector.DOMStorageDataGrid.prototype = {
this._editing = true;
this._editingNode = node;
this._editingNode.select();
- WebInspector.panels.storage._unregisterStorageEventListener();
var element = this._editingNode._element.children[column];
WebInspector.startEditing(element, this._editingCommitted.bind(this), this._editingCancelled.bind(this), element.textContent);
@@ -69,7 +70,6 @@ WebInspector.DOMStorageDataGrid.prototype = {
return this._startEditingColumnOfDataGridNode(this._editingNode, 0);
this._editing = true;
- WebInspector.panels.storage._unregisterStorageEventListener();
WebInspector.startEditing(element, this._editingCommitted.bind(this), this._editingCancelled.bind(this), element.textContent);
window.getSelection().setBaseAndExtent(element, 0, element, 1);
},
@@ -118,22 +118,20 @@ WebInspector.DOMStorageDataGrid.prototype = {
return;
}
- var domStorage = WebInspector.panels.storage.visibleView.domStorage.domStorage;
- if (domStorage) {
- if (columnIdentifier == 0) {
- if (domStorage.getItem(newText) != null) {
- element.textContent = this._editingNode.data[0];
- this._editingCancelled(element);
- moveToNextIfNeeded.call(this, false);
- return;
- }
- domStorage.removeItem(this._editingNode.data[0]);
- domStorage.setItem(newText, this._editingNode.data[1]);
- this._editingNode.data[0] = newText;
- } else {
- domStorage.setItem(this._editingNode.data[0], newText);
- this._editingNode.data[1] = newText;
+ var domStorage = this._domStorage;
+ if (columnIdentifier === 0) {
+ if (this._keys.indexOf(newText) !== -1) {
+ element.textContent = this._editingNode.data[0];
+ this._editingCancelled(element);
+ moveToNextIfNeeded.call(this, false);
+ return;
}
+ domStorage.removeItem(this._editingNode.data[0]);
+ domStorage.setItem(newText, this._editingNode.data[1]);
+ this._editingNode.data[0] = newText;
+ } else {
+ domStorage.setItem(this._editingNode.data[0], newText);
+ this._editingNode.data[1] = newText;
}
if (this._editingNode.isCreationNode)
@@ -147,18 +145,16 @@ WebInspector.DOMStorageDataGrid.prototype = {
{
delete this._editing;
this._editingNode = null;
- WebInspector.panels.storage._registerStorageEventListener();
},
deleteSelectedRow: function()
{
var node = this.selectedNode;
- if (this.selectedNode.isCreationNode)
+ if (!node || node.isCreationNode)
return;
- var domStorage = WebInspector.panels.storage.visibleView.domStorage.domStorage;
- if (node && domStorage)
- domStorage.removeItem(node.data[0]);
+ if (this._domStorage)
+ this._domStorage.removeItem(node.data[0]);
}
}
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/DOMStorageItemsView.js b/src/3rdparty/webkit/WebCore/inspector/front-end/DOMStorageItemsView.js
index 8617d60..a7da370 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/DOMStorageItemsView.js
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/DOMStorageItemsView.js
@@ -61,39 +61,88 @@ WebInspector.DOMStorageItemsView.prototype = {
update: function()
{
this.element.removeChildren();
- var hasDOMStorage = this.domStorage;
- if (hasDOMStorage)
- hasDOMStorage = this.domStorage.domStorage;
-
- if (hasDOMStorage) {
- var dataGrid = WebInspector.panels.storage.dataGridForDOMStorage(this.domStorage.domStorage);
- if (!dataGrid)
- hasDOMStorage = 0;
- else {
- this._dataGrid = dataGrid;
- this.element.appendChild(dataGrid.element);
- this._dataGrid.updateWidths();
- this.deleteButton.visible = true;
- }
- }
+ var callback = this._showDOMStorageEntries.bind(this);
+ this.domStorage.getEntries(callback);
+ },
- if (!hasDOMStorage) {
+ _showDOMStorageEntries: function(entries)
+ {
+ if (entries.length > 0) {
+ this._dataGrid = this._dataGridForDOMStorageEntries(entries);
+ this.element.appendChild(this._dataGrid.element);
+ this._dataGrid.updateWidths();
+ this.deleteButton.visible = true;
+ } else {
var emptyMsgElement = document.createElement("div");
emptyMsgElement.className = "storage-table-empty";
if (this.domStorage)
- emptyMsgElement.textContent = WebInspector.UIString("This storage is empty.");
+ emptyMsgElement.textContent = WebInspector.UIString("This storage is empty.");
this.element.appendChild(emptyMsgElement);
this._dataGrid = null;
this.deleteButton.visible = false;
}
},
-
+
resize: function()
{
if (this._dataGrid)
this._dataGrid.updateWidths();
},
+ _dataGridForDOMStorageEntries: function(entries)
+ {
+ var columns = {};
+ columns[0] = {};
+ columns[1] = {};
+ columns[0].title = WebInspector.UIString("Key");
+ columns[0].width = columns[0].title.length;
+ columns[1].title = WebInspector.UIString("Value");
+ columns[1].width = columns[1].title.length;
+
+ var nodes = [];
+
+ var keys = [];
+ var length = entries.length;
+ for (var i = 0; i < entries.length; i++) {
+ var data = {};
+
+ var key = entries[i][0];
+ data[0] = key;
+ if (key.length > columns[0].width)
+ columns[0].width = key.length;
+
+ var value = entries[i][1];
+ data[1] = value;
+ if (value.length > columns[1].width)
+ columns[1].width = value.length;
+ var node = new WebInspector.DataGridNode(data, false);
+ node.selectable = true;
+ nodes.push(node);
+ keys.push(key);
+ }
+
+ var totalColumnWidths = columns[0].width + columns[1].width;
+ var width = Math.round((columns[0].width * 100) / totalColumnWidths);
+ const minimumPrecent = 10;
+ if (width < minimumPrecent)
+ width = minimumPrecent;
+ if (width > 100 - minimumPrecent)
+ width = 100 - minimumPrecent;
+ columns[0].width = width;
+ columns[1].width = 100 - width;
+ columns[0].width += "%";
+ columns[1].width += "%";
+
+ var dataGrid = new WebInspector.DOMStorageDataGrid(columns, this.domStorage, keys);
+ var length = nodes.length;
+ for (var i = 0; i < length; ++i)
+ dataGrid.appendChild(nodes[i]);
+ dataGrid.addCreationNode(false);
+ if (length > 0)
+ nodes[0].selected = true;
+ return dataGrid;
+ },
+
_deleteButtonClicked: function(event)
{
if (this._dataGrid) {
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/ElementsTreeOutline.js b/src/3rdparty/webkit/WebCore/inspector/front-end/ElementsTreeOutline.js
index 08ba1c2..d8c4d89 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/ElementsTreeOutline.js
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/ElementsTreeOutline.js
@@ -31,7 +31,6 @@
WebInspector.ElementsTreeOutline = function() {
this.element = document.createElement("ol");
this.element.addEventListener("mousedown", this._onmousedown.bind(this), false);
- this.element.addEventListener("dblclick", this._ondblclick.bind(this), false);
this.element.addEventListener("mousemove", this._onmousemove.bind(this), false);
this.element.addEventListener("mouseout", this._onmouseout.bind(this), false);
@@ -186,16 +185,6 @@ WebInspector.ElementsTreeOutline.prototype = {
return element;
},
- _ondblclick: function(event)
- {
- var element = this._treeElementFromEvent(event);
-
- if (!element || !element.ondblclick)
- return;
-
- element.ondblclick(element, event);
- },
-
_onmousedown: function(event)
{
var element = this._treeElementFromEvent(event);
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/ImageView.js b/src/3rdparty/webkit/WebCore/inspector/front-end/ImageView.js
index 001ffdd..96e1a6e 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/ImageView.js
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/ImageView.js
@@ -37,6 +37,7 @@ WebInspector.ImageView = function(resource)
this.contentElement.appendChild(container);
this.imagePreviewElement = document.createElement("img");
+ this.imagePreviewElement.addStyleClass("resource-image-view");
this.imagePreviewElement.setAttribute("src", this.resource.url);
container.appendChild(this.imagePreviewElement);
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/Images/errorRedDot.png b/src/3rdparty/webkit/WebCore/inspector/front-end/Images/errorRedDot.png
new file mode 100644
index 0000000..6f0b164
--- /dev/null
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/Images/errorRedDot.png
Binary files differ
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/Images/successGreenDot.png b/src/3rdparty/webkit/WebCore/inspector/front-end/Images/successGreenDot.png
new file mode 100644
index 0000000..8b9319c
--- /dev/null
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/Images/successGreenDot.png
Binary files differ
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/Images/warningOrangeDot.png b/src/3rdparty/webkit/WebCore/inspector/front-end/Images/warningOrangeDot.png
new file mode 100644
index 0000000..8c8b635
--- /dev/null
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/Images/warningOrangeDot.png
Binary files differ
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/InjectedScript.js b/src/3rdparty/webkit/WebCore/inspector/front-end/InjectedScript.js
index 003e694..726c7cc 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/InjectedScript.js
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/InjectedScript.js
@@ -421,7 +421,7 @@ InjectedScript.getPrototypes = function(nodeId)
var result = [];
for (var prototype = node; prototype; prototype = prototype.__proto__) {
- var title = Object.describe(prototype);
+ var title = Object.describe(prototype, true);
if (title.match(/Prototype$/)) {
title = title.replace(/Prototype$/, "");
}
@@ -498,43 +498,69 @@ InjectedScript.setPropertyValue = function(objectProxy, propertyName, expression
}
}
-InjectedScript.evaluate = function(expression)
+
+InjectedScript.getCompletions = function(expression, includeInspectorCommandLineAPI, callFrameId)
{
- return InjectedScript._evaluateOn(InjectedScript._window().eval, InjectedScript._window(), expression);
+ var props = {};
+ try {
+ var expressionResult;
+ // Evaluate on call frame if call frame id is available.
+ if (typeof callFrameId === "number") {
+ var callFrame = InjectedScript._callFrameForId(callFrameId);
+ if (!callFrame)
+ return props;
+ expressionResult = InjectedScript._evaluateOn(callFrame.evaluate, callFrame, expression);
+ } else {
+ expressionResult = InjectedScript._evaluateOn(InjectedScript._window().eval, InjectedScript._window(), expression);
+ }
+ for (var prop in expressionResult)
+ props[prop] = true;
+ if (includeInspectorCommandLineAPI)
+ for (var prop in InjectedScript._window()._inspectorCommandLineAPI)
+ if (prop.charAt(0) !== '_')
+ props[prop] = true;
+ } catch(e) {
+ }
+ return props;
}
-InjectedScript._evaluateOn = function(evalFunction, object, expression)
+InjectedScript.evaluate = function(expression)
{
- InjectedScript._ensureCommandLineAPIInstalled();
- // Surround the expression in with statements to inject our command line API so that
- // the window object properties still take more precedent than our API functions.
- expression = "with (window._inspectorCommandLineAPI) { with (window) { " + expression + " } }";
+ return InjectedScript._evaluateAndWrap(InjectedScript._window().eval, InjectedScript._window(), expression);
+}
+InjectedScript._evaluateAndWrap = function(evalFunction, object, expression)
+{
var result = {};
try {
- var value = evalFunction.call(object, expression);
- if (value === null)
- return { value: null };
- if (Object.type(value) === "error") {
- result.value = Object.describe(value);
+ result.value = InspectorController.wrapObject(InjectedScript._evaluateOn(evalFunction, object, expression));
+ // Handle error that might have happened while describing result.
+ if (result.value.errorText) {
+ result.value = InspectorController.wrapObject(result.value.errorText);
result.isException = true;
- return result;
- }
-
- var wrapper = InspectorController.wrapObject(value);
- if (typeof wrapper === "object" && wrapper.exception) {
- result.value = wrapper.exception;
- result.isException = true;
- } else {
- result.value = wrapper;
}
} catch (e) {
- result.value = e.toString();
+ result.value = InspectorController.wrapObject(e.toString());
result.isException = true;
}
return result;
}
+InjectedScript._evaluateOn = function(evalFunction, object, expression)
+{
+ InjectedScript._ensureCommandLineAPIInstalled();
+ // Surround the expression in with statements to inject our command line API so that
+ // the window object properties still take more precedent than our API functions.
+ expression = "with (window._inspectorCommandLineAPI) { with (window) { " + expression + " } }";
+ var value = evalFunction.call(object, expression);
+
+ // When evaluating on call frame error is not thrown, but returned as a value.
+ if (Object.type(value) === "error")
+ throw value.toString();
+
+ return value;
+}
+
InjectedScript.addInspectedNode = function(nodeId)
{
var node = InjectedScript._nodeForId(nodeId);
@@ -809,7 +835,7 @@ InjectedScript.evaluateInCallFrame = function(callFrameId, code)
var callFrame = InjectedScript._callFrameForId(callFrameId);
if (!callFrame)
return false;
- return InjectedScript._evaluateOn(callFrame.evaluate, callFrame, code);
+ return InjectedScript._evaluateAndWrap(callFrame.evaluate, callFrame, code);
}
InjectedScript._callFrameForId = function(id)
@@ -950,7 +976,7 @@ InjectedScript.createProxyObject = function(object, objectId, abbreviate)
result.type = Object.type(object);
var type = typeof object;
- if (type === "object" || type === "function") {
+ if ((type === "object" && object !== null) || type === "function") {
for (var subPropertyName in object) {
result.hasChildren = true;
break;
@@ -959,7 +985,7 @@ InjectedScript.createProxyObject = function(object, objectId, abbreviate)
try {
result.description = Object.describe(object, abbreviate);
} catch (e) {
- result.exception = e.toString();
+ result.errorText = e.toString();
}
return result;
}
@@ -982,11 +1008,11 @@ InjectedScript.CallFrameProxy.prototype = {
var scopeChainProxy = [];
for (var i = 0; i < scopeChain.length; ++i) {
var scopeObject = scopeChain[i];
- var scopeObjectProxy = InjectedScript.createProxyObject(scopeObject, { callFrame: this.id, chainIndex: i });
+ var scopeObjectProxy = InjectedScript.createProxyObject(scopeObject, { callFrame: this.id, chainIndex: i }, true);
if (Object.prototype.toString.call(scopeObject) === "[object JSActivation]") {
if (!foundLocalScope)
- scopeObjectProxy.thisObject = InjectedScript.createProxyObject(callFrame.thisObject, { callFrame: this.id, thisObject: true });
+ scopeObjectProxy.thisObject = InjectedScript.createProxyObject(callFrame.thisObject, { callFrame: this.id, thisObject: true }, true);
else
scopeObjectProxy.isClosure = true;
foundLocalScope = true;
@@ -1060,6 +1086,8 @@ Object.describe = function(obj, abbreviated)
case "array":
return "[" + obj.toString() + "]";
case "string":
+ if (!abbreviated)
+ return obj;
if (obj.length > 100)
return "\"" + obj.substring(0, 100) + "\u2026\"";
return "\"" + obj + "\"";
@@ -1072,6 +1100,10 @@ Object.describe = function(obj, abbreviated)
return objectText;
case "regexp":
return String(obj).replace(/([\\\/])/g, "\\$1").replace(/\\(\/[gim]*)$/, "$1").substring(1);
+ case "boolean":
+ case "number":
+ case "null":
+ return obj;
default:
return String(obj);
}
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/InjectedScriptAccess.js b/src/3rdparty/webkit/WebCore/inspector/front-end/InjectedScriptAccess.js
index a5be2d8..da85d03 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/InjectedScriptAccess.js
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/InjectedScriptAccess.js
@@ -63,6 +63,7 @@ InjectedScriptAccess._installHandler("setStyleProperty");
InjectedScriptAccess._installHandler("getPrototypes");
InjectedScriptAccess._installHandler("getProperties");
InjectedScriptAccess._installHandler("setPropertyValue");
+InjectedScriptAccess._installHandler("getCompletions");
InjectedScriptAccess._installHandler("evaluate");
InjectedScriptAccess._installHandler("addInspectedNode");
InjectedScriptAccess._installHandler("pushNodeToFrontend");
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/ObjectProxy.js b/src/3rdparty/webkit/WebCore/inspector/front-end/ObjectProxy.js
index 03d16ab..bb4afa5 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/ObjectProxy.js
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/ObjectProxy.js
@@ -37,6 +37,14 @@ WebInspector.ObjectProxy = function(objectId, path, protoDepth, description, has
this.hasChildren = hasChildren;
}
+WebInspector.ObjectProxy.wrapPrimitiveValue = function(value)
+{
+ var proxy = new WebInspector.ObjectProxy();
+ proxy.type = typeof value;
+ proxy.description = value;
+ return proxy;
+}
+
WebInspector.ObjectPropertyProxy = function(name, value)
{
this.name = name;
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/Resource.js b/src/3rdparty/webkit/WebCore/inspector/front-end/Resource.js
index 4dac093..56696e3 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/Resource.js
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/Resource.js
@@ -45,6 +45,64 @@ WebInspector.Resource = function(requestHeaders, url, domain, path, lastPathComp
this.category = WebInspector.resourceCategories.other;
}
+
+WebInspector.Resource.StatusText = {
+ 100: "Continue",
+ 101: "Switching Protocols",
+ 102: "Processing (WebDav)",
+ 200: "OK",
+ 201: "Created",
+ 202: "Accepted",
+ 203: "Non-Authoritative Information",
+ 204: "No Content",
+ 205: "Reset Content",
+ 206: "Partial Content",
+ 207: "Multi-Status (WebDav)",
+ 300: "Multiple Choices",
+ 301: "Moved Permanently",
+ 302: "Found",
+ 303: "See Other",
+ 304: "Not Modified",
+ 305: "Use Proxy",
+ 306: "Switch Proxy",
+ 307: "Temporary",
+ 400: "Bad Request",
+ 401: "Unauthorized",
+ 402: "Payment Required",
+ 403: "Forbidden",
+ 404: "Not Found",
+ 405: "Method Not Allowed",
+ 406: "Not Acceptable",
+ 407: "Proxy Authentication Required",
+ 408: "Request Timeout",
+ 409: "Conflict",
+ 410: "Gone",
+ 411: "Length Required",
+ 412: "Precondition Failed",
+ 413: "Request Entity Too Large",
+ 414: "Request-URI Too Long",
+ 415: "Unsupported Media Type",
+ 416: "Requested Range Not Satisfiable",
+ 417: "Expectation Failed",
+ 418: "I'm a teapot",
+ 422: "Unprocessable Entity (WebDav)",
+ 423: "Locked (WebDav)",
+ 424: "Failed Dependency (WebDav)",
+ 425: "Unordered Collection",
+ 426: "Upgrade Required",
+ 449: "Retry With",
+ 500: "Internal Server Error",
+ 501: "Not Implemented",
+ 502: "Bad Gateway",
+ 503: "Service Unavailable",
+ 504: "Gateway Timeout",
+ 505: "HTTP Version Not Supported",
+ 506: "Variant Also Negotiates",
+ 507: "Insufficient Storage (WebDav)",
+ 509: "Bandwidth Limit Exceeded",
+ 510: "Not Extended"
+};
+
// Keep these in sync with WebCore::InspectorResource::Type
WebInspector.Resource.Type = {
Document: 0,
@@ -620,3 +678,8 @@ WebInspector.Resource.CompareBySize = function(a, b)
return 1;
return 0;
}
+
+WebInspector.Resource.StatusTextForCode = function(code)
+{
+ return code ? code + " " + WebInspector.Resource.StatusText[code] : "";
+}
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/ResourceView.js b/src/3rdparty/webkit/WebCore/inspector/front-end/ResourceView.js
index d745920..d915055 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/ResourceView.js
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/ResourceView.js
@@ -54,6 +54,11 @@ WebInspector.ResourceView = function(resource)
this.urlTreeElement.selectable = false;
this.headersTreeOutline.appendChild(this.urlTreeElement);
+ this.httpInformationTreeElement = new TreeElement("", null, true);
+ this.httpInformationTreeElement.expanded = false;
+ this.httpInformationTreeElement.selectable = false;
+ this.headersTreeOutline.appendChild(this.httpInformationTreeElement);
+
this.requestHeadersTreeElement = new TreeElement("", null, true);
this.requestHeadersTreeElement.expanded = false;
this.requestHeadersTreeElement.selectable = false;
@@ -90,10 +95,12 @@ WebInspector.ResourceView = function(resource)
resource.addEventListener("url changed", this._refreshURL, this);
resource.addEventListener("requestHeaders changed", this._refreshRequestHeaders, this);
resource.addEventListener("responseHeaders changed", this._refreshResponseHeaders, this);
+ resource.addEventListener("finished", this._refreshHTTPInformation, this);
this._refreshURL();
this._refreshRequestHeaders();
this._refreshResponseHeaders();
+ this._refreshHTTPInformation();
}
WebInspector.ResourceView.prototype = {
@@ -127,7 +134,21 @@ WebInspector.ResourceView.prototype = {
_refreshURL: function()
{
var url = this.resource.url;
- this.urlTreeElement.title = this.resource.requestMethod + " " + url.escapeHTML();
+ var statusCodeImage = "";
+ if (this.resource.statusCode) {
+ var statusImageSource = "";
+
+ if (this.resource.statusCode < 300)
+ statusImageSource = "Images/successGreenDot.png";
+ else if (this.resource.statusCode < 400)
+ statusImageSource = "Images/warningOrangeDot.png";
+ else
+ statusImageSource = "Images/errorRedDot.png";
+
+ statusCodeImage = "<img class=\"resource-status-image\" src=\"" + statusImageSource + "\" title=\"" + WebInspector.Resource.StatusTextForCode(this.resource.statusCode) + "\">";
+ }
+
+ this.urlTreeElement.title = statusCodeImage + "<span class=\"resource-url\">" + url.escapeHTML() + "</span>";
this._refreshQueryString();
},
@@ -240,6 +261,33 @@ WebInspector.ResourceView.prototype = {
this._refreshHeaders(WebInspector.UIString("Response Headers"), this.resource.sortedResponseHeaders, this.responseHeadersTreeElement);
},
+ _refreshHTTPInformation: function()
+ {
+ const listElements = 2;
+
+ var headerElement = this.httpInformationTreeElement;
+ headerElement.removeChildren();
+ headerElement.hidden = !this.resource.statusCode;
+
+ if (this.resource.statusCode) {
+ headerElement.title = WebInspector.UIString("HTTP Information") + "<span class=\"header-count\">" + WebInspector.UIString(" (%d)", listElements) + "</span>";
+
+ var title = "<div class=\"header-name\">" + WebInspector.UIString("Request Method") + ":</div>";
+ title += "<div class=\"header-value\">" + this.resource.requestMethod + "</div>"
+
+ var headerTreeElement = new TreeElement(title, null, false);
+ headerTreeElement.selectable = false;
+ headerElement.appendChild(headerTreeElement);
+
+ title = "<div class=\"header-name\">" + WebInspector.UIString("Status Code") + ":</div>";
+ title += "<div class=\"header-value\">" + WebInspector.Resource.StatusTextForCode(this.resource.statusCode) + "</div>"
+
+ headerTreeElement = new TreeElement(title, null, false);
+ headerTreeElement.selectable = false;
+ headerElement.appendChild(headerTreeElement);
+ }
+ },
+
_refreshHeaders: function(title, headers, headersTreeElement)
{
headersTreeElement.removeChildren();
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/ScriptsPanel.js b/src/3rdparty/webkit/WebCore/inspector/front-end/ScriptsPanel.js
index 04f27bb..ae918d1 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/ScriptsPanel.js
@@ -351,6 +351,14 @@ WebInspector.ScriptsPanel.prototype = {
sourceFrame.removeBreakpoint(breakpoint);
},
+ selectedCallFrameId: function()
+ {
+ var selectedCallFrame = this.sidebarPanes.callstack.selectedCallFrame;
+ if (!selectedCallFrame)
+ return null;
+ return selectedCallFrame.id;
+ },
+
evaluateInSelectedCallFrame: function(code, updateInterface, callback)
{
var selectedCallFrame = this.sidebarPanes.callstack.selectedCallFrame;
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/StoragePanel.js b/src/3rdparty/webkit/WebCore/inspector/front-end/StoragePanel.js
index aed0d06..01c657d 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/StoragePanel.js
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/StoragePanel.js
@@ -93,7 +93,6 @@ WebInspector.StoragePanel.prototype = {
{
WebInspector.Panel.prototype.show.call(this);
this._updateSidebarWidth();
- this._registerStorageEventListener();
},
reset: function()
@@ -110,8 +109,6 @@ WebInspector.StoragePanel.prototype = {
this._databases = [];
- this._unregisterStorageEventListener();
-
if (this._domStorage) {
var domStorageLength = this._domStorage.length;
for (var i = 0; i < domStorageLength; ++i) {
@@ -174,16 +171,12 @@ WebInspector.StoragePanel.prototype = {
}
},
- selectDOMStorage: function(s)
+ selectDOMStorage: function(storageId)
{
- var isLocalStorage = (s === InspectorController.inspectedWindow().localStorage);
- for (var i = 0, len = this._domStorage.length; i < len; ++i) {
- var storage = this._domStorage[i];
- if ( isLocalStorage === storage.isLocalStorage ) {
- this.showDOMStorage(storage);
- storage._domStorageTreeElement.select();
- return;
- }
+ var domStorage = this._domStorageForId(storageId);
+ if (domStorage) {
+ this.showDOMStorage(domStorage);
+ domStorage._domStorageTreeElement.select();
}
},
@@ -383,61 +376,6 @@ WebInspector.StoragePanel.prototype = {
return dataGrid;
},
- dataGridForDOMStorage: function(domStorage)
- {
- if (!domStorage.length)
- return null;
-
- var columns = {};
- columns[0] = {};
- columns[1] = {};
- columns[0].title = WebInspector.UIString("Key");
- columns[0].width = columns[0].title.length;
- columns[1].title = WebInspector.UIString("Value");
- columns[1].width = columns[1].title.length;
-
- var nodes = [];
-
- var length = domStorage.length;
- for (var index = 0; index < domStorage.length; index++) {
- var data = {};
-
- var key = String(domStorage.key(index));
- data[0] = key;
- if (key.length > columns[0].width)
- columns[0].width = key.length;
-
- var value = String(domStorage.getItem(key));
- data[1] = value;
- if (value.length > columns[1].width)
- columns[1].width = value.length;
- var node = new WebInspector.DataGridNode(data, false);
- node.selectable = true;
- nodes.push(node);
- }
-
- var totalColumnWidths = columns[0].width + columns[1].width;
- var width = Math.round((columns[0].width * 100) / totalColumnWidths);
- const minimumPrecent = 10;
- if (width < minimumPrecent)
- width = minimumPrecent;
- if (width > 100 - minimumPrecent)
- width = 100 - minimumPrecent;
- columns[0].width = width;
- columns[1].width = 100 - width;
- columns[0].width += "%";
- columns[1].width += "%";
-
- var dataGrid = new WebInspector.DOMStorageDataGrid(columns);
- var length = nodes.length;
- for (var i = 0; i < length; ++i)
- dataGrid.appendChild(nodes[i]);
- dataGrid.addCreationNode(false);
- if (length > 0)
- nodes[0].selected = true;
- return dataGrid;
- },
-
resize: function()
{
var visibleView = this.visibleView;
@@ -445,44 +383,28 @@ WebInspector.StoragePanel.prototype = {
visibleView.resize();
},
- _registerStorageEventListener: function()
+ updateDOMStorage: function(storageId)
{
- var inspectedWindow = InspectorController.inspectedWindow();
- if (!inspectedWindow || !inspectedWindow.document)
- return;
-
- this._storageEventListener = InspectorController.wrapCallback(this._storageEvent.bind(this));
- inspectedWindow.addEventListener("storage", this._storageEventListener, true);
- },
-
- _unregisterStorageEventListener: function()
- {
- if (!this._storageEventListener)
- return;
-
- var inspectedWindow = InspectorController.inspectedWindow();
- if (!inspectedWindow || !inspectedWindow.document)
+ var domStorage = this._domStorageForId(storageId);
+ if (!domStorage)
return;
- inspectedWindow.removeEventListener("storage", this._storageEventListener, true);
- delete this._storageEventListener;
+ var view = domStorage._domStorageView;
+ if (this.visibleView && view === this.visibleView)
+ domStorage._domStorageView.update();
},
- _storageEvent: function(event)
+ _domStorageForId: function(storageId)
{
if (!this._domStorage)
- return;
-
- var isLocalStorage = (event.storageArea === InspectorController.inspectedWindow().localStorage);
+ return null;
var domStorageLength = this._domStorage.length;
for (var i = 0; i < domStorageLength; ++i) {
var domStorage = this._domStorage[i];
- if (isLocalStorage === domStorage.isLocalStorage) {
- var view = domStorage._domStorageView;
- if (this.visibleView && view === this.visibleView)
- domStorage._domStorageView.update();
- }
+ if (domStorage.id == storageId)
+ return domStorage;
}
+ return null;
},
_startSidebarDragging: function(event)
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.css b/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.css
index ea6f661..2ae4aac 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.css
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.css
@@ -94,6 +94,10 @@ body.attached #toolbar {
padding-left: 0;
}
+body.attached.platform-qt #toolbar {
+ cursor: auto;
+}
+
body.attached.inactive #toolbar {
border-top: 1px solid rgb(64%, 64%, 64%);
}
@@ -229,6 +233,10 @@ body.detached .toolbar-item.close {
display: none;
}
+body.attached.platform-qt .toolbar-item.close {
+ display: none;
+}
+
#main {
position: absolute;
z-index: 1;
@@ -372,6 +380,10 @@ body.detached #dock-status-bar-item .glyph {
-webkit-mask-image: url(Images/dockButtonGlyph.png);
}
+body.platform-qt #dock-status-bar-item {
+ display: none
+}
+
#console-status-bar-item .glyph {
-webkit-mask-image: url(Images/consoleButtonGlyph.png);
}
@@ -842,7 +854,7 @@ body.drawer-visible #drawer {
-webkit-user-select: text;
}
-.resource-view.image img {
+.resource-view.image img.resource-image-view {
max-width: 100%;
max-height: 1000px;
background-image: url(Images/checker.png);
@@ -851,6 +863,14 @@ body.drawer-visible #drawer {
-webkit-user-drag: auto;
}
+.resource-url {
+ vertical-align: middle;
+}
+
+.resource-status-image {
+ vertical-align: middle;
+}
+
.resource-view.image .title {
text-align: center;
font-size: 13px;
@@ -2327,6 +2347,15 @@ button.enable-toggle-status-bar-item.toggled-on .glyph {
text-shadow: rgba(255, 255, 255, 0.5) 1px 1px 0;
}
+#console-filter div.divider {
+ margin-left: 5px;
+ margin-right: 5px;
+ /* Only want a border-left here because border on both sides
+ made the divider too thick */
+ border-left: 1px solid gray;
+ display: inline;
+}
+
#resources-filter li.selected, #resources-filter li:hover, #resources-filter li:active,
#console-filter li.selected, #console-filter li:hover, #console-filter li:active {
color: white;
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.js b/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.js
index 902dd94..921bb7a 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.js
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.js
@@ -784,7 +784,7 @@ WebInspector.toggleAttach = function()
WebInspector.toolbarDragStart = function(event)
{
- if (!WebInspector.attached && InspectorController.platform() !== "mac-leopard")
+ if ((!WebInspector.attached && InspectorController.platform() !== "mac-leopard") || InspectorController.platform() == "qt")
return;
var target = event.target;
@@ -1016,12 +1016,17 @@ WebInspector.addDatabase = function(payload)
WebInspector.addDOMStorage = function(payload)
{
var domStorage = new WebInspector.DOMStorage(
- payload.domStorage,
+ payload.id,
payload.host,
payload.isLocalStorage);
this.panels.storage.addDOMStorage(domStorage);
}
+WebInspector.updateDOMStorage = function(storageId)
+{
+ this.panels.storage.updateDOMStorage(storageId);
+}
+
WebInspector.resourceTrackingWasEnabled = function()
{
this.panels.resources.resourceTrackingWasEnabled();
@@ -1128,16 +1133,86 @@ WebInspector.addMessageToConsole = function(payload)
WebInspector.log = function(message)
{
- var msg = new WebInspector.ConsoleMessage(
- WebInspector.ConsoleMessage.MessageSource.Other,
- WebInspector.ConsoleMessage.MessageType.Log,
- WebInspector.ConsoleMessage.MessageLevel.Debug,
- -1,
- null,
- null,
- 1,
- message);
- this.console.addMessage(msg);
+ // remember 'this' for setInterval() callback
+ var self = this;
+
+ // return indication if we can actually log a message
+ function isLogAvailable()
+ {
+ return WebInspector.ConsoleMessage && WebInspector.ObjectProxy && self.console;
+ }
+
+ // flush the queue of pending messages
+ function flushQueue()
+ {
+ var queued = WebInspector.log.queued;
+ if (!queued)
+ return;
+
+ for (var i = 0; i < queued.length; ++i)
+ logMessage(queued[i]);
+
+ delete WebInspector.log.queued;
+ }
+
+ // flush the queue if it console is available
+ // - this function is run on an interval
+ function flushQueueIfAvailable()
+ {
+ if (!isLogAvailable())
+ return;
+
+ clearInterval(WebInspector.log.interval);
+ delete WebInspector.log.interval;
+
+ flushQueue();
+ }
+
+ // actually log the message
+ function logMessage(message)
+ {
+ var repeatCount = 1;
+ if (message == WebInspector.log.lastMessage)
+ repeatCount = WebInspector.log.repeatCount + 1;
+
+ WebInspector.log.lastMessage = message;
+ WebInspector.log.repeatCount = repeatCount;
+
+ // ConsoleMessage expects a proxy object
+ message = new WebInspector.ObjectProxy(null, [], 0, message, false);
+
+ // post the message
+ var msg = new WebInspector.ConsoleMessage(
+ WebInspector.ConsoleMessage.MessageSource.Other,
+ WebInspector.ConsoleMessage.MessageType.Log,
+ WebInspector.ConsoleMessage.MessageLevel.Debug,
+ -1,
+ null,
+ null,
+ repeatCount,
+ message);
+
+ self.console.addMessage(msg);
+ }
+
+ // if we can't log the message, queue it
+ if (!isLogAvailable()) {
+ if (!WebInspector.log.queued)
+ WebInspector.log.queued = [];
+
+ WebInspector.log.queued.push(message);
+
+ if (!WebInspector.log.interval)
+ WebInspector.log.interval = setInterval(flushQueueIfAvailable, 1000);
+
+ return;
+ }
+
+ // flush the pending queue if any
+ flushQueue();
+
+ // log the message
+ logMessage(message);
}
WebInspector.addProfile = function(profile)
diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/utilities.js b/src/3rdparty/webkit/WebCore/inspector/front-end/utilities.js
index e831abd..e83c7c0 100644
--- a/src/3rdparty/webkit/WebCore/inspector/front-end/utilities.js
+++ b/src/3rdparty/webkit/WebCore/inspector/front-end/utilities.js
@@ -814,12 +814,16 @@ String.tokenizeFormatString = function(format)
String.standardFormatters = {
d: function(substitution)
{
+ if (typeof substitution == "object" && Object.proxyType(substitution) === "number")
+ substitution = substitution.description;
substitution = parseInt(substitution);
return !isNaN(substitution) ? substitution : 0;
},
f: function(substitution, token)
{
+ if (typeof substitution == "object" && Object.proxyType(substitution) === "number")
+ substitution = substitution.description;
substitution = parseFloat(substitution);
if (substitution && token.precision > -1)
substitution = substitution.toFixed(token.precision);
@@ -828,6 +832,8 @@ String.standardFormatters = {
s: function(substitution)
{
+ if (typeof substitution == "object" && Object.proxyType(substitution) !== "null")
+ substitution = substitution.description;
return substitution;
},
};