diff options
author | Ben Murdoch <benm@google.com> | 2011-05-24 11:24:40 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-06-02 09:53:15 +0100 |
commit | 81bc750723a18f21cd17d1b173cd2a4dda9cea6e (patch) | |
tree | 7a9e5ed86ff429fd347a25153107221543909b19 /Source/WebCore/inspector/front-end/PropertiesSidebarPane.js | |
parent | 94088a6d336c1dd80a1e734af51e96abcbb689a7 (diff) | |
download | external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.zip external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.gz external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.bz2 |
Merge WebKit at r80534: Intial merge by Git
Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61
Diffstat (limited to 'Source/WebCore/inspector/front-end/PropertiesSidebarPane.js')
-rw-r--r-- | Source/WebCore/inspector/front-end/PropertiesSidebarPane.js | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/Source/WebCore/inspector/front-end/PropertiesSidebarPane.js b/Source/WebCore/inspector/front-end/PropertiesSidebarPane.js index a1e37bc..0c314bc 100644 --- a/Source/WebCore/inspector/front-end/PropertiesSidebarPane.js +++ b/Source/WebCore/inspector/front-end/PropertiesSidebarPane.js @@ -42,15 +42,40 @@ WebInspector.PropertiesSidebarPane.prototype = { return; } - function callback(prototypes) + RuntimeAgent.releaseObjectGroup(0, "dom-selection"); + WebInspector.RemoteObject.resolveNode(node, nodeResolved.bind(this)); + + function nodeResolved(objectPayload) { + if (!objectPayload) + return; + var object = WebInspector.RemoteObject.fromPayload(objectPayload); + object.evaluate("var proto = this; result = {}; var counter = 1; while (proto) { result[counter++] = proto; proto = proto.__proto__ }; return result;", nodePrototypesReady.bind(this)); + } + + function nodePrototypesReady(objectPayload) + { + if (!objectPayload) + return; + var object = WebInspector.RemoteObject.fromPayload(objectPayload); + object.getOwnProperties(false, fillSection.bind(this)); + } + + function fillSection(prototypes) + { + if (!prototypes) + return; + var body = this.bodyElement; body.removeChildren(); this.sections = []; // Get array of prototype user-friendly names. for (var i = 0; i < prototypes.length; ++i) { - var prototype = WebInspector.RemoteObject.fromPayload(prototypes[i]); + if (!parseInt(prototypes[i].name)) + continue; + + var prototype = prototypes[i].value; var title = prototype.description; if (title.match(/Prototype$/)) title = title.replace(/Prototype$/, ""); @@ -59,7 +84,6 @@ WebInspector.PropertiesSidebarPane.prototype = { body.appendChild(section.element); } } - InspectorBackend.getNodePrototypes(node.id, callback.bind(this)); } } |