Skip to content

Redefine special parsing rules for presentation attributes to match quirky CSS #792

Open

Description

@AmeliaBR

See w3c/csswg-drafts#4874

Short version: CSS needs to handle using numbers as lengths in quirks mode. SVG has special rules for using numbers as lengths or angles in presentation attributes. CSS is trying to define this more clearly, SVG should harmonize.

Activity

  1. AmeliaBR commented on Apr 15, 2020

    @AmeliaBR
    ContributorAuthor

    Update: corrected the link above, should be
    https://svgwg.org/svg2-draft/types.html#syntax
    (the second part of that section has the fix-up algorithm for presentation attributes)

  2. AtkinsSJ commented on Sep 25, 2023

    @AtkinsSJ
    Contributor

    I have some additional questions related to the fix-up algorithm in particular:

    1. After parsing the <number>, how should it be interpreted? I assume it should become a <length> in px, or an <angle> in deg, similar to the CSS unitless-length quirk?
    2. How do range restrictions on the <angle>s or <length>s apply to these <number>s?
    3. Just specifying these as accepting <number> means implicitly allowing any function notation that evaluates to <number>. Is that intentional? eg: calc(42 * 3) is valid as an <angle> or <length> under the current description.
    4. "Replace all instances of..." seems to mean that functions like atan(30) would be valid that should only accept <angle> as a parameter.

    My impression is that this is supposed to behave like the unitless-length quirk, but some CSS definitions have changed in the mean time and the spec no longer matches that intention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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