Skip to content

Move list-style-image outside of mako. #19557

Closed

Description

@emilio

Part of #19015.

@fenak mentioned he wanted to work on this over there, thanks a lot! :)

Activity

  1. added
    C-assigned
    on Dec 14, 2017
  2. fenak commented on Dec 14, 2017

    @fenak

    Hi @emilio , I'm a little bit confused on the trivial_to_compute_value!(T), as there's a comment saying this is wrong. Can you shed some light on it?

  3. fenak commented on Dec 14, 2017

    @fenak

    Another question: I see % if product == "gecko" in the mako templates, is that translated to #[cfg(feature = "gecko")] outside of it?

  4. emilio commented on Dec 14, 2017

    @emilio
    MemberAuthor

    Hi @emilio , I'm a little bit confused on the trivial_to_compute_value!(T), as there's a comment saying this is wrong. Can you shed some light on it?

    Yes, so this is wrong and should be fixed, but ideally in a different PR. In particular, computed and specified urls in servo are different, and that means that the specified value should be generic over the Url and such, much like values::generics::Image is generic over ImageUrl.

    Another question: I see % if product == "gecko" in the mako templates, is that translated to #[cfg(feature = "gecko")] outside of it?

    That's exactly right :)

  5. fenak commented on Dec 14, 2017

    @fenak

    @emilio in this case, how should I handle and else clause outside mako?

            % if product == "gecko":
            let mut value = input.try(|input| UrlOrNone::parse(context, input))?;
            if let Either::First(ref mut url) = value {
                url.build_image_value();
            }
            % else :
            let value = input.try(|input| UrlOrNone::parse(context, input))?;
            % endif
    
    
  6. emilio commented on Dec 14, 2017

    @emilio
    MemberAuthor

    In this case, given the line is kinda repeated, I'd do something like:

    let mut url = input.try(|input| UrlOrNone::parse(context, input))?;
    
    #[cfg(feature = "gecko")]
    {
        if let Either::First(ref mut url) = value {
            url.build_image_value();
        }
    }

    But otherwise you could do:

    #[cfg(feature = "gecko")]
    {
        // ...
    }
    #[cfg(not(feature = "gecko"))]
    {
        // ...
    }
  7. added a commit that references this issue on Dec 15, 2017
    da3dd05
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

    C-assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions