[whatwg] attribute "media" on "script" element

Ian Hickson ian at hixie.ch
Sun Dec 28 21:26:58 PST 2008


On Mon, 29 Dec 2008, Charles McCathieNevile wrote:
> On Sat, 15 Nov 2008 08:18:25 +1100, Ian Hickson <ian at hixie.ch> wrote:
> > On Fri, 14 Nov 2008, Filippo Levizzani wrote:
> > > 
> > > Would it be possible to have "media" attribute in the SCRIPT 
> > > element? Addmitted vaues would be the same of STYLE element (all, 
> > > screen, print, handheld ...)
> > 
> > This doesn't really work because media queries are supposed to change 
> > dynamically. The real solution here is a combination of XBL2 and a new 
> > API in the CSSOM-View draft (window.media).
> 
> I can see the value in this (but then, I also see the value in media 
> types in styling - something it seems some browser makers are not really 
> interested in), and I agree with David's concern that it can have some 
> pretty costly implications.

I don't really understand what you mean here. How are browser vendors not 
interested in media types in styling? What has costly implications? What 
implications?


> Can you explain why XBL2 is part of the solution here? It seems you have 
> something in mind that I don't understand yet.

Media-specific scripting is usually needed for media-specific presentation 
or widgets. XBL2 is a way to define widgets, and it can be bound in a 
media-specific way. Thus for instance one could create a set of widgets 
for different window widths, and they would dynamically be swapped in as 
the user changed the window size.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list