You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
@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
Activity
fenak commentedon Dec 14, 2017
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?fenak commentedon Dec 14, 2017
Another question: I see
% if product == "gecko"in the mako templates, is that translated to#[cfg(feature = "gecko")]outside of it?emilio commentedon Dec 14, 2017
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
Urland such, much likevalues::generics::Imageis generic overImageUrl.That's exactly right :)
fenak commentedon Dec 14, 2017
@emilio in this case, how should I handle and
elseclause outside mako?emilio commentedon Dec 14, 2017
In this case, given the line is kinda repeated, I'd do something like:
But otherwise you could do:
Auto merge of #19570 - fenak:list-style-image-mako, r=emilio