[Webkit-unassigned] [Bug 31238] Web Inspector: Inspector should support copy() in the command line

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Nov 8 20:55:15 PST 2009


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





--- Comment #5 from Pavel Feldman <pfeldman at chromium.org>  2009-11-08 20:55:14 PDT ---
(In reply to comment #4)
> (In reply to comment #3)
> > (From update of attachment 42713 [details] [details])
> > What you should do instead is:
> > - Introduce copyText in InspectorBackend.(idl, h, cpp). Just mimic copyNode
> > there and pass text instead of node id.
> > - Implement it as Pasteboard::generalPasteboard()->writePlainText(text); (see
> > copyNode again)
> > - Make a simple call to it from your new copy API method.
> > 
> > We could be even more cleaver here and copy markup in case selected object is
> > node (make an instanceof check under copy and choose between copyText and
> > copyNode to call). [object HTMLElement] is not too informative otherwise…
> 
> I was able to get the copyText method working. I wanted to use copyNode for
> nodes but I couldn't figure out how to get the node id from a node?

Oh, sorry about the confusion.

Actually, given that copy is executed in the injectedscript already, there is
no need to go from id to node in order to copy it. Your argument is already a
real node, no need to resolve it by id. But there is no copyNode(Node) method
in InspectorBackend because it would be [Custom] and there were actually no use
cases for it...

I think you should either forget my suggestion about calling copyNode or do

var nodeId = InspectorController.pushNodePathToFrontend(node, false /*
selectInUI */);

It would give you id for a node, but as a side affect it will also push it into
the frontend in case it was not there. Which is actually fine.

-- 
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