summaryrefslogtreecommitdiffstats
path: root/webkit/glue/devtools/js
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/glue/devtools/js')
-rw-r--r--webkit/glue/devtools/js/devtools.html1
-rw-r--r--webkit/glue/devtools/js/devtools.js118
-rw-r--r--webkit/glue/devtools/js/dom_agent.js59
-rw-r--r--webkit/glue/devtools/js/inject.js301
-rw-r--r--webkit/glue/devtools/js/inspector_controller_impl.js114
5 files changed, 132 insertions, 461 deletions
diff --git a/webkit/glue/devtools/js/devtools.html b/webkit/glue/devtools/js/devtools.html
index b017767..d859e81 100644
--- a/webkit/glue/devtools/js/devtools.html
+++ b/webkit/glue/devtools/js/devtools.html
@@ -85,6 +85,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="SidebarTreeElement.js"></script>
<script type="text/javascript" src="PropertiesSection.js"></script>
<script type="text/javascript" src="ObjectPropertiesSection.js"></script>
+ <script type="text/javascript" src="ObjectProxy.js"></script>
<script type="text/javascript" src="BreakpointsSidebarPane.js"></script>
<script type="text/javascript" src="CallStackSidebarPane.js"></script>
<script type="text/javascript" src="ScopeChainSidebarPane.js"></script>
diff --git a/webkit/glue/devtools/js/devtools.js b/webkit/glue/devtools/js/devtools.js
index 8306057..be76df6 100644
--- a/webkit/glue/devtools/js/devtools.js
+++ b/webkit/glue/devtools/js/devtools.js
@@ -339,100 +339,6 @@ WebInspector.ElementsPanel.prototype.jumpToPreviousSearchResult = function() {
/**
- * @override
- */
-WebInspector.PropertiesSidebarPane.prototype.update = function(object) {
- var body = this.bodyElement;
- body.removeChildren();
-
- this.sections = [];
-
- if (!object) {
- return;
- }
-
-
- var self = this;
- devtools.tools.getDomAgent().getNodePrototypesAsync(object.id_,
- function(json) {
- // Get array of prototype user-friendly names.
- var prototypes = JSON.parse(json);
- for (var i = 0; i < prototypes.length; ++i) {
- var prototype = {};
- prototype.id_ = object.id_;
- prototype.protoDepth_ = i;
- var section = new WebInspector.SidebarObjectPropertiesSection(
- prototype,
- prototypes[i]);
- self.sections.push(section);
- body.appendChild(section.element);
- }
- });
-};
-
-
-/**
- * Our implementation of ObjectPropertiesSection for Elements tab.
- * @constructor
- */
-WebInspector.SidebarObjectPropertiesSection = function(object, title) {
- WebInspector.ObjectPropertiesSection.call(this, object, title,
- null /* subtitle */, null /* emptyPlaceholder */,
- null /* ignoreHasOwnProperty */, null /* extraProperties */,
- WebInspector.SidebarObjectPropertyTreeElement /* treeElementConstructor */
- );
-};
-goog.inherits(WebInspector.SidebarObjectPropertiesSection,
- WebInspector.ObjectPropertiesSection);
-
-
-/**
- * @override
- */
-WebInspector.SidebarObjectPropertiesSection.prototype.onpopulate = function() {
- var nodeId = this.object.id_;
- var protoDepth = this.object.protoDepth_;
- var path = [];
- devtools.tools.getDomAgent().getNodePropertiesAsync(nodeId, path, protoDepth,
- goog.partial(WebInspector.didGetNodePropertiesAsync_,
- this.propertiesTreeOutline,
- this.treeElementConstructor,
- nodeId,
- path));
-};
-
-
-/**
- * Our implementation of ObjectPropertyTreeElement for Elements tab.
- * @constructor
- */
-WebInspector.SidebarObjectPropertyTreeElement = function(parentObject,
- propertyName) {
- WebInspector.ObjectPropertyTreeElement.call(this, parentObject,
- propertyName);
-};
-goog.inherits(WebInspector.SidebarObjectPropertyTreeElement,
- WebInspector.ObjectPropertyTreeElement);
-
-
-/**
- * @override
- */
-WebInspector.SidebarObjectPropertyTreeElement.prototype.onpopulate =
- function() {
- var nodeId = this.parentObject.devtools$$nodeId_;
- var path = this.parentObject.devtools$$path_.slice(0);
- path.push(this.propertyName);
- devtools.tools.getDomAgent().getNodePropertiesAsync(nodeId, path, -1,
- goog.partial(
- WebInspector.didGetNodePropertiesAsync_,
- this,
- this.treeOutline.section.treeElementConstructor,
- nodeId, path));
-};
-
-
-/**
* This override is necessary for adding script source asynchronously.
* @override
*/
@@ -659,9 +565,8 @@ WebInspector.ScopeChainPropertiesSection.prototype.didResolveChildren_ =
* using the debugger agent.
* @constructor
*/
-WebInspector.DebuggedObjectTreeElement = function(parentObject,
- propertyName) {
- WebInspector.ScopeVariableTreeElement.call(this, parentObject, propertyName);
+WebInspector.DebuggedObjectTreeElement = function(property) {
+ WebInspector.ScopeVariableTreeElement.call(this, property);
}
WebInspector.DebuggedObjectTreeElement.inherits(
WebInspector.ScopeVariableTreeElement);
@@ -672,7 +577,7 @@ WebInspector.DebuggedObjectTreeElement.inherits(
*/
WebInspector.DebuggedObjectTreeElement.prototype.onpopulate =
function() {
- var obj = this.parentObject[this.propertyName];
+ var obj = this.property.childObject;
devtools.tools.getDebuggerAgent().resolveChildren(obj,
goog.bind(this.didResolveChildren_, this), false /* no intrinsic */ );
};
@@ -708,8 +613,13 @@ WebInspector.DebuggedObjectTreeElement.addResolvedChildren = function(
}
names.sort();
for (var i = 0; i < names.length; i++) {
- treeElementContainer.appendChild(
- new treeElementConstructor(object, names[i]));
+ var property = {};
+ property.name = names[i];
+ property.childObject = object[property.name];
+ property.type = typeof property.childObject;
+ property.hasChildren = property.type == 'object' && Object.hasProperties(property.childObject);
+ property.textContent = Object.describe(property.childObject, true);
+ treeElementContainer.appendChild(new treeElementConstructor(property));
}
};
@@ -913,11 +823,9 @@ WebInspector.ConsoleView.prototype._formatobject = function(object, elem) {
}
};
} else {
- var wrapper = {};
- wrapper.id_ = object.___devtools_id;
- wrapper.protoDepth_ = -1;
- var title = object.___devtools_class_name;
- section = new WebInspector.SidebarObjectPropertiesSection(wrapper, title);
+ section = new WebInspector.ObjectPropertiesSection(
+ new WebInspector.ObjectProxy(object.___devtools_id),
+ object.___devtools_class_name);
}
elem.appendChild(section.element);
};
diff --git a/webkit/glue/devtools/js/dom_agent.js b/webkit/glue/devtools/js/dom_agent.js
index 27b9d2a..ca08205 100644
--- a/webkit/glue/devtools/js/dom_agent.js
+++ b/webkit/glue/devtools/js/dom_agent.js
@@ -333,6 +333,7 @@ devtools.DomWindow = function(domAgent) {
this.document = new devtools.DomDocument(domAgent, this);
};
+
/**
* Represents DOM Node class.
*/
@@ -340,6 +341,16 @@ devtools.DomWindow.prototype.__defineGetter__('Node', function() {
return devtools.DomNode;
});
+
+/**
+ * Represents DOM NodeList class.
+ * @constructor
+ */
+devtools.DomWindow.prototype.__defineGetter__('NodeList', function() {
+ return function() {};
+});
+
+
/**
* Represents DOM Element class.
* @constructor
@@ -718,54 +729,6 @@ devtools.DomAgent.prototype.getSearchResultNode = function(index) {
};
-/**
- * Returns all properties of the given node.
- * @param {number} nodeId Node to get properties for.
- * @param {Array.<string>} path Path to the object.
- * @param {number} protoDepth Depth to the exact proto level.
- * @param {function(string):undefined} callback Function to call with the
- * result.
- */
-devtools.DomAgent.prototype.getNodePropertiesAsync = function(nodeId,
- path, protoDepth, callback) {
- var callbackId = this.utilityFunctionCallbackWrapper_(callback);
- RemoteToolsAgent.ExecuteUtilityFunction(callbackId,
- 'getProperties',
- JSON.stringify([nodeId, path, protoDepth]));
-};
-
-
-/**
- * Returns prototype chain for a given node.
- * @param {number} nodeId Node to get prototypes for.
- * @param {Function} callback.
- */
-devtools.DomAgent.prototype.getNodePrototypesAsync = function(nodeId,
- callback) {
- var callbackId = this.utilityFunctionCallbackWrapper_(callback);
- RemoteToolsAgent.ExecuteUtilityFunction(callbackId,
- 'getPrototypes', JSON.stringify([nodeId]));
-};
-
-
-/**
- * Dumps exception if something went wrong in ExecuteUtilityFunction.
- * @param {Function} callback Callback to wrap.
- * @return {number} Callback id.
- */
-devtools.DomAgent.prototype.utilityFunctionCallbackWrapper_ =
- function(callback) {
- var mycallback = function(result, exception) {
- if (exception && exception.length) {
- debugPrint('Exception in ExecuteUtilityFunction:' + exception);
- return;
- }
- callback(result);
- };
- return devtools.Callback.wrap(mycallback);
-};
-
-
function firstChildSkippingWhitespace() {
return this.firstChild;
}
diff --git a/webkit/glue/devtools/js/inject.js b/webkit/glue/devtools/js/inject.js
index f83f019..0d4e0e3 100644
--- a/webkit/glue/devtools/js/inject.js
+++ b/webkit/glue/devtools/js/inject.js
@@ -28,139 +28,6 @@ devtools.Injected = function() {
/**
- * Returns object for given id. This can be either node wrapper for
- * integer ids or evaluation results that recide in cached console
- * objects cache for arbitrary keys.
- * @param {number|string} id Id to get object for.
- * @return {Object} resolved object.
- */
-devtools.Injected.prototype.getObjectForId_ = function(id) {
- if (typeof id == 'number') {
- return DevToolsAgentHost.getNodeForId(id);
- }
- return this.cachedConsoleObjects_[id];
-};
-
-
-/**
- * Returns array of properties for a given node on a given path.
- * @param {number} nodeId Id of node to get prorotypes for.
- * @param {Array.<string>} path Path to the nested object.
- * @param {number} protoDepth Depth of the actual proto to inspect.
- * @return {Array.<Object>} Array where each property is represented
- * by the four entries [{string} type, {string} name, {Object} value,
- * {string} objectClassNameOrFunctionSignature].
- */
-devtools.Injected.prototype.getProperties =
- function(nodeId, path, protoDepth) {
- var result = [];
- var obj = this.getObjectForId_(nodeId);
- if (!obj) {
- return [];
- }
-
- // Follow the path.
- for (var i = 0; obj && i < path.length; ++i) {
- obj = obj[path[i]];
- }
-
- if (!obj) {
- return [];
- }
-
- // Get to the necessary proto layer.
- for (var i = 0; obj && i < protoDepth; ++i) {
- obj = obj.__proto__;
- }
-
- if (!obj) {
- return [];
- }
-
- // Go over properties, prepare results.
- for (var name in obj) {
- if (protoDepth != -1 && 'hasOwnProperty' in obj &&
- !obj.hasOwnProperty(name)) {
- continue;
- }
- if (obj['__lookupGetter__'] && obj.__lookupGetter__(name)) {
- continue;
- }
-
- var value;
- var type;
- try {
- value = obj[name];
- type = typeof value;
- } catch (e) {
- value = 'Exception: ' + e.toString();
- type = 'string';
- }
- result.push(type);
- result.push(name);
- if (type == 'string') {
- var str = value;
- result.push(str.length > 99 ? str.substr(0, 99) + '...' : str);
- result.push(undefined);
- } else if (type == 'function') {
- result.push(undefined);
- var str = Function.prototype.toString.call(value);
- // Cut function signature (everything before first ')').
- var signatureLength = str.search(/\)/);
- str = str.substr(0, signatureLength + 1);
- // Collapse each group of consecutive whitespaces into one whitespaces
- // and add body brackets.
- str = str.replace(/\s+/g, ' ') + ' {}';
- result.push(str);
- } else if (type == 'object') {
- result.push(undefined);
- result.push(this.getClassName_(value));
- } else {
- result.push(value);
- result.push(undefined);
- }
- }
- return result;
-};
-
-
-/**
- * Returns array of prototypes for a given node.
- * @param {number} nodeId Id of node to get prorotypes for.
- * @return {Array<string>} Array of proto names.
- */
-devtools.Injected.prototype.getPrototypes = function(nodeId) {
- var node = DevToolsAgentHost.getNodeForId(nodeId);
- if (!node) {
- return [];
- }
-
- var result = [];
- for (var prototype = node; prototype; prototype = prototype.__proto__) {
- result.push(this.getClassName_(prototype));
- }
- return result;
-};
-
-
-/**
- * @param {Object|Function|null} value An object whose class name to return.
- * @return {string} The value class name.
- */
-devtools.Injected.prototype.getClassName_ = function(value) {
- return (value == null) ? 'null' : value.constructor.name;
-};
-
-
-/**
- * Taken from utilities.js as is for injected evaluation.
- */
-devtools.Injected.prototype.trimWhitespace_ = function(str) {
- return str.replace(/^[\s\xA0]+|[\s\xA0]+$/g, '');
-};
-
-
-/**
* Caches console object for subsequent calls to getConsoleObjectProperties.
* @param {Object} obj Object to cache.
* @return {Object} console object wrapper.
@@ -171,7 +38,7 @@ devtools.Injected.prototype.wrapConsoleObject = function(obj) {
var objId = '#consoleobj#' + this.lastCachedConsoleObjectId_++;
this.cachedConsoleObjects_[objId] = obj;
var result = { ___devtools_id : objId };
- result.___devtools_class_name = this.getClassName_(obj);
+ result.___devtools_class_name = Object.describe(obj, true);
// Loop below fills dummy object with properties for completion.
for (var name in obj) {
result[name] = '';
@@ -231,115 +98,79 @@ InjectedScript._nodeForId = function(nodeId) {
};
-// Following methods are here temporarily, until they are refactored into
-// InjectedScript.js in WebKit.
-function getStyleTextWithShorthands(style)
-{
- var cssText = "";
- var foundProperties = {};
- for (var i = 0; i < style.length; ++i) {
- var individualProperty = style[i];
- var shorthandProperty = style.getPropertyShorthand(individualProperty);
- var propertyName = (shorthandProperty || individualProperty);
-
- if (propertyName in foundProperties)
- continue;
-
- if (shorthandProperty) {
- var value = getShorthandValue(style, shorthandProperty);
- var priority = getShorthandPriority(style, shorthandProperty);
- } else {
- var value = style.getPropertyValue(individualProperty);
- var priority = style.getPropertyPriority(individualProperty);
- }
-
- foundProperties[propertyName] = true;
-
- cssText += propertyName + ": " + value;
- if (priority)
- cssText += " !" + priority;
- cssText += "; ";
- }
-
- return cssText;
-}
-
-
-function getShorthandValue(style, shorthandProperty)
-{
- var value = style.getPropertyValue(shorthandProperty);
- if (!value) {
- // Some shorthands (like border) return a null value, so compute a shorthand value.
- // FIXME: remove this when http://bugs.webkit.org/show_bug.cgi?id=15823 is fixed.
-
- var foundProperties = {};
- for (var i = 0; i < style.length; ++i) {
- var individualProperty = style[i];
- if (individualProperty in foundProperties || style.getPropertyShorthand(individualProperty) !== shorthandProperty)
- continue;
-
- var individualValue = style.getPropertyValue(individualProperty);
- if (style.isPropertyImplicit(individualProperty) || individualValue === "initial")
- continue;
-
- foundProperties[individualProperty] = true;
-
- if (!value)
- value = "";
- else if (value.length)
- value += " ";
- value += individualValue;
- }
- }
- return value;
-}
+InjectedScript._objectForId = function(id) {
+ if (typeof id == 'number') {
+ return DevToolsAgentHost.getNodeForId(id);
+ }
+ return devtools$$obj.cachedConsoleObjects_[id];
+};
-function getShorthandPriority(style, shorthandProperty)
+Object.type = function(obj, win)
{
- var priority = style.getPropertyPriority(shorthandProperty);
- if (!priority) {
- for (var i = 0; i < style.length; ++i) {
- var individualProperty = style[i];
- if (style.getPropertyShorthand(individualProperty) !== shorthandProperty)
- continue;
- priority = style.getPropertyPriority(individualProperty);
- break;
- }
- }
- return priority;
+ if (obj === null)
+ return "null";
+
+ var type = typeof obj;
+ if (type !== "object" && type !== "function")
+ return type;
+
+ win = win || window;
+
+ if (obj instanceof win.Node)
+ return (obj.nodeType === undefined ? type : "node");
+ if (obj instanceof win.String)
+ return "string";
+ if (obj instanceof win.Array)
+ return "array";
+ if (obj instanceof win.Boolean)
+ return "boolean";
+ if (obj instanceof win.Number)
+ return "number";
+ if (obj instanceof win.Date)
+ return "date";
+ if (obj instanceof win.RegExp)
+ return "regexp";
+ if (obj instanceof win.Error)
+ return "error";
+ return type;
}
-
-function getLonghandProperties(style, shorthandProperty)
+// Temporarily moved into the injected context.
+Object.hasProperties = function(obj)
{
- var properties = [];
- var foundProperties = {};
-
- for (var i = 0; i < style.length; ++i) {
- var individualProperty = style[i];
- if (individualProperty in foundProperties || style.getPropertyShorthand(individualProperty) !== shorthandProperty)
- continue;
- foundProperties[individualProperty] = true;
- properties.push(individualProperty);
- }
-
- return properties;
+ if (typeof obj === "undefined" || typeof obj === "null")
+ return false;
+ for (var name in obj)
+ return true;
+ return false;
}
-
-function getUniqueStyleProperties(style)
+Object.describe = function(obj, abbreviated)
{
- var properties = [];
- var foundProperties = {};
-
- for (var i = 0; i < style.length; ++i) {
- var property = style[i];
- if (property in foundProperties)
- continue;
- foundProperties[property] = true;
- properties.push(property);
+ var type1 = Object.type(obj);
+ var type2 = (obj == null) ? "null" : obj.constructor.name;
+
+ switch (type1) {
+ case "object":
+ case "node":
+ return type2;
+ case "array":
+ return "[" + obj.toString() + "]";
+ case "string":
+ if (obj.length > 100)
+ return "\"" + obj.substring(0, 100) + "\u2026\"";
+ return "\"" + obj + "\"";
+ case "function":
+ var objectText = String(obj);
+ if (!/^function /.test(objectText))
+ objectText = (type2 == "object") ? type1 : type2;
+ else if (abbreviated)
+ objectText = /.*/.exec(obj)[0].replace(/ +$/g, "");
+ return objectText;
+ case "regexp":
+ return String(obj).replace(/([\\\/])/g, "\\$1").replace(/\\(\/[gim]*)$/, "$1").substring(1);
+ default:
+ return String(obj);
}
-
- return properties;
}
diff --git a/webkit/glue/devtools/js/inspector_controller_impl.js b/webkit/glue/devtools/js/inspector_controller_impl.js
index b3f090a..459d9c4 100644
--- a/webkit/glue/devtools/js/inspector_controller_impl.js
+++ b/webkit/glue/devtools/js/inspector_controller_impl.js
@@ -12,6 +12,19 @@ goog.provide('devtools.InspectorControllerImpl');
devtools.InspectorControllerImpl = function() {
devtools.InspectorController.call(this);
this.frame_element_id_ = 1;
+
+ this.installInjectedScriptDelegate_('getStyles', true);
+ this.installInjectedScriptDelegate_('getComputedStyle', true);
+ this.installInjectedScriptDelegate_('getInlineStyle', true);
+ this.installInjectedScriptDelegate_('applyStyleText');
+ this.installInjectedScriptDelegate_('setStyleText');
+ this.installInjectedScriptDelegate_('toggleStyleEnabled');
+ this.installInjectedScriptDelegate_('applyStyleRuleText');
+ this.installInjectedScriptDelegate_('addStyleSelector');
+ this.installInjectedScriptDelegate_('setStyleProperty');
+ this.installInjectedScriptDelegate_('getPrototypes', true);
+ this.installInjectedScriptDelegate_('getProperties', true);
+ this.installInjectedScriptDelegate_('setPropertyValue', true);
};
goog.inherits(devtools.InspectorControllerImpl,
devtools.InspectorController);
@@ -253,84 +266,39 @@ devtools.InspectorControllerImpl.prototype.storeLastActivePanel =
};
-// Temporary methods that will be dispatched via InspectorController into the
-// injected context.
-devtools.InspectorControllerImpl.prototype.getStyles =
- function(node, authorOnly, callback) {
- var mycallback = function(result) {
- callback(result);
- }
- RemoteToolsAgent.ExecuteUtilityFunction(
- devtools.InspectorControllerImpl.parseWrap_(mycallback),
- 'InjectedScript', JSON.stringify(['getStyles', node.id_, authorOnly]));
-};
-
-
-devtools.InspectorControllerImpl.prototype.getComputedStyle =
- function(node, callback) {
- RemoteToolsAgent.ExecuteUtilityFunction(
- devtools.InspectorControllerImpl.parseWrap_(callback),
- 'InjectedScript', JSON.stringify(['getComputedStyle', node.id_]));
-};
-
-
-devtools.InspectorControllerImpl.prototype.getInlineStyle =
- function(node, callback) {
- RemoteToolsAgent.ExecuteUtilityFunction(
- devtools.InspectorControllerImpl.parseWrap_(callback),
- 'InjectedScript', JSON.stringify(['getInlineStyle', node.id_]));
-};
-
-
-devtools.InspectorControllerImpl.prototype.applyStyleText =
- function(styleId, styleText, propertyName, callback) {
- RemoteToolsAgent.ExecuteUtilityFunction(
- devtools.InspectorControllerImpl.parseWrap_(callback),
- 'InjectedScript', JSON.stringify(['applyStyleText', styleId, styleText,
- propertyName]));
-};
-
-
-devtools.InspectorControllerImpl.prototype.setStyleText =
- function(style, cssText, callback) {
- RemoteToolsAgent.ExecuteUtilityFunction(
- devtools.InspectorControllerImpl.parseWrap_(callback),
- 'InjectedScript', JSON.stringify(['setStyleText', style, cssText]));
-};
-
-
-devtools.InspectorControllerImpl.prototype.toggleStyleEnabled =
- function(styleId, propertyName, disabled, callback) {
- RemoteToolsAgent.ExecuteUtilityFunction(
- devtools.InspectorControllerImpl.parseWrap_(callback),
- 'InjectedScript', JSON.stringify(['toggleStyleEnabled', styleId,
- propertyName, disabled]));
-};
-
-
-devtools.InspectorControllerImpl.prototype.applyStyleRuleText =
- function(ruleId, newContent, selectedNode, callback) {
- RemoteToolsAgent.ExecuteUtilityFunction(
- devtools.InspectorControllerImpl.parseWrap_(callback),
- 'InjectedScript', JSON.stringify(['applyStyleRuleText', ruleId,
- newContent, selectedNode]));
-};
-
-
-devtools.InspectorControllerImpl.prototype.addStyleSelector =
- function(newContent, callback) {
- RemoteToolsAgent.ExecuteUtilityFunction(
- devtools.InspectorControllerImpl.parseWrap_(callback),
- 'InjectedScript', JSON.stringify(['addStyleSelector', newContent]));
+/**
+ * Installs delegating handler into the inspector controller.
+ * @param {number} argsCound Number of the arguments in the delegating call
+ * excluding callback.
+ * @param {string} methodName Method to install delegating handler for.
+ * @parma {boolean} unwrap Replace first argument with its id.
+ */
+devtools.InspectorControllerImpl.prototype.installInjectedScriptDelegate_ =
+ function(methodName, unwrap) {
+ this[methodName] = goog.bind(this.callInjectedScript_, this, unwrap,
+ methodName);
};
-devtools.InspectorControllerImpl.prototype.setStyleProperty =
- function(styleId, name, value, callback) {
+/**
+ * Bound function with the installInjectedScriptDelegate_ actual
+ * implementation.
+ */
+devtools.InspectorControllerImpl.prototype.callInjectedScript_ =
+ function(unwrap, methodName, var_arg) {
+ var allArgs = Array.prototype.slice.call(arguments);
+ var callback = allArgs[allArgs.length - 1];
+ var args = Array.prototype.slice.call(allArgs, 1, allArgs.length - 1);
+ if (unwrap) {
+ if (args[1].id_) {
+ args[1] = args[1].id_;
+ } else if (args[1].objectId && args[1].objectId.id_) {
+ args[1].objectId = args[1].objectId.id_;
+ }
+ }
RemoteToolsAgent.ExecuteUtilityFunction(
devtools.InspectorControllerImpl.parseWrap_(callback),
- 'InjectedScript', JSON.stringify(['setStyleProperty', styleId, name,
- value]));
+ 'InjectedScript', JSON.stringify(args));
};