This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26195 - disallow comments in media queries in the "media" attribute
Summary: disallow comments in media queries in the "media" attribute
Status: RESOLVED WONTFIX
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-25 13:35 UTC by Michael[tm] Smith
Modified: 2014-09-29 16:40 UTC (History)
2 users (show)

See Also:


Attachments

Description Michael[tm] Smith 2014-06-25 13:35:51 UTC
Please consider making the spec state that media queries in the "media" attribute must not contain CSS comments. (In other words, that authors must not use comments in media queries in the "media" attribute.)

I can't think of any sane use cases for allowing CSS comments in there.

UAs would still need to support parsing of "media" values that contain comments but conformance checkers would report them as invalid.
Comment 1 Ian 'Hixie' Hickson 2014-08-29 21:06:36 UTC
If they work everywhere, what's the value of disallowing them?
Comment 2 Michael[tm] Smith 2014-09-28 10:07:38 UTC
(In reply to Ian 'Hixie' Hickson from comment #1)
> If they work everywhere, what's the value of disallowing them?

The value is that there's no good reason for HTML attribute values to contain CSS comments, so just because HTML @media attribute parsers handle CSS comments, that doesn't mean we should implicitly encourage authors to use them. Postel's law and all that. We obviously have plenty of other examples in HTML where the document-conformance rules are stricter than the parsing rules.

But I don't feel strongly about it at this point. Feel free to wontfix this.
Comment 3 Ian 'Hixie' Hickson 2014-09-29 16:40:03 UTC
There's not really any good reason for media queries in general to have inline comments, but that's what the CSS specs allow. I think it's something we should leave up to the CSS side, rather than try to invent a new authoring syntax just for the media="" attribute.