Properly set default direction of prefixed linear gradients

The default linear gradient direction is `to bottom`. This correspondes to
`top` keyword in prefixed linear gradients. We should preserve the default value.
This commit is contained in:
Nazım Can Altınova 2017-08-30 20:55:18 -07:00
parent 19cbea23a8
commit a0c1eb5109
3 changed files with 17 additions and 7 deletions

View file

@ -78,10 +78,13 @@ pub type ColorStop = GenericColorStop<RGBA, LengthOrPercentage>;
pub type MozImageRect = GenericMozImageRect<NumberOrPercentage, ComputedUrl>;
impl GenericLineDirection for LineDirection {
fn points_downwards(&self) -> bool {
fn points_downwards(&self, compat_mode: CompatMode) -> bool {
match *self {
LineDirection::Angle(angle) => angle.radians() == PI,
LineDirection::Vertical(Y::Bottom) => true,
LineDirection::Vertical(Y::Bottom)
if compat_mode == CompatMode::Modern => true,
LineDirection::Vertical(Y::Top)
if compat_mode != CompatMode::Modern => true,
LineDirection::Corner(..) => false,
#[cfg(feature = "gecko")]
LineDirection::MozPosition(_, _) => false,