mirror of
https://github.com/servo/servo.git
synced 2025-06-23 16:44:33 +01:00
Auto merge of #17971 - upsuper:linear-gradient, r=canaltinova
Always set mBgPos for LineDirection::Vertical This fixes [bug 1385469](https://bugzilla.mozilla.org/show_bug.cgi?id=1385469).
This commit is contained in:
commit
187254bf26
1 changed files with 12 additions and 8 deletions
|
@ -229,14 +229,18 @@ impl nsStyleImage {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
LineDirection::Vertical(y) => {
|
LineDirection::Vertical(y) => {
|
||||||
// Y::Bottom (to bottom) is ignored because it is the default value.
|
// Although bottom is the default value, we can not ignore
|
||||||
if y == Y::Top {
|
// it here, because the rendering code of Gecko relies on
|
||||||
unsafe {
|
// this to behave correctly for legacy mode.
|
||||||
(*gecko_gradient).mBgPosX
|
let y = match y {
|
||||||
.set_value(CoordDataValue::Percent(0.5));
|
Y::Top => 0.0,
|
||||||
(*gecko_gradient).mBgPosY
|
Y::Bottom => 1.0,
|
||||||
.set_value(CoordDataValue::Percent(0.0));
|
};
|
||||||
}
|
unsafe {
|
||||||
|
(*gecko_gradient).mBgPosX
|
||||||
|
.set_value(CoordDataValue::Percent(0.5));
|
||||||
|
(*gecko_gradient).mBgPosY
|
||||||
|
.set_value(CoordDataValue::Percent(y));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
LineDirection::Corner(horiz, vert) => {
|
LineDirection::Corner(horiz, vert) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue