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

Charles McCathieNevile chaals at opera.com
Sun Dec 28 22:23:52 PST 2008

On Mon, 29 Dec 2008 16:26:58 +1100, Ian Hickson <ian at hixie.ch> wrote:

> 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?

Only some mobile browsers use media types (as opposed to the more  
complicated approach of full media queries) to customise presentation.

> What has costly implications? What implications?

If the thing changes and you are dynamically following it, then you  
potentially have to re-run scripts (this is from David Baron's mail in  
this thread).

>> 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.

Ah, OK. Thanks.

Actually, a lot of scripting is stuff that you don't really need at all,  
and would drop or cut back for certain media types. But I see your use  
case for XBL.



Charles McCathieNevile  Opera Software, Standards Group
     je parle français -- hablo español -- jeg lærer norsk
http://my.opera.com/chaals       Try Opera: http://www.opera.com

More information about the whatwg mailing list