Bug 91607

Summary: Web Inspector: Protocol Extension: add getNamedFlowCollection command
Product: WebKit Reporter: Andrei Poenaru <andreigpoenaru>
Component: Web Inspector (Deprecated)Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, vivekgalatage, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 91967    
Bug Blocks: 90786    
Attachments:
Description Flags
Patch
none
Patch
pfeldman: review-
Patch
pfeldman: review-
Patch
webkit-ews: commit-queue-
Patch none

Andrei Poenaru
Reported 2012-07-18 02:45:44 PDT
Implement the getNamedFlowCollection command from this proposed protocol extension: https://bug-90789-attachments.webkit.org/attachment.cgi?id=152527
Attachments
Patch (10.26 KB, patch)
2012-07-18 08:08 PDT, Andrei Poenaru
no flags
Patch (11.33 KB, patch)
2012-07-19 06:47 PDT, Andrei Poenaru
pfeldman: review-
Patch (12.43 KB, patch)
2012-07-20 01:18 PDT, Andrei Poenaru
pfeldman: review-
Patch (12.54 KB, patch)
2012-07-20 03:54 PDT, Andrei Poenaru
webkit-ews: commit-queue-
Patch (12.54 KB, patch)
2012-07-20 05:07 PDT, Andrei Poenaru
no flags
Vivek Galatage
Comment 1 2012-07-18 04:13:08 PDT
Are these all proposed APIs belong to public inspector protocol APIs? Or can some of them be private APIs?
Andrei Poenaru
Comment 2 2012-07-18 04:58:51 PDT
(In reply to comment #1) > Are these all proposed APIs belong to public inspector protocol APIs? Or can some of them be private APIs? Does this mean if they will have "hidden": true? If yes, then they will be marked as "hidden".
Vivek Galatage
Comment 3 2012-07-18 05:07:04 PDT
(In reply to comment #2) > (In reply to comment #1) > > Are these all proposed APIs belong to public inspector protocol APIs? Or can some of them be private APIs? > > Does this mean if they will have "hidden": true? If yes, then they will be marked as "hidden". Yes that's exactly my question was. Thank you.
Andrei Poenaru
Comment 4 2012-07-18 08:08:02 PDT
Pavel Feldman
Comment 5 2012-07-18 08:19:50 PDT
Comment on attachment 153016 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=153016&action=review > Source/WebCore/inspector/InspectorCSSAgent.cpp:794 > + Document* document = m_domAgent->document(); You are currently getting flows from the main frame only. What if the page uses iframes or frame sets? You probably should pass context node id (from DOMAgent terms) into this method to get the flows for a given document.
Andrei Poenaru
Comment 6 2012-07-19 06:47:57 PDT
Pavel Feldman
Comment 7 2012-07-19 07:24:03 PDT
Comment on attachment 153250 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=153250&action=review > LayoutTests/ChangeLog:3 > + Deleted tab space Please remove git comments from here. > LayoutTests/ChangeLog:16 > + Additional information of the change such as approach, rationale. Please add per-function descriptions below (OOPS!). Nuke this line > LayoutTests/inspector/styles/protocol-getNamedFlowCollection-command.html:25 > + function test() { You probably should pick another name in order to not reuse "test" > LayoutTests/inspector/styles/protocol-getNamedFlowCollection-command.html:26 > + function namedFlowCallback(namedFlows) { Please place { on the next line > LayoutTests/inspector/styles/protocol-getNamedFlowCollection-command.html:31 > + InspectorTest.completeTest(); missing return; below. > LayoutTests/inspector/styles/protocol-getNamedFlowCollection-command.html:42 > + function documentCallback(document) { { on the next line. > Source/WebCore/ChangeLog:2 > + Web Inspector: Protocol Extension: add getNamedFlowCollection command missing blank line above > Source/WebCore/dom/WebKitNamedFlowCollection.cpp:48 > + return m_namedFlows; Exposing private member for read-write does not sound good. > Source/WebCore/inspector/Inspector.json:2294 > + { "name": "documentNodeId", "$ref": "DOM.NodeId", "description": "The document node id for which to get the Named Flow Collection."} we typically call node ids "nodeId" > Source/WebCore/inspector/InspectorCSSAgent.cpp:796 > + if (!node || !(node->isDocumentNode())) { You should add InspectorDOMNode::assertDocumentNode instead. > Source/WebCore/inspector/InspectorCSSAgent.cpp:804 > + WebKitNamedFlowCollection::NamedFlowSet& namedFlowSet = document->namedFlows()->namedFlows(); So you could make flow collection return array of strings instead of exposing the private object. > Source/WebCore/inspector/InspectorCSSAgent.cpp:807 > + if ((*it)->flowState() == WebKitNamedFlow::FlowStateNull) This check could also be a part of the collection itself.
Andrei Poenaru
Comment 8 2012-07-19 07:44:12 PDT
(In reply to comment #7) > > Source/WebCore/inspector/InspectorCSSAgent.cpp:796 > > + if (!node || !(node->isDocumentNode())) { > > You should add InspectorDOMNode::assertDocumentNode instead. I can't find "InspectorDOMNode". Did you meant "Node"?
Pavel Feldman
Comment 9 2012-07-19 08:20:23 PDT
(In reply to comment #8) > (In reply to comment #7) > > > Source/WebCore/inspector/InspectorCSSAgent.cpp:796 > > > + if (!node || !(node->isDocumentNode())) { > > > > You should add InspectorDOMNode::assertDocumentNode instead. > > I can't find "InspectorDOMNode". Did you meant "Node"? Sorry, I meant introduce InspectorDOMAgent::assertDocument as in InspectorDOMAgent::assertNode / InspectorDOMAgent::assertElement.
Andrei Poenaru
Comment 10 2012-07-20 01:18:19 PDT
Pavel Feldman
Comment 11 2012-07-20 01:49:07 PDT
Comment on attachment 153444 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=153444&action=review > Source/WebCore/dom/WebKitNamedFlowCollection.h:33 > +#include <InspectorBackendDispatcher.h> You should not make arbitrary component depend on the inspector guts. Also, these are not visible in case of !ENABLED(INSPECTOR). You should return a Vector<String> instead.
Andrei Poenaru
Comment 12 2012-07-20 03:54:34 PDT
Early Warning System Bot
Comment 13 2012-07-20 04:11:29 PDT
Early Warning System Bot
Comment 14 2012-07-20 04:34:36 PDT
Andrei Poenaru
Comment 15 2012-07-20 05:07:23 PDT
WebKit Review Bot
Comment 16 2012-07-20 05:35:12 PDT
Comment on attachment 153480 [details] Patch Clearing flags on attachment: 153480 Committed r123205: <http://trac.webkit.org/changeset/123205>
WebKit Review Bot
Comment 17 2012-07-20 05:35:17 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.