Loading ...
Sorry, an error occurred while loading the content.

2 Problems with CSS @media

Expand Messages
  • Owen
    Validating the following fragment: Test @media print { .noprint {display: none; } }
    Message 1 of 3 , Jul 14 7:11 AM
    • 0 Attachment
      Validating the following fragment:
      <html>
      <head>
      <title>Test</title>
      <style type="text/css">
      @media print {
      .noprint {display: none; }
      }
      </style>
      </head>
      <body>
      Body
      </body>
      </html>

      I get the message: "Problem at line 5 character 8: Expected a CSS media type, and instead saw 'print'." If I instead change print to something invalid (e.g. printz), I now pass. This is almost certainly because the test "css_media[next_token.string] === true" at around line 5991 should be !== rather than ===.

      However, even with that change, all is not well. I now get the error "Problem at line 7 character 1: Unexpected '}'." The bracket is certainly needed, but, if I nevertheless remove it, I now see "Problem at line 8 character 1: Expected '}' and instead saw '</'." So I can't have the bracket, and I can't not have it.
    • Douglas Crockford
      ... Thanks. Please try it now.
      Message 2 of 3 , Jul 14 11:08 AM
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "Owen" <eclipsechasers2@...> wrote:
        >
        > Validating the following fragment:
        > <html>
        > <head>
        > <title>Test</title>
        > <style type="text/css">
        > @media print {
        > .noprint {display: none; }
        > }
        > </style>
        > </head>
        > <body>
        > Body
        > </body>
        > </html>
        >
        > I get the message: "Problem at line 5 character 8: Expected a CSS media type, and instead saw 'print'."


        Thanks. Please try it now.
      • Owen
        Works well! Thanks.
        Message 3 of 3 , Jul 14 8:02 PM
        • 0 Attachment
          Works well! Thanks.

          --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
          >
          > --- In jslint_com@yahoogroups.com, "Owen" <eclipsechasers2@> wrote:
          > >
          > > Validating the following fragment:
          > > <html>
          > > <head>
          > > <title>Test</title>
          > > <style type="text/css">
          > > @media print {
          > > .noprint {display: none; }
          > > }
          > > </style>
          > > </head>
          > > <body>
          > > Body
          > > </body>
          > > </html>
          > >
          > > I get the message: "Problem at line 5 character 8: Expected a CSS media type, and instead saw 'print'."
          >
          >
          > Thanks. Please try it now.
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.