[whatwg] Re: media types
jax at opera.com
Mon Jul 26 06:08:18 PDT 2004
On Mon, 26 Jul 2004 12:43:08 +0100, Malcolm Rowe
<malcolm-what at farside.org.uk> wrote:
> Mark Schenk writes:
>> Therefor I would like to suggest a read-only "window.medium" set to a
>> media type ("screen" | "print" | "projection" | "tv" | "handheld" |
>> "speech" etc).
> Not a bad idea, I suppose, but I'd like to understand more about the use
> case for this kind of functionality. What *behaviour* (not presentation,
> since that would be CSS) do you expect you'd change based on the active
> media type?
The most immediate use cases would be to have presentation-type behaviours
for projection, or less behaviours for handheld.
> [Hmm, you could probably emulate this now: by using CSS's @media blocks,
> and then detecting what style rules were active from script.]
Yes you can, but that must be considered a rather ugly hack.
> Secondly, is 'the current media type' only ever a single value, or can
> more than one media type be active at one time (e.g., 'projection'
> + 'screen'?).
No, a given canvas can only have one media type. Projection and screen
(and print and ...) are mutually exclusive. But you can have different
media type for each window.
> Finally, 'window.medium' is a really bad choice for the name. I know
> that 'medium' is the right word (if only one can be active), but
> no-one's going to associate 'medium' with 'active media type'.
> 'mediaType' would be better.
This would be more confusing. Whether or not this is a good habit, many
window and document properties have been aliased, and document.mediaType
would be more likely to be assumed to be the MIME content type (e.g.
Opera Software ASA
More information about the whatwg