Export to GitHub

pywebkitgtk - issue #13

add bindings to DOM model (requires patch to webkit)


Posted on Aug 27, 2008 by Grumpy Rabbit

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

patch also includes javascript execution of #12 which may end up being superceded - POSSIBLY - by the DOM model handling.

Comment #1

Posted on Aug 29, 2008 by Grumpy Rabbit

update.

Comment #2

Posted on Sep 1, 2008 by Grumpy Rabbit

update.

Comment #3

Posted on Oct 27, 2008 by Massive Panda

(No comment was entered for this change.)

Comment #4

Posted on Jan 9, 2009 by Grumpy Rabbit

updated patch which splits out DOM-specific bindings into webkit_glib.defs also up-to-date for webkit svn as of about dec 2008.

Comment #5

Posted on Jan 29, 2009 by Helpful Hippo

Hi ,
I applied the patch f 160 KB but I got this error when compiling :

cd . && automake-1.9 --foreign Makefile /bin/sh: line 11: automake-1.9: command not found make: * [Makefile.in] Erreur 127

any idea please ,

Comment #6

Posted on Jan 29, 2009 by Grumpy Rabbit

hiya, that looks like you don't have automake-1.9 installed (?) what is in line 11? which file?

i think you should be re-running ./autogen.sh

also - you have got the patched version of webkit-glib, yes?

bug #16401

if not, go get the latest code from http://github.com/lkcl/webkit/tree/16401.master

Comment #7

Posted on Apr 23, 2009 by Happy Bird

Doesn't seem like a good idea to rely on branch of webkit, since WebView already exposes a DOMDocument in the ObjC backend.* Seems better to try to get the C/GTK port to implement it.


* http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/WebKit/Classes/WebView_Class/Reference/Reference.html#//apple_ref/occ/instm/WebView/mainFrameDocument

Comment #8

Posted on Apr 23, 2009 by Grumpy Rabbit

the objective-c backend is proprietary and specific to the proprietary apple operating system. it is therefore of absolutely no value to anyone but apple.

if you would like to help, you could help get the patch to webkit into webkit.

Comment #9

Posted on Apr 24, 2009 by Happy Bird

The ObjC backend is not proprietary to Apple, they released it to WebKit. They have their own proprietary branch, but the WebKit branch is BSD licensed.* I just linked to the Apple docs because WebKit doesn't have any standardized API docs. The Windows backend also implements the same interface.** I didn't mean to say that the patch(s) in the WebKit bug tracker shouldn't be supported. I've not reviewed them, or the comments (quite a few of both!) I only meant that it doesn't seem like a good idea to rely on a forked version of WebKit with pywebkit, since, for example, it will break if you deploy with a custom-built pywebkit to a system with vanilla WebKit.


Comment #10

Posted on May 28, 2009 by Massive Panda

Issue 29 has been merged into this issue.

Comment #11

Posted on Jun 4, 2009 by Grumpy Wombat

Comment deleted

Comment #12

Posted on Jun 4, 2009 by Grumpy Wombat

Is this patch integrated into pywebkitgtk? I assume the patches listed above from 2008 are in, but, what about the latest one from Jan 9, 2009?

Comment #13

Posted on Jun 4, 2009 by Grumpy Rabbit

monkeysage: all the more reason, then, as to why you should, if you would like to use python bindings to webkit, that you should get onto the webkit mailing lists, get on to the webkit irc, get on to the webkit bug tracker and continuously request for an explanation as to why this patch is being delayed.

Comment #14

Posted on Jun 4, 2009 by Grumpy Rabbit

sneilan1: no, and it cannot be integrated, until the patch to webkit is integrated. the reason is very very simple: there are 1,500 functions added (all automatic), none of which are there until the patch to webkit is integrated.

therefore, you must get onto the webkit mailing lists, get on to the irc, get on to the webkit bug tracker and continuously request explanations for the delay and express your support for the removal of delays to the integration of the patch.

Comment #15

Posted on Jun 4, 2009 by Massive Panda

Hey y'all! We're aware of this issue. The DOM bindings is one of the tasks in the priority list, and I myself are slowly going through those (Accessibility support comes to mind as well as API work). If this is something really important to you, I encourage you to look at the DOM bindings patch in bugs.webkit.org and help out with the effort. There's a fairly detailed comment on that patch as to what needs to be done first, and people are willing to review patches to get it started!

And please, don't annoy people on the list. It's counter-productive. Everyone's already busy as it is. Contribute if you must!

Comment #16

Posted on Jun 4, 2009 by Massive Panda

(No comment was entered for this change.)

Comment #17

Posted on Jun 4, 2009 by Grumpy Wombat

OK, I'll definitely do that. Didn't mean to annoy you guys, I was just curious, although, now I see the depth of the problem and why ya'll might've been annoyed.

Comment #18

Posted on Jun 4, 2009 by Grumpy Rabbit

hiya jmalonzo,

apple's employees have made unacceptable dictatorial decisions that render the webkit gdom bindings near useless. they raise issues with the patch, which i counter, and then they IGNORE rather than accept the counter-arguments, preferring to stick with "their way".

this is totally unacceptable, and the more people that tell them so, the better.

then, there was the totally disrespectful attitude towards the project that inspired these python bindings (pyjd) and the totally disrespectful attitude towards myself. the lack of respect allowed all progress to be dismissed, which is of course what apple's employees want: total control and a situation in which they are in control.

