Isn't "text-overflow: ellipsis" valid CSS?
Asked Answered
H

2

7

This code triggers an error when run through the W3C CSS Validator:

p{
    text-overflow: ellipsis;
}

I get:

Line     Code context      Error/Warning
2        p                 Parse Error [empty string]

Is it just a bug in the validator or am I missing something really obvious?

Haya answered 1/8, 2012 at 10:38 Comment(0)
H
10

This is a bug in the CSS validator, it has been already reported. text-overflow:ellipsis is a valid rule, however the W3C CSS validator is unfortunately prone to errors (see bug list).

However, note that the current working draft lists some text-overflow values as feature at risk:

The Working Group has identified the following features as at risk of being removed from CSS Basic User Interface Module Level 3 when exiting CR. Implementors are urged to implement these features, if they wish to see these features remain in this specification. All other features are either defined in a normative reference (e.g. CSS 2.1 [CSS21] or Selectors [SELECT]) or are believed to have two or more implementations, and thus will not be dropped without returning to last call.

  • [...]
  • text-overflow property value: <string>
  • text-overflow property 2-value syntax and definition.

While this doesn't affect the ellipsis value, it could be the source of the bug in the validator:

Parse Error [empty string]

References

Heribertoheringer answered 1/8, 2012 at 10:45 Comment(3)
With regard to it being at risk...I read it that certain variations of text-overflow are at risk, not the whole thing. User agent support should justify keeping at least the basic ellipsis implementation.Camey
@TimMedora: Yes, addressed this concern and made it more clear. Only some features property values are at risk, not the property itself. ellipsis isn't at risk, however, since the validator prints [empty String] as error, I suspect that those properties are creating the validator's behavior.Heribertoheringer
This error has been around for a very long time. I last ran into it myself in 2010-ish, way before this recent LCWD. Frankly I don't know what they're doing with the validator. I hope they're rewriting it.Revolve
C
2

It's valid based on MDN's reference, which also links to the spec: http://dev.w3.org/csswg/css3-ui/#text-overflow

Out of curiosity, I ran one of my own sites through the validator. I noted that it listed a few things that I would not consider errors, such as properly prefixed vendor extensions and data URIs.

Camey answered 1/8, 2012 at 10:40 Comment(1)
Vendor extensions are not valid because they're not part of the standard. However, they are defined in the grammar so implementations can use them.Revolve

© 2022 - 2024 — McMap. All rights reserved.