Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validator: CSS parsing errors reported in style attributes incorrectly offset #27507

Closed
Gregable opened this issue Mar 31, 2020 · 1 comment
Closed
Labels
P2: Soon Type: Bug Validator: Type: Error Messages Issue with the quality of the error messages that the validator produces WG: caching

Comments

@Gregable
Copy link
Member

Example:

<b style="a">

Validator will return an error message about an incomplete declaration. The column information will be at position 0 (or whatever column the tag starts at). Similarly:

<b style=" a">

The column will be reported at position 1 (or whatever column the tag starts at plus 1).

The line/col offset for the CSS position within the attribute value is being added to the line/col offset for the tag, rather than for the style attribute value.

For the second example above, assume everything is on the same line. The tag starts at column 0. The attribute value starts at column 10. The error is in the 2nd byte position in the attribute value (position 1 in 0-indexed array). The error is being reported at tag column 0 + attribute value position 1 = column 1. The error should be reported at column 11 (attribute value start 10 + attribute value position 1.

@Gregable Gregable added Type: Bug P2: Soon WG: caching Validator: Type: Error Messages Issue with the quality of the error messages that the validator produces labels Mar 31, 2020
@Gregable
Copy link
Member Author

Gregable commented May 1, 2020

This has been improved by pointing the line/col at the start of the tag instead of trying to offset inside the CSS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2: Soon Type: Bug Validator: Type: Error Messages Issue with the quality of the error messages that the validator produces WG: caching
Projects
None yet
Development

No branches or pull requests

1 participant