🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

[motion-1] offset-path should accept <url> instead of <url()> #508

Closed

Description

@cdoublev

I suspect the intended production is <url>, which also accepts <src()>.

https://drafts.fxtf.org/motion-1/#typedef-offset-path


Aside

<url()> and <src()> are never defined with their own production rules:

The <url> type, written with the url() and src() functions, represents a URL, which is a pointer to a resource.

The syntax of <url> is:

<url> = url( <string> <url-modifier>* ) |
        src( <string> <url-modifier>* )

For legacy reasons, a url() can be written without quotation marks around the URL itself, in which case it is specially-parsed as a <url-token>

https://drafts.csswg.org/css-values-4/#url-value

Therefore I considered <url-token> as a replacement of <url>, instead of increasing maintenance cost with a "custom" production rule.

Ideally:

<url> = <url()> | <src()>
<url()> = url( <string> <url-modifier>* ) | <url-token>
<src()> = src( <string> <url-modifier>* )

Activity

  1. tabatkins commented on Mar 14, 2023

    @tabatkins
    Member

    I suspect the intended production is , which also accepts <src()>.

    Yup.

    <url()> and <src()> are never defined with their own production rules:

    Because it isn't necessary for our purposes. ^_^ But I can do that, I suppose.

    Therefore I considered as a replacement of , instead of increasing maintenance cost with a "custom" production rule.

    This is very much incorrect. All token productions are usually wrong for use as values directly, as they only correspond to particular literal syntaxes and don't allow for other ways of producing the same value.

    But it's especially wrong for <url>, since url(foo) is a <url-token> but url("foo") is a <function-token> (followed by a string and a close-paren).

  2. cdoublev commented on Mar 14, 2023

    @cdoublev
    ContributorAuthor

    Thanks! 🆒

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions