WebKit

Hello Kevin,

is there a chance that you upload new binaries for the wx.webview bindings?

Right now I am using the ones found here: http://wxwebkit.wxcommunity.com/index.php?n=Main.Downloads . Things like WebViewDOMElementInfo.GetInnerNode() are crashing and I wonder if that's already fixed in more recent versions.

-Matthias

Hi Matthias,

I'm working on making some adjustments to the bindings now that a generic C++ bindings approach has been committed to WebKit. I'll try to have that ready soon. However, I'm rather confused... I don't think WebViewDOMElementInfo has a GetInnerNode method? WebViewDOMElementInfo is not a DOMElement or a DOMNode.

Regards,

Kevin

···

On Jul 24, 2010, at 6:52 AM, Matthias wrote:

Hello Kevin,

is there a chance that you upload new binaries for the wx.webview bindings?

Right now I am using the ones found here: NameBright - Coming Soon . Things like WebViewDOMElementInfo.GetInnerNode() are crashing and I wonder if that's already fixed in more recent versions.

-Matthias

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Hi Matthias,

Hi Matthias,

I'm working on making some adjustments to the bindings now that a generic C++ bindings approach has been committed to WebKit. I'll try to have that ready soon. However, I'm rather confused... I don't think WebViewDOMElementInfo has a GetInnerNode method? WebViewDOMElementInfo is not a DOMElement or a DOMNode.

Hmm, see this:

print win.HitTest( (0,0) ).GetInnerNode

<bound method WebViewDOMElementInfo.GetInnerNode of <wx.webview.WebViewDOMElemen
tInfo; proxy of <Swig Object of type 'wxWebViewDOMElementInfo *' at 0x3464598> >

Maybe it crashes because it's not supposed to be there :smiley: However, there's no other method in WebViewDOMElementInfo which would allow me to retrieve the underlying DOMNode.

Yeah, if I ever exposed that method, it was a mistake and has since been removed. I was probably just returning the WebCore::Node object, which is not a public interface. You might be able to get what you're looking for using:

domrange = win.GetSelection().GetAsRange()

And then iterating through the range to see what's in there. API follows the DOM specification, excepting that it follows wx conventions like adding Get to getters and using CamelCase for API names.

If that doesn't help, then I'll just need to write some code to make GetInnerNode work properly.

Regards,

Kevin

···

On Jul 24, 2010, at 11:48 AM, Matthias wrote:

Am 24.07.2010, 18:05 Uhr, schrieb Kevin Ollivier <kevin-lists@theolliviers.com>:

-Matthias

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Thanks for the tips, Kevin. I've tried the method you proposed. I've bound EVT_LEFT_UP then did the GetSelection() thing. It works very nicely for text elements. But if I click things like images the returned Range is None. I guess that's because the image is not seleted. Binding EVT_MIDDLE_UP does not select anything, so the range is always None then.

The reason why I was looking at HitTest is that I want to implement drag'n'drop between the webkit window and other windows. If HitTest gives me a domNode/domRange then I can query that node for special attributes like onClientDrag="myFunc". Then I'd call myFunc which would return some data that'd be associated with the drag'n'drop operation.

Additionally it would be nice to be able to get the rendered image/area of a given domNode so I could use that for the visualization of the dragging operation. It might be as simple as getting some info from the node, but I haven't tackled that yet.

-Matthias

···

Am 24.07.2010, 21:53 Uhr, schrieb Kevin Ollivier <kevin-lists@theolliviers.com>:

Hi Matthias,

On Jul 24, 2010, at 11:48 AM, Matthias wrote:

Am 24.07.2010, 18:05 Uhr, schrieb Kevin Ollivier >> <kevin-lists@theolliviers.com>:

Hi Matthias,

I'm working on making some adjustments to the bindings now that a generic C++ bindings approach has been committed to WebKit. I'll try to have that ready soon. However, I'm rather confused... I don't think WebViewDOMElementInfo has a GetInnerNode method? WebViewDOMElementInfo is not a DOMElement or a DOMNode.

Hmm, see this:

print win.HitTest( (0,0) ).GetInnerNode

<bound method WebViewDOMElementInfo.GetInnerNode of <wx.webview.WebViewDOMElemen
tInfo; proxy of <Swig Object of type 'wxWebViewDOMElementInfo *' at 0x3464598> >

Maybe it crashes because it's not supposed to be there :smiley: However, there's no other method in WebViewDOMElementInfo which would allow me to retrieve the underlying DOMNode.

Yeah, if I ever exposed that method, it was a mistake and has since been removed. I was probably just returning the WebCore::Node object, which is not a public interface. You might be able to get what you're looking for using:

domrange = win.GetSelection().GetAsRange()

And then iterating through the range to see what's in there. API follows the DOM specification, excepting that it follows wx conventions like adding Get to getters and using CamelCase for API names.

If that doesn't help, then I'll just need to write some code to make GetInnerNode work properly.