mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
stylo: Implement -moz-prefixed radial gradients
This commit is contained in:
parent
3e42684d3c
commit
d589645ee9
5 changed files with 119 additions and 56 deletions
|
@ -256,7 +256,7 @@ impl nsStyleImage {
|
|||
}
|
||||
gecko_gradient
|
||||
},
|
||||
GradientKind::Radial(shape, position) => {
|
||||
GradientKind::Radial(shape, position, angle) => {
|
||||
let keyword_to_gecko_size = |keyword| {
|
||||
match keyword {
|
||||
ShapeExtent::ClosestSide => NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE,
|
||||
|
@ -297,9 +297,14 @@ impl nsStyleImage {
|
|||
stop_count as u32)
|
||||
};
|
||||
|
||||
// Clear mAngle and mBgPos fields
|
||||
// Clear mBgPos field and set mAngle if angle is set. Otherwise clear it.
|
||||
unsafe {
|
||||
(*gecko_gradient).mAngle.set_value(CoordDataValue::None);
|
||||
if let Some(angle) = angle {
|
||||
(*gecko_gradient).mAngle.set(angle);
|
||||
} else {
|
||||
(*gecko_gradient).mAngle.set_value(CoordDataValue::None);
|
||||
}
|
||||
|
||||
(*gecko_gradient).mBgPosX.set_value(CoordDataValue::None);
|
||||
(*gecko_gradient).mBgPosY.set_value(CoordDataValue::None);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue