| Index: Source/WebCore/inspector/InjectedScriptSource.js
|
| ===================================================================
|
| --- Source/WebCore/inspector/InjectedScriptSource.js (revision 136041)
|
| +++ Source/WebCore/inspector/InjectedScriptSource.js (working copy)
|
| @@ -712,7 +712,9 @@
|
| var description = obj.nodeName.toLowerCase();
|
| switch (obj.nodeType) {
|
| case 1 /* Node.ELEMENT_NODE */:
|
| - description = "<" + description + ">";
|
| + description += obj.id ? "#" + obj.id : "";
|
| + var className = obj.className;
|
| + description += className ? "." + className : "";
|
| break;
|
| case 10 /*Node.DOCUMENT_TYPE_NODE */:
|
| description = "<!DOCTYPE " + description + ">";
|
| @@ -809,22 +811,25 @@
|
| this.preview.properties = [];
|
|
|
| var isArray = this.subtype === "array";
|
| - var elementsToDump = isArray ? 100 : 5;
|
| + var propertiesThreshold = {
|
| + properties: 5,
|
| + indexes: 100
|
| + };
|
|
|
| for (var o = object; injectedScript._isDefined(o); o = o.__proto__)
|
| - this._generateProtoPreview(o, elementsToDump);
|
| + this._generateProtoPreview(o, propertiesThreshold);
|
| },
|
|
|
| /**
|
| * @param {Object} object
|
| - * @param {number} elementsToDump
|
| + * @param {Object} propertiesThreshold
|
| */
|
| - _generateProtoPreview: function(object, elementsToDump)
|
| + _generateProtoPreview: function(object, propertiesThreshold)
|
| {
|
| var propertyNames = Object.keys(/** @type {!Object} */(object));
|
| try {
|
| for (var i = 0; i < propertyNames.length; ++i) {
|
| - if (this.preview.properties.length >= elementsToDump) {
|
| + if (!propertiesThreshold.properties || !propertiesThreshold.indexes) {
|
| this.preview.overflow = true;
|
| this.preview.lossless = false;
|
| break;
|
| @@ -841,7 +846,7 @@
|
|
|
| var value = descriptor.value;
|
| if (value === null) {
|
| - this.preview.properties.push({ name: name, type: "object", value: "null" });
|
| + this._appendPropertyPreview({ name: name, type: "object", value: "null" }, propertiesThreshold);
|
| continue;
|
| }
|
|
|
| @@ -856,7 +861,7 @@
|
| }
|
| value = "\"" + value.replace(/\n/g, "\u21B5") + "\"";
|
| }
|
| - this.preview.properties.push({ name: name, type: type, value: value + "" });
|
| + this._appendPropertyPreview({ name: name, type: type, value: value + "" }, propertiesThreshold);
|
| continue;
|
| }
|
|
|
| @@ -870,13 +875,26 @@
|
| var property = { name: name, type: type, value: description };
|
| if (subtype)
|
| property.subtype = subtype;
|
| - this.preview.properties.push(property);
|
| + this._appendPropertyPreview(property, propertiesThreshold);
|
| }
|
| } catch (e) {
|
| }
|
| },
|
|
|
| /**
|
| + * @param {Object} property
|
| + * @param {Object} propertiesThreshold
|
| + */
|
| + _appendPropertyPreview: function(property, propertiesThreshold)
|
| + {
|
| + if (isNaN(property.name))
|
| + propertiesThreshold.properties--;
|
| + else
|
| + propertiesThreshold.indexes--;
|
| + this.preview.properties.push(property);
|
| + },
|
| +
|
| + /**
|
| * @param {string} string
|
| * @param {number} maxLength
|
| * @param {boolean=} middle
|
|
|