Bug 66544 - Web Inspector: getAttributes should work on a single node, not array.
Summary: Web Inspector: getAttributes should work on a single node, not array.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pavel Feldman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-19 03:15 PDT by Pavel Feldman
Modified: 2011-08-19 05:50 PDT (History)
11 users (show)

See Also:


Attachments
Patch (7.04 KB, patch)
2011-08-19 03:17 PDT, Pavel Feldman
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2011-08-19 03:15:54 PDT
Patch to follow.
Comment 1 Pavel Feldman 2011-08-19 03:17:21 PDT
Created attachment 104483 [details]
Patch
Comment 2 WebKit Review Bot 2011-08-19 03:20:10 PDT
Attachment 104483 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/inspector/InspectorDOMAgent.cpp:1083:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Source/WebCore/inspector/InspectorDOMAgent.h:131:  The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]
Total errors found: 2 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Alexander Pavlov (apavlov) 2011-08-19 04:39:01 PDT
Comment on attachment 104483 [details]
Patch

One comment, otherwise looks good.

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

> Source/WebCore/inspector/Inspector.json:1064
> +                    { "name": "nodeId", "type": "integer", "description": "Ids of the nodes to retrieve attibutes for." }

Ids of the nodes -> Id of the node
Comment 4 Adam Roben (:aroben) 2011-08-19 05:23:10 PDT
Comment on attachment 104483 [details]
Patch

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

>> Source/WebCore/inspector/InspectorDOMAgent.cpp:1083
>> +void InspectorDOMAgent::getAttributes(ErrorString* errorString, int nodeId, RefPtr<InspectorArray>* result)
> 
> The parameter type should use PassRefPtr instead of RefPtr.  [readability/pass_ptr] [5]

We should file a bug about check-webkit-style not understanding RefPtr out-parameters.

> Source/WebCore/inspector/front-end/DOMAgent.js:463
> -        var nodeIds = [];
>          for (var nodeId in this._attributeLoadNodeIds)
> -            nodeIds.push(Number(nodeId));
> -        DOMAgent.getAttributes(nodeIds, this._wrapClientCallback(callback.bind(this)));
> +            DOMAgent.getAttributes(parseInt(nodeId), this._wrapClientCallback(callback.bind(this, nodeId)));

Presumably this is worse from an efficiency standpoint. Hopefully it won't matter in practice.
Comment 5 Pavel Feldman 2011-08-19 05:50:44 PDT
Committed r93398: <http://trac.webkit.org/changeset/93398>