W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2008

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

From: L. David Baron <dbaron@dbaron.org>
Date: Fri, 14 Nov 2008 08:43:23 -0800
Message-ID: <20081114164323.GA17499@pickering.dbaron.org>
On Friday 2008-11-14 11:37 +0100, 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 ...)

I'm not quite sure how this would work, since there are two things
that seem incompatible:

 * scripts are executed during parsing / content model construction

 * whether a media attribute is true can change over time

This seems to imply that we'd have to go un-execute a script, or
that we'd have to execute later something that was skipped earlier,
even when that no longer makes sense.


What was the actual use case you were trying to solve with this
attribute?

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Friday, 14 November 2008 08:43:23 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:07 UTC