[Webkit-unassigned] [Bug 16401] [GTK] GObject/C DOM binding

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 11 08:47:46 PST 2009


------- Comment #147 from adam at yorba.org  2009-02-11 08:47 PDT -------
(In reply to comment #145)
> adam,
> when removing all of the "differences" between javascript and gobject
> bindings, did you also remove the XMLHttpRequest open() function as a
> string rather than as a TextDocument?

Actually you mean the XMLHttpRequest send() function.  A bit of background: the
W3C XMLHttpRequest draft specification
(http://www.w3.org/TR/2008/WD-XMLHttpRequest-20080415/) includes several
overloaded versions of send():

  void send();
  void send(in DOMString data);
  void send(in Document data);

In WebKit's XMLHttpRequest.idl, the first two of these are commented out,
although the underlying WebKit XMLHttpRequest object actually supports all
three of these.  I believe that the WebKit team has commented out overloaded
functions wherever they occur in IDL files because certain language bindings
can't handle overloads.  C, in particular, doesn't allow overloaded functions,
so if all three send() methods were exposed today, the GObject bindings would
fail to compile.

So only send(in Document data) is available at the moment.  You might be able
to use that to do AJAX now: from any Document object you can get a
DOMImplementation, which you could possibly use to construct new Document
objects containing arbitrary text.  I haven't tried that myself, however.

The current patch does not include any changes to XMLHttpRequest.idl.  If you'd
like that IDL file to expose a different overload of send(), I'd suggest you
take that up in an independent bug report; that change would affect other
language bindings and is essentially independent of the GObject changes here.

The best solution here would be to uncomment overloaded functions in the IDL
and make the language bindings generators smart enough to map them into
non-overloaded functions using alternate names when necessary.  We could either
(a) have the bindings generators derive alternate names automatically, e.g.
send_DOMString() and send_Document(), and/or (b) add IDL attributes that
suggest alternate names.  I'd love to see that happen, but I think that's
beyond the scope of this first GObject/DOM iteration.

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

More information about the webkit-unassigned mailing list