[webkit-dev] webkit glib DOM bindings demo code
here's a second example: static void walk_table_node(GdomNode *node) { GdomNode *child; g_object_get(node, first_child, child, NULL); while (child) { gchar *name; g_object_get(child, node_name, name, NULL); printf(table child node %s\n, name); if (strcmp(name, tr) == 0) { walk_tr_node(child); /* etc. etc. */ } g_object_get(child, next_sibling, child, NULL); } } void walk_all_tables (void) { GdomDocument *doc = get_dom_document(); GdomNodeList *els; gulong tags_length; gulong i; els = gdom_document_get_elements_by_tag_name(doc, table); g_object_get(els, length, tags_length, NULL); printf(table count: %d\n, tags_length); for (i = 0; i tags_length; i++) { walk_table_node(gdom_node_list_item(els, i)); } } as can be seen: * els = document.getElementsByTagName(table) is replaced by gdom_document_get_elements_by_tag_name(doc, table); * els.length is replaced by g_object_get(els, length, NULL); where length MUST be an unsigned long (not an unsigned int - i made that mistake already :) it's VITAL to check the idl file - NodeList.idl in this case) * els.item(i) is replaced by gdom_node_list_item(els, i); * node.firstChild, node.nodeName, node.nextSibling all again use g_object_get() to obtain those properties. this is all in c. it's the same sort of thing in python with pywebkitgtk - except _slightly_ less messy. in pyjamas-desktop, once i get round to it, the messy names will go away, and revert back to moreSensibleNamingSchemes. i'm recommending to change the naming schemes back to more sensible ones than_this_stupid_looking_one, on the basis that the convention has already been decided by netscape, and is now a specification. mozilla doesn't do this (in xul interface bindings), so why it's being done here is ... it just makes things _bizarre_. thoughts, anyone? l. ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] webkit glib DOM bindings demo code
Am Mon, 8 Dec 2008 14:03:46 + schrieb Luke Kenneth Casson Leighton [EMAIL PROTECTED]: this is all in c. it's the same sort of thing in python with pywebkitgtk - except _slightly_ less messy. in pyjamas-desktop, once i get round to it, the messy names will go away, and revert back to moreSensibleNamingSchemes. i'm recommending to change the naming schemes back to more sensible ones than_this_stupid_looking_one, on the basis that the convention has already been decided by netscape, and is now a specification. mozilla doesn't do this (in xul interface bindings), so why it's being done here is ... it just makes things _bizarre_. thoughts, anyone? Hey Luke, I suggest you accept the fact that coding style and naming are a matter of preference and convention. A Glib specific binding should really adapt the API style, even if there coding style in the implementation may differ. If JavaScript sources dominantly use camelCase that's what functions in JavaScript should and usually do conform to. If Glib interfaces dominantly use under_scores then that's what functions in Glib libraries should and usually do conform to. It's as simple as that. Convincing anyone of your preferred coding and naming style is not going to help. :) ciao, Christian ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
[webkit-dev] Out-of-memory handling
Hi Webkit Folks! We are thinking about how to deal with out-of-memory situation. A tempting approach would be using exception handling. E.g., what if we could catch a bad_alloc exception? Would there be any way to simply force WebKit from the browser to shutdown itself? When I say shutdown, I mean exiting in an elegant way, e.g., we could save history and other important information to disk (so that when the browser restarts, some info does not get lost). Particularly, we are working with the Qt port, but we are interested in a general solution as well. Best regards, Balázs Kelemen ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] Out-of-memory handling
On Dec 8, 2008, at 8:21 AM, Kelemen Balázs wrote: A tempting approach would be using exception handling. E.g., what if we could catch a bad_alloc exception? To use exception handling you'd probably have to change all the WebKit code to do cleanup when an exception is propagating. Otherwise, exiting an arbitrary function half way through could leave data structures in an inconsistent state. Fixing this is a large project, almost certainly impractical. Would there be any way to simply force WebKit from the browser to shutdown itself? When I say shutdown, I mean exiting in an elegant way, e.g., we could save history and other important information to disk (so that when the browser restarts, some info does not get lost). Sure, you could do that if you make sure that the important information is stored in data structures that have some sort of integrity guarantee, which are not manipulated directly by the WebCore/ WebKit code. And make sure the code that writes those data structures can function without allocating additional memory. But I don't think there's any real advantage to using exception handling for this. You could have a function called when out of memory that does this work. Another approach is to save history and other important information as you go. So if you run out of memory there's nothing that needs to be done. -- Darin ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
[webkit-dev] Buildbot results
Hi All, I would need the results of the buildbots since it was started but on the http://build.webkit.org/waterfall page I found the results of about the last month. Could you tell me if the results of the buildbots are available for older revisions too? Thanks, Peter Siket ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
[webkit-dev] C++ API access to DOM tree [Win32]
Hi, how can I access the DOM from C++ APIs on Windows. Many methods like firstChild etc for Interface IDOMNode return E_NOTIMPL. I can get access to IDOMDocument pointer and then to the IDOMNode pointer for the 'BODY' tag. But without the childNodes etc. methods being implemented how can I traverse the DOM tree, infer attributes and offsets? Thanks, Nirman ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
[webkit-dev] [GTK] Segment fault when I run Gtklauncher
Hello everyone. Today I updated my webkit-svn to revision 39121, complied webkit on Ubuntu 8.04, and then ran Gtklauncher. But I cannot execute Gtklauncher because of unknown segment fault. Please help me to run Gtklauncher. Best regards, Sungjun, KIM ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] [GTK] Segment fault when I run Gtklauncher
Do you have a gdb trace ? On Tue, Dec 9, 2008 at 11:28 AM, sMiLo [EMAIL PROTECTED] wrote: Hello everyone. Today I updated my webkit-svn to revision 39121, complied webkit on Ubuntu 8.04, and then ran Gtklauncher. But I cannot execute Gtklauncher because of unknown segment fault. Please help me to run Gtklauncher. Best regards, Sungjun, KIM ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev -- Sriram Neelakandan Author - Embedded Linux System Design And Development ( http://tinyurl.com/2doosu) ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev