Changeset 92671 in webkit
- Timestamp:
- Aug 9, 2011 3:26:02 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r92670 r92671 1 2011-08-09 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r92670. 4 http://trac.webkit.org/changeset/92670 5 https://bugs.webkit.org/show_bug.cgi?id=65905 6 7 It broke 3 inspector tests (Requested by Ossy on #webkit). 8 9 * inspector/protocol/runtime-agent-expected.txt: 10 * inspector/runtime/runtime-getProperties-expected.txt: 11 * inspector/runtime/runtime-getProperties.html: 12 * platform/chromium/inspector/runtime/runtime-getProperties-expected.txt: Added. 13 1 14 2011-08-09 Pavel Feldman <pfeldman@google.com> 2 15 -
trunk/LayoutTests/inspector/protocol/runtime-agent-expected.txt
r92670 r92671 168 168 params : { 169 169 objectId : <string> 170 ownProperties: false170 ignoreHasOwnProperty : false 171 171 } 172 172 id : <number> … … 178 178 result : [ 179 179 { 180 name : "assignedByCallFunctionOn" 180 181 value : { 181 182 type : "string" 182 183 value : "callFunctionOn function works fine" 183 184 } 184 writable : true185 enumerable : true186 configurable : true187 name : "assignedByCallFunctionOn"188 185 } 189 186 { 187 name : "self" 190 188 value : { 191 189 type : "object" … … 194 192 description : "TestObject" 195 193 } 196 writable : true 197 enumerable : true 198 configurable : true 199 name : "self" 194 } 195 { 196 name : "__proto__" 197 value : { 198 type : "object" 199 objectId : <string> 200 className : <string> 201 description : "TestObject" 202 } 200 203 } 201 204 ] -
trunk/LayoutTests/inspector/runtime/runtime-getProperties-expected.txt
r92670 r92671 10 10 type : "function" 11 11 description : "function () { return 1; }" 12 objectId : <string>13 12 } 14 enumerable : true15 writable : false16 13 } 17 14 { … … 20 17 type : "function" 21 18 description : "function (value) { }" 22 objectId : <string>23 19 } 24 enumerable : true25 writable : false26 20 } 27 21 … … 32 26 type : "function" 33 27 description : "function () { return 1; }" 34 objectId : <string>35 28 } 36 enumerable : true37 writable : false38 29 } 39 30 -
trunk/LayoutTests/inspector/runtime/runtime-getProperties.html
r92670 r92671 66 66 return; 67 67 68 var value = property.value; 69 if (value) 70 property.value = { type: value.type, description: value.description.replace("function foo", "function "), objectId: value.objectId }; 71 InspectorTest.dump(property, { objectId: true }); 68 var propertyObj = {}; 69 propertyObj.name = property.name; 70 propertyObj.value = {}; 71 propertyObj.value.type = property.value.type; 72 propertyObj.value.description = property.value.description; 73 74 InspectorTest.dump(propertyObj); 72 75 } 73 76 } -
trunk/Source/WebCore/ChangeLog
r92670 r92671 1 2011-08-09 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r92670. 4 http://trac.webkit.org/changeset/92670 5 https://bugs.webkit.org/show_bug.cgi?id=65905 6 7 It broke 3 inspector tests (Requested by Ossy on #webkit). 8 9 * inspector/InjectedScript.cpp: 10 (WebCore::InjectedScript::getProperties): 11 * inspector/InjectedScript.h: 12 * inspector/InjectedScriptSource.js: 13 (.): 14 * inspector/Inspector.json: 15 * inspector/InspectorRuntimeAgent.cpp: 16 (WebCore::InspectorRuntimeAgent::getProperties): 17 * inspector/InspectorRuntimeAgent.h: 18 * inspector/front-end/ObjectPropertiesSection.js: 19 (WebInspector.ObjectPropertyTreeElement.prototype.ondblclick): 20 (WebInspector.ObjectPropertyTreeElement.prototype.update): 21 * inspector/front-end/RemoteObject.js: 22 (WebInspector.RemoteObject.prototype.getOwnProperties): 23 (WebInspector.RemoteObject.prototype.getAllProperties): 24 (WebInspector.RemoteObject.prototype._getProperties.remoteObjectBinder): 25 (WebInspector.RemoteObject.prototype._getProperties): 26 (WebInspector.RemoteObjectProperty): 27 * inspector/front-end/inspector.css: 28 (.section .properties .value.dimmed): 29 1 30 2011-08-09 Pavel Feldman <pfeldman@google.com> 2 31 -
trunk/Source/WebCore/inspector/InjectedScript.cpp
r92670 r92671 86 86 } 87 87 88 void InjectedScript::getProperties(ErrorString* errorString, const String& objectId, bool ownProperties, RefPtr<InspectorArray>* properties)88 void InjectedScript::getProperties(ErrorString* errorString, const String& objectId, bool ignoreHasOwnProperty, RefPtr<InspectorArray>* properties) 89 89 { 90 90 ScriptFunctionCall function(m_injectedScriptObject, "getProperties"); 91 91 function.appendArgument(objectId); 92 function.appendArgument( ownProperties);92 function.appendArgument(ignoreHasOwnProperty); 93 93 94 94 RefPtr<InspectorValue> result; -
trunk/Source/WebCore/inspector/InjectedScript.h
r92670 r92671 71 71 bool* wasThrown); 72 72 void evaluateOnCallFrame(ErrorString*, const ScriptValue& callFrames, const String& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, RefPtr<InspectorObject>* result, bool* wasThrown); 73 void getProperties(ErrorString*, const String& objectId, bool ownProperties, RefPtr<InspectorArray>* result);73 void getProperties(ErrorString*, const String& objectId, bool ignoreHasOwnProperty, RefPtr<InspectorArray>* result); 74 74 Node* nodeForObjectId(const String& objectId); 75 75 void releaseObject(const String& objectId); -
trunk/Source/WebCore/inspector/InjectedScriptSource.js
r92670 r92671 1 1 /* 2 2 * Copyright (C) 2007 Apple Inc. All rights reserved. 3 3 * … … 166 166 }, 167 167 168 getProperties: function(objectId, ownProperties)168 getProperties: function(objectId, ignoreHasOwnProperty) 169 169 { 170 170 var parsedObjectId = this._parseObjectId(objectId); … … 174 174 if (!this._isDefined(object)) 175 175 return false; 176 var descriptors = []; 177 this._populatePropertyDescriptors(object, descriptors, ownProperties); 178 179 // Go over properties, wrap object values. 180 for (var i = 0; i < descriptors.length; ++i) { 181 var descriptor = descriptors[i]; 182 if (descriptor.get) 183 descriptor.get = this._wrapObject(descriptor.get, objectGroupName); 184 if (descriptor.set) 185 descriptor.set = this._wrapObject(descriptor.set, objectGroupName); 186 if ("value" in descriptor) 187 descriptor.value = this._wrapObject(descriptor.value, objectGroupName); 188 } 189 return descriptors; 176 var properties = []; 177 178 var propertyNames = ignoreHasOwnProperty ? this._getPropertyNames(object) : Object.getOwnPropertyNames(object); 179 if (!ignoreHasOwnProperty && object.__proto__) 180 propertyNames.push("__proto__"); 181 182 // Go over properties, prepare results. 183 for (var i = 0; i < propertyNames.length; ++i) { 184 var propertyName = propertyNames[i]; 185 186 var getter = (typeof object["__lookupGetter__"] === "function") && object.__lookupGetter__(propertyName); 187 var setter = (typeof object["__lookupSetter__"] === "function") && object.__lookupSetter__(propertyName); 188 if (getter || setter) { 189 if (getter) { 190 var property = {}; 191 property.name = "get " + propertyName; 192 property.value = this._wrapObject(getter, objectGroupName); 193 properties.push(property); 194 } 195 if (setter) { 196 var property = {}; 197 property.name = "set " + propertyName; 198 property.value = this._wrapObject(setter, objectGroupName); 199 properties.push(property); 200 } 201 } else { 202 var property = {}; 203 property.name = propertyName; 204 var value; 205 try { 206 value = object[propertyName]; 207 } catch(e) { 208 var value = e; 209 property.wasThrown = true; 210 } 211 property.value = this._wrapObject(value, objectGroupName); 212 properties.push(property); 213 } 214 } 215 return properties; 190 216 }, 191 217 … … 202 228 }, 203 229 204 _populatePropertyDescriptors: function(object, descriptors, ownProperties) 205 { 206 var nameProcessed = {}; 207 nameProcessed.__proto__ = null; 208 for (var o = object; this._isDefined(o); o = o.__proto__) { 209 var names = Object.getOwnPropertyNames(o); 210 for (var i = 0; i < names.length; ++i) { 211 var name = names[i]; 212 if (nameProcessed[name]) 213 continue; 214 215 try { 216 nameProcessed[name] = true; 217 var descriptor = Object.getOwnPropertyDescriptor(object, name); 218 if (!descriptor) 219 continue; 220 } catch (e) { 221 var descriptor = {}; 222 descriptor.value = e; 223 descriptor.wasThrown = true; 224 } 225 226 descriptor.name = name; 227 descriptors.push(descriptor); 230 _populatePropertyNames: function(object, resultSet) 231 { 232 for (var o = object; o; o = o.__proto__) { 233 try { 234 var names = Object.getOwnPropertyNames(o); 235 for (var i = 0; i < names.length; ++i) 236 resultSet[names[i]] = true; 237 } catch (e) { 228 238 } 229 if (ownProperties) { 230 if (object.__proto__) 231 descriptors.push({ name: "__proto__", value: object.__proto__, writable: true, configurable: true, enumerable: false}); 232 break; 233 } 234 } 239 } 240 }, 241 242 _getPropertyNames: function(object, resultSet) 243 { 244 var propertyNameSet = {}; 245 this._populatePropertyNames(object, propertyNameSet); 246 return Object.keys(propertyNameSet); 235 247 }, 236 248 -
trunk/Source/WebCore/inspector/Inspector.json
r92670 r92671 237 237 }, 238 238 { 239 "id": "PropertyDescriptor", 240 "type": "object", 241 "description": "Object property descriptor.", 242 "properties": [ 243 { "name": "value", "$ref": "RemoteObject", "description": "The value associated with the property." }, 244 { "name": "writable", "type": "boolean", "description": "True iff the value associated with the property may be changed (data descriptors only)." }, 245 { "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)." }, 246 { "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)." }, 247 { "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." }, 248 { "name": "enumerable", "type": "boolean", "description": "True iff this property shows up during enumeration of the properties on the corresponding object." } 239 "id": "RemoteProperty", 240 "type": "object", 241 "description": "Mirror object property.", 242 "properties": [ 243 { "name": "name", "type": "string", "description": "Property name." }, 244 { "name": "value", "$ref": "RemoteObject", "description": "Property value." }, 245 { "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." } 249 246 ] 250 247 }, … … 294 291 "parameters": [ 295 292 { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to return properties for." }, 296 { "name": " ownProperties", "optional": true, "type": "boolean", "description": "If true, returns properties belonging only to the element itself, not to itsprototype chain." }297 ], 298 "returns": [ 299 { "name": "result", "type": "array", "items": { "$ref": " PropertyDescriptor"}, "description": "Object properties." }293 { "name": "ignoreHasOwnProperty", "type": "boolean", "description": "If true, returns properties belonging to any element of the prototype chain." } 294 ], 295 "returns": [ 296 { "name": "result", "type": "array", "items": { "$ref": "RemoteProperty"}, "description": "Object properties." } 300 297 ], 301 298 "description": "Returns properties of a given object." -
trunk/Source/WebCore/inspector/InspectorRuntimeAgent.cpp
r92670 r92671 110 110 } 111 111 112 void InspectorRuntimeAgent::getProperties(ErrorString* errorString, const String& objectId, const bool* const ownProperties, RefPtr<InspectorArray>* result)112 void InspectorRuntimeAgent::getProperties(ErrorString* errorString, const String& objectId, bool ignoreHasOwnProperty, RefPtr<InspectorArray>* result) 113 113 { 114 114 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId); … … 117 117 return; 118 118 } 119 injectedScript.getProperties(errorString, objectId, ownProperties ? *ownProperties : false, result);119 injectedScript.getProperties(errorString, objectId, ignoreHasOwnProperty, result); 120 120 } 121 121 -
trunk/Source/WebCore/inspector/InspectorRuntimeAgent.h
r92670 r92671 71 71 bool* wasThrown); 72 72 void releaseObject(ErrorString*, const String& objectId); 73 void getProperties(ErrorString*, const String& objectId, const bool* const ownProperties, RefPtr<InspectorArray>* result);73 void getProperties(ErrorString*, const String& objectId, bool ignoreHasOwnProperty, RefPtr<InspectorArray>* result); 74 74 void releaseObjectGroup(ErrorString*, const String& objectGroup); 75 75 -
trunk/Source/WebCore/inspector/front-end/ObjectPropertiesSection.js
r92670 r92671 167 167 ondblclick: function(event) 168 168 { 169 if (this.property.writable) 170 this.startEditing(); 169 this.startEditing(); 171 170 }, 172 171 … … 181 180 this.nameElement.className = "name"; 182 181 this.nameElement.textContent = this.property.name; 183 if (!this.property.enumerable)184 this.nameElement.addStyleClass("dimmed");185 182 186 183 var separatorElement = document.createElement("span"); -
trunk/Source/WebCore/inspector/front-end/RemoteObject.js
r92670 r92671 117 117 getOwnProperties: function(callback) 118 118 { 119 this._getProperties(false, callback); 120 }, 121 122 getAllProperties: function(callback) 123 { 119 124 this._getProperties(true, callback); 120 125 }, 121 126 122 getAllProperties: function(callback) 123 { 124 this._getProperties(false, callback); 125 }, 126 127 _getProperties: function(ownProperties, callback) 127 _getProperties: function(ignoreHasOwnProperty, callback) 128 128 { 129 129 if (!this._objectId) { … … 137 137 return; 138 138 } 139 var result = []; 140 for (var i = 0; properties && i < properties.length; ++i) { 141 var property = properties[i]; 142 if (property.get || property.set) { 143 if (property.get) 144 result.push(new WebInspector.RemoteObjectProperty("get " + property.name, WebInspector.RemoteObject.fromPayload(property.get), property)); 145 if (property.set) 146 result.push(new WebInspector.RemoteObjectProperty("set " + property.name, WebInspector.RemoteObject.fromPayload(property.set), property)); 147 } else 148 result.push(new WebInspector.RemoteObjectProperty(property.name, WebInspector.RemoteObject.fromPayload(property.value), property)); 149 } 150 callback(result); 151 } 152 RuntimeAgent.getProperties(this._objectId, ownProperties, remoteObjectBinder); 139 for (var i = 0; properties && i < properties.length; ++i) 140 properties[i].value = WebInspector.RemoteObject.fromPayload(properties[i].value); 141 callback(properties); 142 } 143 RuntimeAgent.getProperties(this._objectId, !!ignoreHasOwnProperty, remoteObjectBinder); 153 144 }, 154 145 … … 223 214 } 224 215 225 WebInspector.RemoteObjectProperty = function(name, value , descriptor)216 WebInspector.RemoteObjectProperty = function(name, value) 226 217 { 227 218 this.name = name; 228 219 this.value = value; 229 this.enumerable = descriptor ? !!descriptor.enumerable : true;230 this.writable = descriptor ? !!descriptor.writable : true;231 if (descriptor && descriptor.wasThrown)232 this.wasThrown = true;233 220 } 234 221 -
trunk/Source/WebCore/inspector/front-end/inspector.css
r92670 r92671 1635 1635 } 1636 1636 1637 .section .properties . dimmed {1638 opacity: 0.6;1637 .section .properties .value.dimmed { 1638 color: rgb(100, 100, 100); 1639 1639 } 1640 1640
Note: See TracChangeset
for help on using the changeset viewer.