RESOLVED FIXED 66544
Web Inspector: getAttributes should work on a single node, not array.
https://bugs.webkit.org/show_bug.cgi?id=66544
Summary Web Inspector: getAttributes should work on a single node, not array.
Pavel Feldman
Reported 2011-08-19 03:15:54 PDT
Patch to follow.
Attachments
Patch (7.04 KB, patch)
2011-08-19 03:17 PDT, Pavel Feldman
aroben: review+
Pavel Feldman
Comment 1 2011-08-19 03:17:21 PDT
WebKit Review Bot
Comment 2 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.
Alexander Pavlov (apavlov)
Comment 3 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
Adam Roben (:aroben)
Comment 4 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.
Pavel Feldman
Comment 5 2011-08-19 05:50:44 PDT
Note You need to log in before you can comment on or make changes to this bug.