w3c / css-validator

W3C CSS Validation Service
https://jigsaw.w3.org/css-validator/
Other
204 stars 105 forks source link

Clip Bug #375

Open RichardCox09 opened 2 years ago

RichardCox09 commented 2 years ago

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.

ylafon commented 2 years ago

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?

RichardCox09 commented 1 year ago

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.