Bug 111312

Summary: Web Inspector: allow retrieval of composited layers in a given DOM subtree
Product: WebKit Reporter: Antoine Quint <graouts>
Component: Web Inspector (Deprecated)Assignee: Antoine Quint <graouts>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, joepeck, keishi, loislo, pfeldman, pmuellr, timothy, vsevik, web-inspector-bugs, webkit-bug-importer, webkit.review.bot, yurys
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Antoine Quint 2013-03-04 06:28:11 PST
Web Inspector: allow retrieval of composited layers in a given DOM subtree
Comment 1 Antoine Quint 2013-03-04 06:29:07 PST
Add a new LayerTreeAgent method allowing the front-end to gather all composited layers associated with nodes in the subtree of which the provided node is the root. This is a subtask of https://bugs.webkit.org/show_bug.cgi?id=110407.
Comment 2 Radar WebKit Bug Importer 2013-03-04 06:29:22 PST
<rdar://problem/13336629>
Comment 3 Antoine Quint 2013-03-04 06:32:00 PST
Created attachment 191223 [details]
Patch
Comment 4 Simon Fraser (smfr) 2013-03-04 15:34:34 PST
Comment on attachment 191223 [details]
Patch

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

> Source/WebCore/inspector/InspectorLayerTreeAgent.cpp:136
> +        gatherLayersUsingRenderLayerHierarchy(errorString, renderer->enclosingLayer(), layers);

renderer->enclosingLayer() should just be toRenderLayerModelObject(renderer)->layer()

> Source/WebCore/inspector/InspectorLayerTreeAgent.cpp:179
> +    int id = domAgent->boundNodeId(node);
> +    if (!id)
> +        id = domAgent->pushNodeToFrontend(errorString, domAgent->boundNodeId(node->document()), node);

Don't use 'id' in code; it will conflict with Objective-C's reserved word if this is ever turned into Obj-C++.
Comment 5 Joseph Pecoraro 2013-03-04 16:27:29 PST
Comment on attachment 191223 [details]
Patch

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

> Source/WebCore/inspector/Inspector.json:3686
> +                    { "name": "nodeId", "$ref": "DOM.NodeId", "description": "Root of the subtree for which we want to gather layers." }                ],

Formatting: The ending '],' should be on its own line, looks like the newline got lost.
Comment 6 Antoine Quint 2013-03-05 01:42:22 PST
(In reply to comment #4)
> (From update of attachment 191223 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=191223&action=review
> 
> > Source/WebCore/inspector/InspectorLayerTreeAgent.cpp:136
> > +        gatherLayersUsingRenderLayerHierarchy(errorString, renderer->enclosingLayer(), layers);
> 
> renderer->enclosingLayer() should just be toRenderLayerModelObject(renderer)->layer()

Will change in commit.

> > Source/WebCore/inspector/InspectorLayerTreeAgent.cpp:179
> > +    int id = domAgent->boundNodeId(node);
> > +    if (!id)
> > +        id = domAgent->pushNodeToFrontend(errorString, domAgent->boundNodeId(node->document()), node);
> 
> Don't use 'id' in code; it will conflict with Objective-C's reserved word if this is ever turned into Obj-C++.

Good point. I'll rename to "nodeId". Thanks for the review!
Comment 7 Antoine Quint 2013-03-05 01:42:46 PST
(In reply to comment #5)
> (From update of attachment 191223 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=191223&action=review
> 
> > Source/WebCore/inspector/Inspector.json:3686
> > +                    { "name": "nodeId", "$ref": "DOM.NodeId", "description": "Root of the subtree for which we want to gather layers." }                ],
> 
> Formatting: The ending '],' should be on its own line, looks like the newline got lost.

Not sure what happened in the diff, but the new line is there alright in the code, no worries.
Comment 8 Antoine Quint 2013-03-05 02:57:33 PST
Created attachment 191449 [details]
Patch for landing
Comment 9 WebKit Review Bot 2013-03-05 03:33:32 PST
Comment on attachment 191449 [details]
Patch for landing

Clearing flags on attachment: 191449

Committed r144747: <http://trac.webkit.org/changeset/144747>
Comment 10 WebKit Review Bot 2013-03-05 03:33:37 PST
All reviewed patches have been landed.  Closing bug.