Weird error on W3C css validator

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave Rado

    Weird error on W3C css validator

    Hi

    The W3C css validation service at http://jigsaw.w3.org/css-validator/
    claims that:

    {font-family: "Book Antiqua", Palatino, "Times New Roman", "Times
    Roman" serif}

    is invalid on the grounds that "Too many values or values are not
    recognized "

    Given that those fonts are very widely used and most are standard
    Windows fonts, any idea why I'm getting this weird message from the
    validator?

    Dave
  • Dave Rado

    #2
    Re: Weird error on W3C css validator

    On 12 May, 16:54, Dave Rado <dave.r...@dsl. pipex.comwrote:
    Hi
    >
    The W3C css validation service athttp://jigsaw.w3.org/css-validator/
    claims that:
    >
    {font-family: "Book Antiqua", Palatino, "Times New Roman", "Times
    Roman" serif}
    >
    is invalid on the grounds that "Too many values or values are not
    recognized "
    >
    Given that those fonts are very widely used and most are standard
    Windows fonts, any idea why I'm getting this weird message from the
    validator?
    >
    Dave
    It's okay I've discovered that the word Serif needed to have a capital
    "S". Not a very helpful error message though!!

    Dave

    Comment

    • Steve Pugh

      #3
      Re: Weird error on W3C css validator

      On May 12, 5:03 pm, Dave Rado <dave.r...@dsl. pipex.comwrote:
      On 12 May, 16:54, Dave Rado <dave.r...@dsl. pipex.comwrote:
      >
      >
      >
      Hi
      >
      The W3C css validation service athttp://jigsaw.w3.org/css-validator/
      claims that:
      >
      {font-family: "Book Antiqua", Palatino, "Times New Roman", "Times
      Roman" serif}
      >
      is invalid on the grounds that "Too many values or values are not
      recognized "
      >
      Given that those fonts are very widely used and most are standard
      Windows fonts, any idea why I'm getting this weird message from the
      validator?
      >
      Dave
      >
      It's okay I've discovered that the word Serif needed to have a capital
      "S". Not a very helpful error message though!!
      When you changed it to a capital S did you also add the missing comma?

      "Times Roman" serif should be "Times Roman", serif

      By the spec you don't need a capital letter but you do need a comma.

      Steve


      Comment

      • Sherman Pendley

        #4
        Re: Weird error on W3C css validator

        Dave Rado <dave.rado@dsl. pipex.comwrites :
        The W3C css validation service at http://jigsaw.w3.org/css-validator/
        claims that:
        >
        {font-family: "Book Antiqua", Palatino, "Times New Roman", "Times
        Roman" serif}
        >
        is invalid on the grounds that "Too many values or values are not
        recognized "
        You're missing the comma between "Times Roman" and "serif".

        sherm--

        --
        My blog: http://shermspace.blogspot.com
        Cocoa programming in Perl: http://camelbones.sourceforge.net

        Comment

        • dorayme

          #5
          Re: Weird error on W3C css validator

          In article
          <b17b5af6-d783-4271-b6c1-aa43e0693c6d@t5 4g2000hsg.googl egroups.com>,
          Dave Rado <dave.rado@dsl. pipex.comwrote:
          Hi
          >
          The W3C css validation service at http://jigsaw.w3.org/css-validator/
          claims that:
          >
          {font-family: "Book Antiqua", Palatino, "Times New Roman", "Times
          Roman" serif}
          >
          is invalid on the grounds that "Too many values or values are not
          recognized "
          >
          Given that those fonts are very widely used and most are standard
          Windows fonts, any idea why I'm getting this weird message from the
          validator?
          >
          You should have a "," after "Times Roman"

          --
          dorayme

          Comment

          • John Hosking

            #6
            Re: Weird error on W3C css validator

            Dave Rado wrote:
            On 12 May, 16:54, Dave Rado wrote:
            >>
            >The W3C css validation service at http://jigsaw.w3.org/css-validator/
            >claims that:
            >>
            >{font-family: "Book Antiqua", Palatino, "Times New Roman", "Times
            >Roman" serif}
            >>
            >is invalid on the grounds that "Too many values or values are not
            >recognized "
            >
            It's okay I've discovered that the word Serif needed to have a capital
            "S". Not a very helpful error message though!!

            The fact that the behavior changed reminds me of that old song...

            "Comma, comma, comma, comma, comma, chameleon..."
            -Boy George, Culture Club


            --
            John
            At least I *think* that's what he was singing...

            Comment

            • dorayme

              #7
              Re: Weird error on W3C css validator

              In article <4828ee88$1_3@n ews.bluewin.ch> ,
              John Hosking <John@DELETE.Ho sking.name.INVA LIDwrote:
              Dave Rado wrote:
              On 12 May, 16:54, Dave Rado wrote:
              >
              The W3C css validation service at http://jigsaw.w3.org/css-validator/
              claims that:
              >
              {font-family: "Book Antiqua", Palatino, "Times New Roman", "Times
              Roman" serif}
              >
              is invalid on the grounds that "Too many values or values are not
              recognized "
              >

              It's okay I've discovered that the word Serif needed to have a capital
              "S". Not a very helpful error message though!!
              >
              >
              The fact that the behavior changed reminds me of that old song...
              >
              "Comma, comma, comma, comma, comma, chameleon..."
              -Boy George, Culture Club
              The Boy George official site is under construction and has three html
              errors at least. It looks so promising though.

              --
              dorayme

              Comment

              • Dave Rado

                #8
                Re: Weird error on W3C css validator

                On 12 May, 22:32, dorayme <doraymeRidT... @optusnet.com.a uwrote:
                You should have a "," after "Times Roman"
                >
                --
                dorayme
                Yes, sorry.

                I still think the validator's error message was very unhelpful though.

                Dave

                Comment

                • Harlan Messinger

                  #9
                  Re: Weird error on W3C css validator

                  Dave Rado wrote:
                  On 12 May, 22:32, dorayme <doraymeRidT... @optusnet.com.a uwrote:
                  >
                  >You should have a "," after "Times Roman"
                  >>
                  >--
                  >dorayme
                  >
                  Yes, sorry.
                  >
                  I still think the validator's error message was very unhelpful though.
                  All the validator knew at the point where it reached "serif"--or even
                  just the "s"--was that it was expecting to see one of the following but
                  not seeing any of them (not sure this is an exhaustive list): a comma;
                  !important; a semicolon; or the end of the list. It can't tell you
                  "you're missing a comma" because it doesn't know from its point of view
                  that that's the nature of the problem. Granted, the least it could do is
                  show you the position of the character where it identified the presence
                  of a problem.

                  Comment

                  • Andreas Prilop

                    #10
                    Re: Weird error on W3C css validator

                    On Tue, 13 May 2008, dorayme wrote:
                    >{font-family: "Book Antiqua", Palatino, "Times New Roman", "Times
                    >Roman" serif}
                    >
                    You should have a "," after "Times Roman"
                    You should have a "," after "Times".

                    There's "Times New Roman" and there's "Times".
                    But "Times Roman" is not the name of a typeface family, afaik.
                    The Times typeface family consists of
                    Times Roman, Times Italic, Times Bold, Times Bold Italic.

                    /*
                    I'm still convinced that the name "Times New Roman" for
                    a typeface *family* is a misnomer. It ought to be Times New.
                    */

                    --

                    Comment

                    • Harlan Messinger

                      #11
                      Re: Weird error on W3C css validator

                      Harlan Messinger wrote:
                      Dave Rado wrote:
                      >On 12 May, 22:32, dorayme <doraymeRidT... @optusnet.com.a uwrote:
                      >>
                      >>You should have a "," after "Times Roman"
                      >>>
                      >>--
                      >>dorayme
                      >>
                      >Yes, sorry.
                      >>
                      >I still think the validator's error message was very unhelpful though.
                      >
                      All the validator knew at the point where it reached "serif"--or even
                      just the "s"--was that it was expecting to see one of the following but
                      not seeing any of them (not sure this is an exhaustive list): a comma;
                      !important; a semicolon; or the end of the list. It can't tell you
                      "you're missing a comma" because it doesn't know from its point of view
                      that that's the nature of the problem. Granted, the least it could do is
                      show you the position of the character where it identified the presence
                      of a problem.
                      On reflection I realize I was missing the fact that the validator DID
                      tell you something specific: that there were too many values. It DID
                      construe "serif" to be a value *because* it followed the preceding items
                      without an intervening comma, semicolon, etc. The problem is you not
                      knowing what they meant by "value". CSS has composite properties like
                      font, border, margin, etc., that can set several individual properties
                      at once--for example, you can use font to set several font-related
                      properties:

                      font: serif 1.2em italic;

                      This example has three values.

                      It's weird, but CSS uses commas to separate alternatives *within* a
                      value while it uses spaces to separate values. So in

                      "Book Antiqua", Palatino, "Times New Roman", "Times
                      Roman" serif

                      one value is

                      "Book Antiqua", Palatino, "Times New Roman", "Times
                      Roman"

                      and the other is

                      serif

                      Since font-family isn't a composite property, it takes only one value,
                      so the validator characterized the error as an excess of values.

                      Comment

                      • Jukka K. Korpela

                        #12
                        Re: Weird error on W3C css validator

                        Scripsit Harlan Messinger:

                        [discussing error reporting for
                        {font-family: "Book Antiqua", Palatino, "Times New Roman", "Times
                        Roman" serif} ]
                        All the validator knew at the point where it reached "serif"--or even
                        just the "s"--was that it was expecting to see one of the following
                        but not seeing any of them (not sure this is an exhaustive list): a
                        comma; !important; a semicolon; or the end of the list.
                        Actually, "end of the list" doesn't belong here - it's not a syntactic
                        construct as such.
                        It can't tell
                        you "you're missing a comma" because it doesn't know from its point
                        of view that that's the nature of the problem. Granted, the least it
                        could do is show you the position of the character where it
                        identified the presence of a problem.
                        It _could_ also tell that it was expecting one of ",", "!important ", and
                        ";", as you wrote. But this would probably require a major rewrite of
                        the program. Moreover, with some extra analysis, it could tell that
                        indeed a comma is apparently missing, since adding a comma is the
                        minimal change that makes the construct syntactically correct. Or,
                        perhaps simpler, since serif is a keyword with a specific meaning, it
                        cannot start a new declaration or a new rule, so a comma is what is
                        missing.

                        If the construct had
                        "Times Roman" foobar}
                        then such an analysis would not be possible without lookahead, since
                        taken locally, the problem might be a missing "}" and foobar might be a
                        selector, starting a new rule. With lookahead, it might be possible to
                        judge that this is less like than missing ",".

                        Advanced error reporting and recovery is possible but it means tedious
                        work (though this depends on the syntax of the language - CSS is
                        relatively easy in this respect). Moreover, the risk of issuing very
                        confusing messages when trying to be helpful is very real. (Been there,
                        done that.)

                        In practical terms, a person who checks a stylesheet must be assumed to
                        know CSS well and to figure out, from good references, where the problem
                        really is. Automatic checking effectively just tells that _something_ is
                        wrong and coarsely identifies the location of the problem. Helpful error
                        messages would be nice, but I can understand that there is little
                        motivation for working on them.

                        --
                        Jukka K. Korpela ("Yucca")


                        Comment

                        • dorayme

                          #13
                          Re: Weird error on W3C css validator

                          In article
                          <3fda2584-325e-48f1-bc26-8bd34827bc56@f3 6g2000hsa.googl egroups.com>,
                          Dave Rado <dave.rado@dsl. pipex.comwrote:
                          On 12 May, 22:32, dorayme <doraymeRidT... @optusnet.com.a uwrote:
                          >
                          You should have a "," after "Times Roman"

                          --
                          dorayme
                          >
                          Yes, sorry.
                          >
                          I still think the validator's error message was very unhelpful though.
                          >
                          It's a robot, it does not know quite what is wrong and so it has a stab
                          and we have to read between the lines. <g>

                          It can take x hours to design a machine to do a job. To turn that
                          machine into turn-key operation would mean blowing the budget because
                          the turn-key bit would take an unreasonable proportion of time and
                          effort.

                          What does this last mean? It means that a team can engineer a plant that
                          is excellent for trained staff to use in 18 months for $US1.5 million.
                          But that it might take 5 years and $US6 million to turn it into a plant
                          that less trained staff can use. In other words it is cheaper to train
                          staff!

                          --
                          dorayme

                          Comment

                          • Dave Rado

                            #14
                            Re: Weird error on W3C css validator

                            Hi Andreas

                            On 13 May, 15:40, Andreas Prilop <prilop2...@tra shmail.netwrote :
                            There's "Times New Roman" and there's "Times".
                            But "Times Roman" is not the name of a typeface family, afaik.
                            The Times typeface family consists of
                            Times Roman, Times Italic, Times Bold, Times Bold Italic.
                            How confusing! Thanks for letting me know.

                            Dave

                            Comment

                            Working...