questions: partial interfaces, text for WebIDL Constructor

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

questions: partial interfaces, text for WebIDL Constructor

Dan Burnett-3
Hi.  I'm a new user of ReSpec.js, having started with it last week as the framework for the WebRTC specification.  I've run into a couple of WebIDL items I can't seem to figure out and wondered if anyone on this list might be able to help.  They are:

1) Specifying a "partial interface" seems to result in a failure.  In particular, specifying

partial interface URL {
  static DOMString createObjectURL(in MediaStream stream);
};

as


<dl title='partial interface URL' class='idl'>
  <dt>static DOMString createObjectURL (in MediaStream stream)</dt>
  <dd>Text description here</dd>
</dl>

gives me the following error:

        • Expected definition, got: partial interface URL
        • Processing error: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMDocumentFragment.appendChild]" nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)" location: "JS frame :: file:///Users/burn/Documents/webrtc/2009/dap/ReSpec.js/js/respec.js :: anonymous :: line 1976" data: no]

Are partial interfaces not supported?


2)  I would like to provide a text description for the constructor method ("new Blah") itself, but I haven't yet found a way.  Has anyone else figured out a way to get the constructor itself to show up in the list of methods, with a way to provide descriptive text for it?

For example, using the extended attribute example in the WebIDL testing document (http://dev.w3.org/2009/dap/ReSpec.js/test-spec/webidl.html#extended-attribute), if I wanted to provide a description of the behavior of "new Dahut" along with the IDL, how would I?


-- Dan Burnett



Reply | Threaded
Open this post in threaded view
|

Re: questions: partial interfaces, text for WebIDL Constructor

Robin Berjon-2
Hi,

sorry for the delay in replying, I've been on vacation.

On Aug 1, 2011, at 22:17 , Dan Burnett wrote:

> 1) Specifying a "partial interface" seems to result in a failure.  In particular, specifying
>
> partial interface URL {
>  static DOMString createObjectURL(in MediaStream stream);
> };
>
> as
>
>
> <dl title='partial interface URL' class='idl'>
>  <dt>static DOMString createObjectURL (in MediaStream stream)</dt>
>  <dd>Text description here</dd>
> </dl>
>
> gives me the following error:
>
> • Expected definition, got: partial interface URL
> • Processing error: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMDocumentFragment.appendChild]" nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)" location: "JS frame :: file:///Users/burn/Documents/webrtc/2009/dap/ReSpec.js/js/respec.js :: anonymous :: line 1976" data: no]
>
> Are partial interfaces not supported?

No, they're not. ReSpec isn't yet up to date with the latest and greatest WebIDL (also, features tend to get added when someone complains that they're not there :). I should be getting around to adding support for this shortly, please let me know if there are specific ways in which you'd like such interfaces to be rendered.

(Please note that you can use http://code.w3.org/respec/ to enter issues as well)

> 2)  I would like to provide a text description for the constructor method ("new Blah") itself, but I haven't yet found a way.  Has anyone else figured out a way to get the constructor itself to show up in the list of methods, with a way to provide descriptive text for it?
>
> For example, using the extended attribute example in the WebIDL testing document (http://dev.w3.org/2009/dap/ReSpec.js/test-spec/webidl.html#extended-attribute), if I wanted to provide a description of the behavior of "new Dahut" along with the IDL, how would I?

This is also not supported. To date I think people have mostly used free-text descriptions of the interface. I'm happy to add support for this as well, but I'd be thankful for syntax suggestions. Since you have the need at hand, what would be the most natural way for you to mark this up?

--
Robin Berjon - http://berjon.com/ - @robinberjon


Reply | Threaded
Open this post in threaded view
|

Re: questions: partial interfaces, text for WebIDL Constructor

Robin Berjon-2
In reply to this post by Dan Burnett-3
Hi Dan,

On Aug 1, 2011, at 22:17 , Dan Burnett wrote:
> 1) Specifying a "partial interface" seems to result in a failure.  In particular, specifying

I've now added support for partials. Tell me if it works for you!

> 2)  I would like to provide a text description for the constructor method ("new Blah") itself, but I haven't yet found a way.  Has anyone else figured out a way to get the constructor itself to show up in the list of methods, with a way to provide descriptive text for it?

I can probably add this rather easily but I can't seem to think of a syntax that would feel natural to write it up. What would seem nicest to you in order to support this?

--
Robin Berjon - http://berjon.com/ - @robinberjon