Skip to content

Add test for "d" attribute to path() function, part of shape() test suit #1262

@cyberalien

Description

@cyberalien

Test List

https://wpt.fyi/results/css/css-shapes/shape-functions?label=master&label=experimental&aligned

Rationale

path() function is part of test suite, but unlike other functions, it can be used for d attribute of <path /> element.

Lack of test for d attribute makes coverage a bit misleading. Safari claims to have wide support of shape functions, but in reality it is the only browser that does not support path() completely.

Why is it a big issue?

By moving path of <path /> element to CSS, it is possible to (just few examples):

  • Get rid of SVG sprites. Path is usually the biggest part of SVG, if moved to CSS, the only attribute for path element required is class name, massively reducing HTML size, while also caching shapes in CSS file, which would be a better solution for minimizing HTML size than SVG sprites.
  • Path can be animated, enabling CSS animations for SVG.
  • Path can be changed based on other CSS conditions: color scheme, parent class and so on.

Support for path() for d property can lead to development of animated vector icons.

All browsers have supported this for years, except for Safari. Safari has supported this in Technology Preview since 2024, but 2 years later it is still not available in stable version. By adding this to tests, it might lead Safari developers to finally enable support in stable version.

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