[Webkit-unassigned] [Bug 27771] New: Web Inspector: Reimplement Elements Panel so that its interaction with DOM is serialized

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 28 11:06:37 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=27771

           Summary: Web Inspector: Reimplement Elements Panel so that its
                    interaction with DOM is serialized
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P3
         Component: Web Inspector
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: pfeldman at chromium.org
                CC: timothy at hatcher.name


Today Elements panel is working synchronously with live DOM objects (or
wrappers).
This is a proposal on how to make this DOM interaction serialized (and
asynchronous).

These are the components that need to be introduced:

1) InspectorDOMAgent

InspectorDOMAgent lives in WebCore/inspector and tracks DOM modifications. It
preserves
DOM Node to int bindings for all the nodes that it has sent to the frontend.
Frontend can
issue particula requests to this agent such as 'getChildNodes'. Agent will
respond with
stringified data structure that will 'describe' the nodes being requested.
There overall
interface of this agent is not big (a handful of methods).

Agent like this lives and works in Chromium. The intention is to upstream it. I
am 
attaching a draft of this class together with the InspectorFrontend/Backend
interfaces
to the the bug.

2) WebInspector.DOMAgent

WebInspector.DOMAgent lives in the front-end and is receiving calls from the
InspectorDOMAgent. It will convert stringified node descriptions into the
structures
that are very similar to JS Node wrappers. It will basically implement all the
DOM
operations ElementsPanel needs. It is going to be fairly large (600 lines of
code).

This piece lives in Chromium and only needs reformatting. See its code at:
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/glue/devtools/js/dom_agent.js

3) JavaScript on the agent side

It does not make much sense to process Search, CSS, Properties-related requests
in 
the native code within InspectorDOMAgent. They look more elegant in JavaScript;
they
do not need to be that fast; they won't lead to the case where all the DOM
nodes we see
in the Elements Panel result in JS wrapper being created around the node. Hence
there
will be a piece of JS code that will live in the page context and will process
requests
such as 'getNodeStyles', 'applyStyleText', everything that is
shorthandProperty-related.
InspectorBackend will have a generic 'executeUtilityFunction' method that will
dispatch
parameters into this agent and get back to the frontend with the results.

It seems to be a relatively large refactoring. I was thinking of introducing
InspectorDOMAgent and WebInspector.DOMAgent first. They will get into code, but
will not
be used by the Elements Panel by default. Then I was going to add Search /
Styles / Properties
JS agent code, still with Elements Panel working as before. As a last step I
would switch
to the new implementation.

Please tell me what you think about this plan!

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list