Skip to content

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

@Gregable

Description

@Gregable

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions