Re: [widgets-twi] window object

Le 05/02/2010 16:18, Marcos Caceres a écrit :
> On Thu, Feb 4, 2010 at 6:41 PM, Cyril Concolato<cyril.concolato@enst.fr>  wrote:
>> Hi all,
>>
>> After P&C, I'm looking now at the Widget Interface spec, in particular to
>> check the test suite and produce the implementation report. I have a problem
>> with the spec. In GPAC, we implement only SVG not HTML5, with the Window
>> object.
>
> Hmm... to support SVG, what we should do is externalize the javascript
> of each test. Then just use a script element to include the same code
> into both files. Do you think you could help me do this?
>
> Basically, what we would need to do is:
>
> 1. check if the current scripts work in an SVG context - and fix if they don't.
> 2. make the SVG templates (index.svg).
> 3. externalize all the JS (call them all test.js).
> 4. Replace all the HTML files.
Here is a first try. I've made the test.js with the widget related code and the SVG/HTML related code is in the SVG/HTML file. However, since there is no explicit normative way to implement the widget object when the start file is SVG I had to decide on one. So I've added the following code in test.js:
   
   var w;
   if (typeof(window.widget) != "undefined") {
     w = window.widget;
   } else if (typeof(widget) != "undefined") {
     w = widget;
   }  

Is it ok?

>
> I'm not sure what we will do with all the automatically generated
> tests. We will need some guidance there from Dom, as I don't know how
> that generator works.
>
>> So I'm wondering how should the widget object be implemented in a UA
>> that does not support the window object ?
>
> Yeah, that's a tough one... the spec says:
>
> "For a widget instance, a user agent MUST expose a unique object that
> implements the widget interface to author scripts."
>
> It does not give any guidance as to how the interface must be exposed.
What was the rationale for having the widget object as an attribute of the window object. Why not put in the global object, this would avoid having to handle it differently in each language?

Cyril
>
>


-- 
Cyril Concolato
Maître de Conférences/Associate Professor
Groupe Mutimedia/Multimedia Group
Telecom ParisTech
46 rue Barrault
75 013 Paris, France
http://concolato.blog.telecom-paristech.fr/

Received on Friday, 5 February 2010 17:45:19 UTC