Skip to content

Cleanup predefined type for list-style-image #19571

Closed

Description

@fenak

The implementation from #19570 has to pass the following arguments:

${helpers.predefined_type("list-style-image",
                          "ListStyleImage",
                          initial_value="specified::ListStyleImage::none()",
                          initial_specified_value="specified::ListStyleImage::none()",
...

As both of them use the same function specified::ListStyleImage::none(), it makes sense to not have them both needed, but seems to be tied on the shorthand implementation that uses unwrap_or_initial!, which calls get_initial_specified_value unless a different function is specified on the helper parameter.

Activity

  1. emilio commented on Dec 15, 2017

    @emilio
    Member

    Hmm, so I don't think this is too trivial to simplify. In particular, we want a specified value for the shorthand, but not for the longhand... Do you have any idea on how to clean it up? We can of course expand it manually to use none, that may not be too bad...

  2. emilio commented on Dec 15, 2017

    @emilio
    Member

    that may not be too bad...

    (Even though I think it's not worth to do this to save a single line of code there, you end up repeating none in other places :/)

  3. fenak commented on Dec 15, 2017

    @fenak
    Author

    If that's the case, feel free to close it. I agree with not putting a lot of effort to minimal benefit.
    I don't have the knowledge yet on how the whole thing works, but I'm getting to understand the whole shorthand/longhand thing :)

  4. emilio commented on Dec 15, 2017

    @emilio
    Member

    Yeah, it's not clear to me what's the best way to simplify this. We could try initial_computed_value if there's no initial_specified_value, but I'm not sure it's worth it, given it seems a bit more magical and needs more python stuff which we're generally trying to remove :)

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