Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to gradients. #16666

Merged
merged 7 commits into from May 7, 2017
Next

Implement -webkit-radial-gradient aliases.

In display_list_builder.rs handle cover and contain size keywords.
  • Loading branch information
pyfisch committed Apr 30, 2017
commit e62ad7e68017d31309aa664abb7427944c92f654
@@ -710,7 +710,7 @@ fn convert_circle_size_keyword(keyword: SizeKeyword,
center: &Point2D<Au>) -> Size2D<Au> {
use style::values::computed::image::SizeKeyword::*;
let radius = match keyword {
ClosestSide => {
ClosestSide | Contain => {
let dist = get_distance_to_sides(size, center, ::std::cmp::min);
::std::cmp::min(dist.width, dist.height)
}
@@ -719,12 +719,7 @@ fn convert_circle_size_keyword(keyword: SizeKeyword,
::std::cmp::max(dist.width, dist.height)
}
ClosestCorner => get_distance_to_corner(size, center, ::std::cmp::min),
FarthestCorner => get_distance_to_corner(size, center, ::std::cmp::max),
_ => {
// TODO(#16542)
println!("TODO: implement size keyword {:?} for circles", keyword);
Au::new(0)
}
FarthestCorner | Cover => get_distance_to_corner(size, center, ::std::cmp::max),
};
Size2D::new(radius, radius)
}
@@ -736,15 +731,10 @@ fn convert_ellipse_size_keyword(keyword: SizeKeyword,
center: &Point2D<Au>) -> Size2D<Au> {
use style::values::computed::image::SizeKeyword::*;
match keyword {
ClosestSide => get_distance_to_sides(size, center, ::std::cmp::min),
ClosestSide | Contain => get_distance_to_sides(size, center, ::std::cmp::min),
FarthestSide => get_distance_to_sides(size, center, ::std::cmp::max),
ClosestCorner => get_ellipse_radius(size, center, ::std::cmp::min),
FarthestCorner => get_ellipse_radius(size, center, ::std::cmp::max),
_ => {
// TODO(#16542)
println!("TODO: implement size keyword {:?} for ellipses", keyword);
Size2D::new(Au::new(0), Au::new(0))
}
FarthestCorner | Cover => get_ellipse_radius(size, center, ::std::cmp::max),
}
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.