Diff
Modified: trunk/LayoutTests/ChangeLog (92670 => 92671)
--- trunk/LayoutTests/ChangeLog 2011-08-09 09:05:16 UTC (rev 92670)
+++ trunk/LayoutTests/ChangeLog 2011-08-09 10:26:02 UTC (rev 92671)
@@ -1,3 +1,16 @@
+2011-08-09 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r92670.
+ http://trac.webkit.org/changeset/92670
+ https://bugs.webkit.org/show_bug.cgi?id=65905
+
+ It broke 3 inspector tests (Requested by Ossy on #webkit).
+
+ * inspector/protocol/runtime-agent-expected.txt:
+ * inspector/runtime/runtime-getProperties-expected.txt:
+ * inspector/runtime/runtime-getProperties.html:
+ * platform/chromium/inspector/runtime/runtime-getProperties-expected.txt: Added.
+
2011-08-09 Pavel Feldman <[email protected]>
Web Inspector: there should be a way to tell what properties are non-enumerable when expanding objects.
Modified: trunk/LayoutTests/inspector/protocol/runtime-agent-expected.txt (92670 => 92671)
--- trunk/LayoutTests/inspector/protocol/runtime-agent-expected.txt 2011-08-09 09:05:16 UTC (rev 92670)
+++ trunk/LayoutTests/inspector/protocol/runtime-agent-expected.txt 2011-08-09 10:26:02 UTC (rev 92671)
@@ -167,7 +167,7 @@
method : "Runtime.getProperties"
params : {
objectId : <string>
- ownProperties : false
+ ignoreHasOwnProperty : false
}
id : <number>
}
@@ -177,27 +177,30 @@
result : {
result : [
{
+ name : "assignedByCallFunctionOn"
value : {
type : "string"
value : "callFunctionOn function works fine"
}
- writable : true
- enumerable : true
- configurable : true
- name : "assignedByCallFunctionOn"
}
{
+ name : "self"
value : {
type : "object"
objectId : <string>
className : <string>
description : "TestObject"
}
- writable : true
- enumerable : true
- configurable : true
- name : "self"
}
+ {
+ name : "__proto__"
+ value : {
+ type : "object"
+ objectId : <string>
+ className : <string>
+ description : "TestObject"
+ }
+ }
]
}
id : <number>
Modified: trunk/LayoutTests/inspector/runtime/runtime-getProperties-expected.txt (92670 => 92671)
--- trunk/LayoutTests/inspector/runtime/runtime-getProperties-expected.txt 2011-08-09 09:05:16 UTC (rev 92670)
+++ trunk/LayoutTests/inspector/runtime/runtime-getProperties-expected.txt 2011-08-09 10:26:02 UTC (rev 92671)
@@ -9,20 +9,14 @@
value : {
type : "function"
description : "function () { return 1; }"
- objectId : <string>
}
- enumerable : true
- writable : false
}
{
name : "set foo"
value : {
type : "function"
description : "function (value) { }"
- objectId : <string>
}
- enumerable : true
- writable : false
}
Running: testGetterOnly
@@ -31,9 +25,6 @@
value : {
type : "function"
description : "function () { return 1; }"
- objectId : <string>
}
- enumerable : true
- writable : false
}
Modified: trunk/LayoutTests/inspector/runtime/runtime-getProperties.html (92670 => 92671)
--- trunk/LayoutTests/inspector/runtime/runtime-getProperties.html 2011-08-09 09:05:16 UTC (rev 92670)
+++ trunk/LayoutTests/inspector/runtime/runtime-getProperties.html 2011-08-09 10:26:02 UTC (rev 92671)
@@ -65,10 +65,13 @@
if (property.name === "__proto__")
return;
- var value = property.value;
- if (value)
- property.value = { type: value.type, description: value.description.replace("function foo", "function "), objectId: value.objectId };
- InspectorTest.dump(property, { objectId: true });
+ var propertyObj = {};
+ propertyObj.name = property.name;
+ propertyObj.value = {};
+ propertyObj.value.type = property.value.type;
+ propertyObj.value.description = property.value.description;
+
+ InspectorTest.dump(propertyObj);
}
}
Added: trunk/LayoutTests/platform/chromium/inspector/runtime/runtime-getProperties-expected.txt (0 => 92671)
--- trunk/LayoutTests/platform/chromium/inspector/runtime/runtime-getProperties-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/chromium/inspector/runtime/runtime-getProperties-expected.txt 2011-08-09 10:26:02 UTC (rev 92671)
@@ -0,0 +1,30 @@
+Tests RemoteObject.getProperties.
+
+
+Running: testSetUp
+
+Running: testGetterAndSetter
+{
+ name : "get foo"
+ value : {
+ type : "function"
+ description : "function foo() { return 1; }"
+ }
+}
+{
+ name : "set foo"
+ value : {
+ type : "function"
+ description : "function foo(value) { }"
+ }
+}
+
+Running: testGetterOnly
+{
+ name : "get foo"
+ value : {
+ type : "function"
+ description : "function foo() { return 1; }"
+ }
+}
+
Modified: trunk/Source/WebCore/ChangeLog (92670 => 92671)
--- trunk/Source/WebCore/ChangeLog 2011-08-09 09:05:16 UTC (rev 92670)
+++ trunk/Source/WebCore/ChangeLog 2011-08-09 10:26:02 UTC (rev 92671)
@@ -1,3 +1,32 @@
+2011-08-09 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r92670.
+ http://trac.webkit.org/changeset/92670
+ https://bugs.webkit.org/show_bug.cgi?id=65905
+
+ It broke 3 inspector tests (Requested by Ossy on #webkit).
+
+ * inspector/InjectedScript.cpp:
+ (WebCore::InjectedScript::getProperties):
+ * inspector/InjectedScript.h:
+ * inspector/InjectedScriptSource.js:
+ (.):
+ * inspector/Inspector.json:
+ * inspector/InspectorRuntimeAgent.cpp:
+ (WebCore::InspectorRuntimeAgent::getProperties):
+ * inspector/InspectorRuntimeAgent.h:
+ * inspector/front-end/ObjectPropertiesSection.js:
+ (WebInspector.ObjectPropertyTreeElement.prototype.ondblclick):
+ (WebInspector.ObjectPropertyTreeElement.prototype.update):
+ * inspector/front-end/RemoteObject.js:
+ (WebInspector.RemoteObject.prototype.getOwnProperties):
+ (WebInspector.RemoteObject.prototype.getAllProperties):
+ (WebInspector.RemoteObject.prototype._getProperties.remoteObjectBinder):
+ (WebInspector.RemoteObject.prototype._getProperties):
+ (WebInspector.RemoteObjectProperty):
+ * inspector/front-end/inspector.css:
+ (.section .properties .value.dimmed):
+
2011-08-09 Pavel Feldman <[email protected]>
Web Inspector: there should be a way to tell what properties are non-enumerable when expanding objects.
Modified: trunk/Source/WebCore/inspector/InjectedScript.cpp (92670 => 92671)
--- trunk/Source/WebCore/inspector/InjectedScript.cpp 2011-08-09 09:05:16 UTC (rev 92670)
+++ trunk/Source/WebCore/inspector/InjectedScript.cpp 2011-08-09 10:26:02 UTC (rev 92671)
@@ -85,11 +85,11 @@
makeEvalCall(errorString, function, result, wasThrown);
}
-void InjectedScript::getProperties(ErrorString* errorString, const String& objectId, bool ownProperties, RefPtr<InspectorArray>* properties)
+void InjectedScript::getProperties(ErrorString* errorString, const String& objectId, bool ignoreHasOwnProperty, RefPtr<InspectorArray>* properties)
{
ScriptFunctionCall function(m_injectedScriptObject, "getProperties");
function.appendArgument(objectId);
- function.appendArgument(ownProperties);
+ function.appendArgument(ignoreHasOwnProperty);
RefPtr<InspectorValue> result;
makeCall(function, &result);
Modified: trunk/Source/WebCore/inspector/InjectedScript.h (92670 => 92671)
--- trunk/Source/WebCore/inspector/InjectedScript.h 2011-08-09 09:05:16 UTC (rev 92670)
+++ trunk/Source/WebCore/inspector/InjectedScript.h 2011-08-09 10:26:02 UTC (rev 92671)
@@ -70,7 +70,7 @@
RefPtr<InspectorObject>* result,
bool* wasThrown);
void evaluateOnCallFrame(ErrorString*, const ScriptValue& callFrames, const String& callFrameId, const String& _expression_, const String& objectGroup, bool includeCommandLineAPI, RefPtr<InspectorObject>* result, bool* wasThrown);
- void getProperties(ErrorString*, const String& objectId, bool ownProperties, RefPtr<InspectorArray>* result);
+ void getProperties(ErrorString*, const String& objectId, bool ignoreHasOwnProperty, RefPtr<InspectorArray>* result);
Node* nodeForObjectId(const String& objectId);
void releaseObject(const String& objectId);
Modified: trunk/Source/WebCore/inspector/InjectedScriptSource.js (92670 => 92671)
--- trunk/Source/WebCore/inspector/InjectedScriptSource.js 2011-08-09 09:05:16 UTC (rev 92670)
+++ trunk/Source/WebCore/inspector/InjectedScriptSource.js 2011-08-09 10:26:02 UTC (rev 92671)
@@ -1,4 +1,4 @@
- /*
+/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -165,7 +165,7 @@
return result;
},
- getProperties: function(objectId, ownProperties)
+ getProperties: function(objectId, ignoreHasOwnProperty)
{
var parsedObjectId = this._parseObjectId(objectId);
var object = this._objectForId(parsedObjectId);
@@ -173,20 +173,46 @@
if (!this._isDefined(object))
return false;
- var descriptors = [];
- this._populatePropertyDescriptors(object, descriptors, ownProperties);
+ var properties = [];
- // Go over properties, wrap object values.
- for (var i = 0; i < descriptors.length; ++i) {
- var descriptor = descriptors[i];
- if (descriptor.get)
- descriptor.get = this._wrapObject(descriptor.get, objectGroupName);
- if (descriptor.set)
- descriptor.set = this._wrapObject(descriptor.set, objectGroupName);
- if ("value" in descriptor)
- descriptor.value = this._wrapObject(descriptor.value, objectGroupName);
+ var propertyNames = ignoreHasOwnProperty ? this._getPropertyNames(object) : Object.getOwnPropertyNames(object);
+ if (!ignoreHasOwnProperty && object.__proto__)
+ propertyNames.push("__proto__");
+
+ // Go over properties, prepare results.
+ for (var i = 0; i < propertyNames.length; ++i) {
+ var propertyName = propertyNames[i];
+
+ var getter = (typeof object["__lookupGetter__"] === "function") && object.__lookupGetter__(propertyName);
+ var setter = (typeof object["__lookupSetter__"] === "function") && object.__lookupSetter__(propertyName);
+ if (getter || setter) {
+ if (getter) {
+ var property = {};
+ property.name = "get " + propertyName;
+ property.value = this._wrapObject(getter, objectGroupName);
+ properties.push(property);
+ }
+ if (setter) {
+ var property = {};
+ property.name = "set " + propertyName;
+ property.value = this._wrapObject(setter, objectGroupName);
+ properties.push(property);
+ }
+ } else {
+ var property = {};
+ property.name = propertyName;
+ var value;
+ try {
+ value = object[propertyName];
+ } catch(e) {
+ var value = e;
+ property.wasThrown = true;
+ }
+ property.value = this._wrapObject(value, objectGroupName);
+ properties.push(property);
+ }
}
- return descriptors;
+ return properties;
},
releaseObject: function(objectId)
@@ -201,39 +227,25 @@
delete this._idToObjectGroupName[id];
},
- _populatePropertyDescriptors: function(object, descriptors, ownProperties)
+ _populatePropertyNames: function(object, resultSet)
{
- var nameProcessed = {};
- nameProcessed.__proto__ = null;
- for (var o = object; this._isDefined(o); o = o.__proto__) {
- var names = Object.getOwnPropertyNames(o);
- for (var i = 0; i < names.length; ++i) {
- var name = names[i];
- if (nameProcessed[name])
- continue;
-
- try {
- nameProcessed[name] = true;
- var descriptor = Object.getOwnPropertyDescriptor(object, name);
- if (!descriptor)
- continue;
- } catch (e) {
- var descriptor = {};
- descriptor.value = e;
- descriptor.wasThrown = true;
- }
-
- descriptor.name = name;
- descriptors.push(descriptor);
+ for (var o = object; o; o = o.__proto__) {
+ try {
+ var names = Object.getOwnPropertyNames(o);
+ for (var i = 0; i < names.length; ++i)
+ resultSet[names[i]] = true;
+ } catch (e) {
}
- if (ownProperties) {
- if (object.__proto__)
- descriptors.push({ name: "__proto__", value: object.__proto__, writable: true, configurable: true, enumerable: false});
- break;
- }
}
},
+ _getPropertyNames: function(object, resultSet)
+ {
+ var propertyNameSet = {};
+ this._populatePropertyNames(object, propertyNameSet);
+ return Object.keys(propertyNameSet);
+ },
+
evaluate: function(_expression_, objectGroup, injectCommandLineAPI, returnByValue)
{
return this._evaluateAndWrap(InjectedScriptHost.evaluate, InjectedScriptHost, _expression_, objectGroup, false, injectCommandLineAPI, returnByValue);
Modified: trunk/Source/WebCore/inspector/Inspector.json (92670 => 92671)
--- trunk/Source/WebCore/inspector/Inspector.json 2011-08-09 09:05:16 UTC (rev 92670)
+++ trunk/Source/WebCore/inspector/Inspector.json 2011-08-09 10:26:02 UTC (rev 92671)
@@ -236,16 +236,13 @@
]
},
{
- "id": "PropertyDescriptor",
+ "id": "RemoteProperty",
"type": "object",
- "description": "Object property descriptor.",
+ "description": "Mirror object property.",
"properties": [
- { "name": "value", "$ref": "RemoteObject", "description": "The value associated with the property." },
- { "name": "writable", "type": "boolean", "description": "True iff the value associated with the property may be changed (data descriptors only)." },
- { "name": "get", "$ref": "RemoteObject", "description": "A function which serves as a getter for the property, or <code>undefined</code> if there is no getter (accessor descriptors only)." },
- { "name": "set", "$ref": "RemoteObject", "description": "A function which serves as a setter for the property, or <code>undefined</code> if there is no setter (accessor descriptors only)." },
- { "name": "configurable", "type": "boolean", "description": "True iff the type of this property descriptor may be changed and if the property may be deleted from the corresponding object." },
- { "name": "enumerable", "type": "boolean", "description": "True iff this property shows up during enumeration of the properties on the corresponding object." }
+ { "name": "name", "type": "string", "description": "Property name." },
+ { "name": "value", "$ref": "RemoteObject", "description": "Property value." },
+ { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if exception was thrown on attempt to get the property value, in that case the value propery will contain thrown value." }
]
},
{
@@ -293,10 +290,10 @@
"name": "getProperties",
"parameters": [
{ "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to return properties for." },
- { "name": "ownProperties", "optional": true, "type": "boolean", "description": "If true, returns properties belonging only to the element itself, not to its prototype chain." }
+ { "name": "ignoreHasOwnProperty", "type": "boolean", "description": "If true, returns properties belonging to any element of the prototype chain." }
],
"returns": [
- { "name": "result", "type": "array", "items": { "$ref": "PropertyDescriptor"}, "description": "Object properties." }
+ { "name": "result", "type": "array", "items": { "$ref": "RemoteProperty"}, "description": "Object properties." }
],
"description": "Returns properties of a given object."
},
Modified: trunk/Source/WebCore/inspector/InspectorRuntimeAgent.cpp (92670 => 92671)
--- trunk/Source/WebCore/inspector/InspectorRuntimeAgent.cpp 2011-08-09 09:05:16 UTC (rev 92670)
+++ trunk/Source/WebCore/inspector/InspectorRuntimeAgent.cpp 2011-08-09 10:26:02 UTC (rev 92671)
@@ -109,14 +109,14 @@
injectedScript.callFunctionOn(errorString, objectId, _expression_, arguments, asBool(returnByValue), result, wasThrown);
}
-void InspectorRuntimeAgent::getProperties(ErrorString* errorString, const String& objectId, const bool* const ownProperties, RefPtr<InspectorArray>* result)
+void InspectorRuntimeAgent::getProperties(ErrorString* errorString, const String& objectId, bool ignoreHasOwnProperty, RefPtr<InspectorArray>* result)
{
InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
if (injectedScript.hasNoValue()) {
*errorString = "Inspected frame has gone";
return;
}
- injectedScript.getProperties(errorString, objectId, ownProperties ? *ownProperties : false, result);
+ injectedScript.getProperties(errorString, objectId, ignoreHasOwnProperty, result);
}
void InspectorRuntimeAgent::releaseObject(ErrorString*, const String& objectId)
Modified: trunk/Source/WebCore/inspector/InspectorRuntimeAgent.h (92670 => 92671)
--- trunk/Source/WebCore/inspector/InspectorRuntimeAgent.h 2011-08-09 09:05:16 UTC (rev 92670)
+++ trunk/Source/WebCore/inspector/InspectorRuntimeAgent.h 2011-08-09 10:26:02 UTC (rev 92671)
@@ -70,7 +70,7 @@
RefPtr<InspectorObject>* result,
bool* wasThrown);
void releaseObject(ErrorString*, const String& objectId);
- void getProperties(ErrorString*, const String& objectId, const bool* const ownProperties, RefPtr<InspectorArray>* result);
+ void getProperties(ErrorString*, const String& objectId, bool ignoreHasOwnProperty, RefPtr<InspectorArray>* result);
void releaseObjectGroup(ErrorString*, const String& objectGroup);
#if ENABLE(_javascript__DEBUGGER)
Modified: trunk/Source/WebCore/inspector/front-end/ObjectPropertiesSection.js (92670 => 92671)
--- trunk/Source/WebCore/inspector/front-end/ObjectPropertiesSection.js 2011-08-09 09:05:16 UTC (rev 92670)
+++ trunk/Source/WebCore/inspector/front-end/ObjectPropertiesSection.js 2011-08-09 10:26:02 UTC (rev 92671)
@@ -166,8 +166,7 @@
ondblclick: function(event)
{
- if (this.property.writable)
- this.startEditing();
+ this.startEditing();
},
onattach: function()
@@ -180,8 +179,6 @@
this.nameElement = document.createElement("span");
this.nameElement.className = "name";
this.nameElement.textContent = this.property.name;
- if (!this.property.enumerable)
- this.nameElement.addStyleClass("dimmed");
var separatorElement = document.createElement("span");
separatorElement.className = "separator";
Modified: trunk/Source/WebCore/inspector/front-end/RemoteObject.js (92670 => 92671)
--- trunk/Source/WebCore/inspector/front-end/RemoteObject.js 2011-08-09 09:05:16 UTC (rev 92670)
+++ trunk/Source/WebCore/inspector/front-end/RemoteObject.js 2011-08-09 10:26:02 UTC (rev 92671)
@@ -116,15 +116,15 @@
getOwnProperties: function(callback)
{
- this._getProperties(true, callback);
+ this._getProperties(false, callback);
},
getAllProperties: function(callback)
{
- this._getProperties(false, callback);
+ this._getProperties(true, callback);
},
- _getProperties: function(ownProperties, callback)
+ _getProperties: function(ignoreHasOwnProperty, callback)
{
if (!this._objectId) {
callback([]);
@@ -136,20 +136,11 @@
callback(null);
return;
}
- var result = [];
- for (var i = 0; properties && i < properties.length; ++i) {
- var property = properties[i];
- if (property.get || property.set) {
- if (property.get)
- result.push(new WebInspector.RemoteObjectProperty("get " + property.name, WebInspector.RemoteObject.fromPayload(property.get), property));
- if (property.set)
- result.push(new WebInspector.RemoteObjectProperty("set " + property.name, WebInspector.RemoteObject.fromPayload(property.set), property));
- } else
- result.push(new WebInspector.RemoteObjectProperty(property.name, WebInspector.RemoteObject.fromPayload(property.value), property));
- }
- callback(result);
+ for (var i = 0; properties && i < properties.length; ++i)
+ properties[i].value = WebInspector.RemoteObject.fromPayload(properties[i].value);
+ callback(properties);
}
- RuntimeAgent.getProperties(this._objectId, ownProperties, remoteObjectBinder);
+ RuntimeAgent.getProperties(this._objectId, !!ignoreHasOwnProperty, remoteObjectBinder);
},
setPropertyValue: function(name, value, callback)
@@ -222,14 +213,10 @@
}
}
-WebInspector.RemoteObjectProperty = function(name, value, descriptor)
+WebInspector.RemoteObjectProperty = function(name, value)
{
this.name = name;
this.value = value;
- this.enumerable = descriptor ? !!descriptor.enumerable : true;
- this.writable = descriptor ? !!descriptor.writable : true;
- if (descriptor && descriptor.wasThrown)
- this.wasThrown = true;
}
WebInspector.RemoteObjectProperty.fromPrimitiveValue = function(name, value)
Modified: trunk/Source/WebCore/inspector/front-end/inspector.css (92670 => 92671)
--- trunk/Source/WebCore/inspector/front-end/inspector.css 2011-08-09 09:05:16 UTC (rev 92670)
+++ trunk/Source/WebCore/inspector/front-end/inspector.css 2011-08-09 10:26:02 UTC (rev 92671)
@@ -1634,8 +1634,8 @@
color: rgb(136, 19, 145);
}
-.section .properties .dimmed {
- opacity: 0.6;
+.section .properties .value.dimmed {
+ color: rgb(100, 100, 100);
}
.section .properties .value.error {