Skip to content

[motion-1] The computed value of offset-path: path(' ') #392

Closed

Description

@BorisChiou

Based on the definition of SVG1.1 and SVG2:

The EBNF allows the path data string in the d property to be empty. An empty path data string disables rendering of the path. Rendering is also disabled when the d property has the value none.

So an empty path string is valid. And then what is the expected computed value for this case?

offset-path: path(' ');

If someone calls getComputedStyle(div).offsetPath, should we return path('') or none for offset-path? It seems Blinks return none for now. It looks like the spec doesn't mention this, anyway.

Activity

  1. BorisChiou commented on Jan 22, 2020

    @BorisChiou
    Author
  2. changed the title [-][motion-1] How to present offset-path: path(' ')[/-] [+][motion-1] The computed value of offset-path: path(' ')[/+] on Jan 22, 2020
  3. ewilligers commented on Jan 22, 2020

    @ewilligers
    Contributor

    Blink treats <path d=""/> and <path /> and <path style="d: path('')" /> and <path style="d: none" /> all as having path none - example.

    I don't see value in maintaining different computed style states for these.

    The spec could state that path() with an empty path string serializes as none.

  4. BorisChiou commented on Jan 22, 2020

    @BorisChiou
    Author

    Great. Thanks. This is also for clip-path. I'm also updating Gecko to have none value for clip-path: path(' ').

  5. emilio commented on Jan 23, 2020

    @emilio
    Contributor

    It seems really odd to serialize it as none but parse it as valid. It seems to me that path('') is a fine path, just with no commands...

  6. ewilligers commented on Jan 23, 2020

    @ewilligers
    Contributor

    It seems to me that path('') is a fine path, just with no commands..

    It is, that is why in the example it sets the specified value, while path('nonsense') does not. This is about normalization: no commands is equivalent to no path.

  7. emilio commented on Jan 23, 2020

    @emilio
    Contributor

    But they're not the same, right? offset-path: path('') should establish a containing block and so on. It's just not equivalent to none the same way as transform: translate(0) is not equivalent to transform: none.

  8. added a commit that references this issue on Jan 24, 2020
  9. added a commit that references this issue on Jan 25, 2020
  10. added a commit that references this issue on Feb 12, 2020
  11. css-meeting-bot commented on Dec 3, 2020

    @css-meeting-bot
    Member

    The CSS Working Group just discussed [motion-1] The computed value of offset-path: path(' '), and agreed to the following:

    • RESOLVED: Invalid path strings make the syntax invalid at parse time
    • RESOLVED: Empty path is considered invalid
    The full IRC log of that discussion <dael> Topic: [motion-1] The computed value of offset-path: path(' ')
    <dael> github: https://github.com//issues/392
    <dael> fantasai: I don't know much on this, but it seemed we should resolve and fix.
    <dael> heycam: The ultimate issue is we have path function which takes string value. string is svg data string.
    <dael> heycam: Some strings are invalid. What does that mean for validity of path function. If you use invalid path string inside is it all parse as invalid and dropped or is string preserved and invalidity handled later
    <dael> TabAtkins: If it's valid how to serialize and if not valid clarify that
    <dael> florian: Precedint in other properties
    <dael> fantasai: IN grid we throw out what's invalid after parsing
    <fantasai> s/Precedint/Precedent/
    <dael> florian: Same here?
    <dael> heycam: NO reason not to
    <dael> florian: No architectural complexity so seems like right thing to do
    <dael> TabAtkins: Larger question then what's asked in issue. If you have invalid pass it's a separate question. The empty string specifically is a valid path per svg grammer but it disabled rendering of paths. Question is how is it cannonicalized and serialized. In chomre it's serialized as none. All other paths stay as paths but none doesn't so doesn't create containing block
    <dael> heycam: Surprises me. I think it then does not make sense to serialize as none
    <dael> TabAtkins: If we decide to treat as invalid that's okay with me and this solves iteself. If we want that we should record it. It's about if empty path is valid or not.
    <dael> florian: Is it useful?
    <dael> TabAtkins: No
    <dael> florian: THen make it invalid ad see if world breaks
    <dael> TabAtkins: Invalid is probably more consistent with chrome behavior
    <dael> fantasai: 2 resolutions?
    <dael> heycam: IN issues it's also mentioned strings with only whitespace. Same?
    <dael> florian: Suppose so
    <dael> TabAtkins: Yeah. Regardless of specifics of svg grammar shouldn't treat different
    <dael> Rossen_: can someone summerize?
    <dael> TabAtkins: 1) Invalid path strings make the syntax invalid at parse time
    <dael> Rossen_: Objections?
    <dael> RESOLVED: Invalid path strings make the syntax invalid at parse time
    <dael> TabAtkins: 2) The empty string is an invalid path string
    <dael> florian: With whoever does the edits being careful for all empty types
    <dael> fantasai: Basically 0 length path
    <dael> fantasai: 0 length path description
    <dael> TabAtkins: If we say it's empty we can deal with specifics lather
    <dael> florian: Empty path not empty strong
    <fantasai> s/strong/string
    <dael> Rossen_: Empty path is considered invalid
    <dael> Rossen_: Objections?
    <heycam> "a string with no path commands in it", maybe
    <dael> RESOLVED: Empty path is considered invalid
    <astearns> s/lather/later/
    <dael> Rossen_: Anything else?
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