Why is 'projection' an invalid value for the media attribute in a link tag?
Asked Answered
C

3

5

According to the w3.org validator:

<link rel="stylesheet" href="css/style.css" media="screen, projection, tv" />   

does not seem to be valid anymore due to the projection value.

I don't remember exactly, but this way Opera in Fullscreen is included. Probably Opera will load the file with media="screen" too.

Why is this invalid now? Is there another way to give extra CSS to "fullscreen / projection" devices?

Cori answered 14/7, 2015 at 15:30 Comment(0)
V
7

Maintainer of the W3C HTML checker here. About 3 weeks ago, I implemented and pushed to the production W3C HTML checker the change that emits these new errors; this change: https://github.com/validator/validator/commit/66c739a49afd050226a91f2b7f49662e0dcc9a09

I made that change in order to bring the HTML checker in conformance with the current CSS Media Queries spec. As noted in an earlier answer:

[...] MQ4 basically deprecates all the CSS2.1 media types except all, print, screen and speech, citing the use of media feature detection instead, saying:

In addition, the following deprecated media types are defined. Authors must not use these media types; instead, it is recommended that they select appropriate media features that better represent the aspect of the device that they are attempting to style against.

Presumably, the validator is marking the value invalid because it violates the stipulation that "Authors must not use these media types".

Valoniah answered 28/7, 2015 at 2:45 Comment(1)
Thanks for pointing that out. drafts.csswg.org//mediaqueries/#media-types "User agents must recognize the following media types as valid, but must make them match nothing." Knowing that, I understand your changes to the conformance checker.Cori
O
4

The complete error message says:

Bad value screen, projection, tv for attribute media on element link: Deprecated media type projection. For guidance, see the Media Types section in the current Media Queries specification.

... and "the current Media Queries specification" links to Media Queries 4, which is currently in development. MQ4 basically deprecates all the CSS2.1 media types except all, print, screen and speech, citing the use of media feature detection instead, saying:

In addition, the following deprecated media types are defined. Authors must not use these media types; instead, it is recommended that they select appropriate media features that better represent the aspect of the device that they are attempting to style against.

Presumably, the validator is marking the value invalid because it violates the stipulation that "Authors must not use these media types".

Observation answered 14/7, 2015 at 15:42 Comment(0)
C
1

I think it’s valid HTML5:

  1. The media attribute of the link element says:

    The value must be a valid media query.

  2. It links to this definition of "valid media query";

    A string is a valid media query if it matches the media_query_list production of the Media Queries specification. [MQ]

  3. It links to this specification:

    Media Queries (URL: http://www.w3.org/TR/css3-mediaqueries/), H. Lie, T. Çelik, D. Glazman, A. van Kesteren. W3C.

  4. The current Recommendation of http://www.w3.org/TR/css3-mediaqueries/ is:

    http://www.w3.org/TR/2012/REC-css3-mediaqueries-20120619/

  5. The mentioned media_query_list is defined in section 3:

    The media query syntax is described in terms of the CSS2 grammar. As such, rules not defined here are defined in CSS2. The media_query_list production defined below replaces the media_list production from CSS2. [CSS21]

  6. It links to the Recommendation http://www.w3.org/TR/2011/REC-CSS2-20110607

  7. projection is one of the recognized media types

Chunky answered 17/7, 2015 at 9:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.