Bug 86108

Summary: Web Inspector: [Extensions API] add audit formatters for remote objects and DOM elements
Product: WebKit Reporter: Andrey Kosyakov <caseq>
Component: Web Inspector (Deprecated)Assignee: Andrey Kosyakov <caseq>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch pfeldman: review+

Description Andrey Kosyakov 2012-05-10 10:28:41 PDT
This adds two new audit formatters that take an expression to evaluate in the context of the inspected page and format the result either as an object or a DOM element tree.
Comment 1 Andrey Kosyakov 2012-05-10 23:46:11 PDT
Created attachment 141334 [details]
Patch
Comment 2 Pavel Feldman 2012-05-11 00:43:03 PDT
Comment on attachment 141334 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=141334&action=review

> Source/WebCore/inspector/front-end/AuditFormatters.js:101
> +    object: function(expression, title)

You should start annotating your code.

> Source/WebCore/inspector/front-end/AuditFormatters.js:115
> +    node: function(expression)

ditto

> Source/WebCore/inspector/front-end/AuditFormatters.js:118
> +        function onNodeAvailable(nodeId)

Annotate please

> Source/WebCore/inspector/front-end/AuditFormatters.js:122
> +            if (!treeOutline.children[0].hasChildren)

I don't think we need it, if we do, this code should be in the elements tree outline.

> Source/WebCore/inspector/front-end/AuditFormatters.js:126
> +        function onEvaluate(remoteObject)

Annotate please

> Source/WebCore/inspector/front-end/AuditFormatters.js:136
> +    evaluate: function(expression, callback)

Annotate please

> Source/WebCore/inspector/front-end/AuditFormatters.js:138
> +        function onEvaluate(error, result, wasThrown)

Annotate please

> LayoutTests/inspector/extensions/extensions-audits-expected.txt:36
> +             =รข"

Consider filtering out zero-with whitespaces from the output.

> LayoutTests/inspector/extensions/extensions-audits-tests.js:23
> +            InspectorTest.runAfterPendingDispatches(function() {

See the way it is implemented in elements-tests.js
Comment 3 Andrey Kosyakov 2012-05-11 01:38:15 PDT
Committed r116739: <http://trac.webkit.org/changeset/116739>