css-validator icon indicating copy to clipboard operation
css-validator copied to clipboard

Clip Bug

Open RichardCox09 opened this issue 3 years ago • 2 comments

Consider the following example:

.foo{
  position : absolute;
  clip : rect(0,0,0,0);
}

Without my change, the validator threw and exception that there were too few arguments for the function.

RichardCox09 avatar Aug 11 '22 12:08 RichardCox09

The example you give is not throwing an exception, at least not on https://jigsaw.w3.org/css-validator/#validate_by_input DO you have ways of reproducing this?

ylafon avatar Aug 22 '22 16:08 ylafon

Hello,

first of all, sorry for taking so long to reply, I must have overread your comment.

Yes, you are totally right, the web-validator doesn't throw an exception.

BUT: If you try to validate it with the Java source code, it throws an exception. If you don't set the Medium of the ApplContext (ApplContext.setMedium()), it throws the Exception.

The exception comes from CssParser Line 6157, where it says if (!values.end() && ac.getMedium() == null) { addError(new InvalidParamException("unrecognize", "", ac), values);

If you don't set the meidum, it is null, and the if is true, so it adds an error.

My suspicion is that the web-validator has set a medium, could that be?

I hope this helps with recreating the problem.

RichardCox09 avatar Oct 26 '22 06:10 RichardCox09