X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fdevtools%2Ffront_end%2Fcomponents%2FObjectPropertiesSection.js;h=c42805aa15c0ecb39cb610646eb67ae8295fea8c;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=444f20361c223334de5cce988cd31602f923e93f;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js b/src/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js index 444f203..c42805a 100644 --- a/src/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js +++ b/src/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js @@ -114,8 +114,7 @@ WebInspector.ObjectPropertiesSection.prototype = { this.propertiesForTest = properties; if (!this.propertiesTreeOutline.children.length) { - var title = document.createElement("div"); - title.className = "info"; + var title = document.createElementWithClass("div", "info"); title.textContent = this.emptyPlaceholder; var infoElement = new TreeElement(title, null, false); this.propertiesTreeOutline.appendChild(infoElement); @@ -189,12 +188,12 @@ WebInspector.ObjectPropertyTreeElement.prototype = { update: function() { - this.nameElement = document.createElement("span"); - this.nameElement.className = "name"; + this.nameElement = document.createElementWithClass("span", "name"); var name = this.property.name; if (/^\s|\s$|^$|\n/.test(name)) - name = "\"" + name.replace(/\n/g, "\u21B5") + "\""; - this.nameElement.textContent = name; + this.nameElement.createTextChildren("\"", name.replace(/\n/g, "\u21B5"), "\""); + else + this.nameElement.textContent = name; if (!this.property.enumerable) this.nameElement.classList.add("dimmed"); if (this.property.isAccessorProperty()) @@ -202,39 +201,48 @@ WebInspector.ObjectPropertyTreeElement.prototype = { if (this.property.symbol) this.nameElement.addEventListener("contextmenu", this._contextMenuFired.bind(this, this.property.symbol), false); - var separatorElement = document.createElement("span"); - separatorElement.className = "separator"; + var separatorElement = document.createElementWithClass("span", "separator"); separatorElement.textContent = ": "; if (this.property.value) { - this.valueElement = document.createElement("span"); - this.valueElement.className = "value"; + this.valueElement = document.createElementWithClass("span", "value"); + var type = this.property.value.type; + var subtype = this.property.value.subtype; var description = this.property.value.description; + var prefix; var valueText; + var suffix; if (this.property.wasThrown) { - valueText = "[Exception: " + description + "]"; - } else if (this.property.value.type === "string" && typeof description === "string") { + prefix = "[Exception: "; + valueText = description; + suffix = "]"; + } else if (type === "string" && typeof description === "string") { // Render \n as a nice unicode cr symbol. - valueText = "\"" + description.replace(/\n/g, "\u21B5") + "\""; + prefix = "\""; + valueText = description.replace(/\n/g, "\u21B5"); + suffix = "\""; this.valueElement._originalTextContent = "\"" + description + "\""; - } else if (this.property.value.type === "function" && typeof description === "string") { - valueText = /.*/.exec(description)[0].replace(/ +$/g, ""); + } else if (type === "function" && typeof description === "string") { + // Render function description until the first \n. + valueText = /.*/.exec(description)[0].replace(/\s+$/g, ""); this.valueElement._originalTextContent = description; - } else if (this.property.value.type !== "object" || this.property.value.subtype !== "node") { + } else if (type !== "object" || subtype !== "node") { valueText = description; } this.valueElement.setTextContentTruncatedIfNeeded(valueText || ""); + if (prefix) + this.valueElement.insertBefore(document.createTextNode(prefix), this.valueElement.firstChild); + if (suffix) + this.valueElement.createTextChild(suffix); if (this.property.wasThrown) this.valueElement.classList.add("error"); - if (this.property.value.subtype) - this.valueElement.classList.add("console-formatted-" + this.property.value.subtype); - else if (this.property.value.type) - this.valueElement.classList.add("console-formatted-" + this.property.value.type); + if (subtype || type) + this.valueElement.classList.add("console-formatted-" + (subtype || type)); this.valueElement.addEventListener("contextmenu", this._contextMenuFired.bind(this, this.property.value), false); - if (this.property.value.type === "object" && this.property.value.subtype === "node" && this.property.value.description) { - WebInspector.DOMPresentationUtils.createSpansForNodeTitle(this.valueElement, this.property.value.description); + if (type === "object" && subtype === "node" && description) { + WebInspector.DOMPresentationUtils.createSpansForNodeTitle(this.valueElement, description); this.valueElement.addEventListener("mousemove", this._mouseMove.bind(this, this.property.value), false); this.valueElement.addEventListener("mouseout", this._mouseOut.bind(this, this.property.value), false); } else { @@ -248,16 +256,13 @@ WebInspector.ObjectPropertyTreeElement.prototype = { if (this.property.getter) { this.valueElement = WebInspector.ObjectPropertyTreeElement.createRemoteObjectAccessorPropertySpan(this.property.parentObject, [this.property.name], this._onInvokeGetterClick.bind(this)); } else { - this.valueElement = document.createElement("span"); - this.valueElement.className = "console-formatted-undefined"; + this.valueElement = document.createElementWithClass("span", "console-formatted-undefined"); this.valueElement.textContent = WebInspector.UIString(""); this.valueElement.title = WebInspector.UIString("No property getter"); } } - this.listItemElement.appendChild(this.nameElement); - this.listItemElement.appendChild(separatorElement); - this.listItemElement.appendChild(this.valueElement); + this.listItemElement.appendChildren(this.nameElement, separatorElement, this.valueElement); }, _contextMenuFired: function(value, event) @@ -405,11 +410,12 @@ WebInspector.ObjectPropertyTreeElement.prototype = { */ applyExpression: function(expression) { + var property = WebInspector.RemoteObject.toCallArgument(this.property.symbol || this.property.name); expression = expression.trim(); if (expression) - this.property.parentObject.setPropertyValue(this.property.name, expression, callback.bind(this)); + this.property.parentObject.setPropertyValue(property, expression, callback.bind(this)); else - this.property.parentObject.deleteProperty(this.property.name, callback.bind(this)); + this.property.parentObject.deleteProperty(property, callback.bind(this)); /** * @param {?Protocol.Error} error @@ -616,7 +622,7 @@ WebInspector.FunctionScopeMainTreeElement.prototype = { return; /** - * @param {?DebuggerAgent.FunctionDetails} response + * @param {?WebInspector.DebuggerModel.FunctionDetails} response * @this {WebInspector.FunctionScopeMainTreeElement} */ function didGetDetails(response)