unfortunately, a number of people actually listened to apple, and ended up wasting their time. the latest group was the people who took on the Vala bindings. they listened to apple, and ended up getting themselves into an awful mess. the result was that they had to abandon contributions to the project.

unfortunately, because they listened to apple, they REMOVED a large section of absolutely critical functionality (event handling) which meant that anything that they did from that point onwards was useless.

imagine if someone did an implementation of javascript DOM bindings, but without onload, onclick, onkeypress etc, and without XMLHTTPRequest asynchronous callbacks.

so - i am starting again, unfortunately ignoring everything that they've done, and am forward-porting the patch.

i'm giving serious consideration to creating a completely separate library.

Comment #19

Posted on Jun 23, 2009 by Grumpy Rabbit

ok - this is an update which matches the current #16401.master update to the webkit/gdom branch. the revision of webkit that it was updated to was r44473. the matching webkit fork is available from: http://github.com/lkcl/webkit/tree/16401.master

Comment #20

Posted on Jun 26, 2009 by Grumpy Rabbit

new version of patch which thanks to kees bos is the beginnings of remapping stupid_glib_naming_convention to properW3CStandardNaming.

Comment #21

Posted on Jun 26, 2009 by Grumpy Rabbit

... btw, obviously, that involves renaming webkit.so to _webkit.so. webkit.py is now auto-generated by create_webkit_wrapper.py - yes, i know, there are better ways to do this but this is a first shot. l.

Comment #22

Posted on Jul 11, 2009 by Grumpy Rabbit

ok another update. i've added a few extra properties and a couple of functions. the auto-generated remapper now works really well. event handling is a little awkward, and ideally needs a bit more work to be made more like e.g. python-xpcom. the auto-generated webkit.py is 70,000 lines but that can't be helped. i'd like to think of a way to do that dynamically, but right now this "works".

to make changes, you MUST install _webkit.so a first time and THEN run create_webkit_wrapper.py because it does "import _webkit".

or put build/.libs into the python path somehow. all very awkward.

Comment #23

Posted on Jul 12, 2009 by Massive Bird

@luke.leighton

compile failed

{{{ make[1]: Entering directory /home/huahua/debs/webkit/pywebkit/r70' (cd . \ && /usr/bin/pygobject-codegen-2.0 \ --register /usr/share/pygtk/2.0/defs/gdk-types.defs \ --register /usr/share/pygtk/2.0/defs/gtk-types.defs \ --override webkit.override \ --prefix pywebkit webkit.defs) 2>&1 >gen-webkit.c | tee webkit.errors \ && ! grep -q -v "^\*\*\*INFO\*\*\*" webkit.errors \ && cp gen-webkit.c webkit.c \ && rm -f gen-webkit.c /usr/share/pygobject/2.0/codegen/definitions.py:42: DeprecationWarning: object.__init__() takes no parameters str.__init__(self, type_name) ***INFO*** There are no declared global functions. ***INFO*** The coverage of methods is 100.00% (410/410) ***INFO*** There are no declared virtual proxies. ***INFO*** There are no declared virtual accessors. ***INFO*** There are no declared interface proxies. make[1]: *** [webkit.c] Error 1 make[1]: Leaving directory/home/huahua/debs/webkit/pywebkit/r70' make: * [all] Error 2 Command exited with non-zero status 2

}}}

Comment #24

Posted on Jul 12, 2009 by Grumpy Rabbit

jhuangjiahua, hi,

you'll need the absolute latest version of #16401.master off of github: please confirm that you have done a "git pull" from http://github.com/lkcl/webkit/tree/16401.master within the past 24 hours.

also, can you get a complete compile listing - "error in webkit.c" is of absolutely no use to anyone. i suspect that code.google.com is interfering. if it is, please place the compile output somewhere where it can be downloaded without interference (perhaps as an attachment).

l.

Comment #25

Posted on Jul 12, 2009 by Grumpy Rabbit

ok i've prepared an update, to the latest svn revision. again, you will need to get latest svn of pywebkitgtk and latest git pull of #16401.master.

that should fix any build issues.

Comment #26

Posted on Jul 26, 2009 by Grumpy Rabbit

ok - another update. this one is for svn revision r46395.

Attachments

Comment #27

Posted on Jun 6, 2010 by Helpful Panda

I believe Luke's path has been integrated into webkit now. https://bugs.webkit.org/show_bug.cgi?id=33590

Should this patch now be integrated into pywebkitgtk ?

Comment #28

Posted on Jun 6, 2010 by Grumpy Rabbit

i've just gone over webkit 33590, taking a quick look at it, and i find that there are significant features missing, such as event handling. that means that as it stands, the patch is not going to apply: it is specifically dependent on what functions are available via glib/gobject bindings. it will be necessary to re-run h2defs.py to re- generate the .defs file, removing the auto-generated functions on which the last- submitted patch applies.

Comment #29

Posted on Oct 23, 2010 by Massive Panda

I've regenerated a webkitdom.defs file based on the bindings that's available upstream. Code's currently in http://github.com/jmalonzo/pywebkitgtk/.

To use it, get the Document by calling WebView.get_dom_document and take it from there. Unfortunately, the only documentation atm is the .defs file.

Cheers.

Status: Started

Labels:
Type-Enhancement Priority-Medium