mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Further changes required by Servo
This commit is contained in:
parent
4522e7f94a
commit
35bf5f0b09
1 changed files with 9 additions and 2 deletions
|
@ -243,6 +243,13 @@ impl generic::CalcNodeLeaf for Leaf {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn trig_enabled() -> bool {
|
||||||
|
#[cfg(feature = "gecko")]
|
||||||
|
return static_prefs::pref!("layout.css.trig.enabled");
|
||||||
|
#[cfg(feature = "servo")]
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// A calc node representation for specified values.
|
/// A calc node representation for specified values.
|
||||||
pub type CalcNode = generic::GenericCalcNode<Leaf>;
|
pub type CalcNode = generic::GenericCalcNode<Leaf>;
|
||||||
|
|
||||||
|
@ -314,7 +321,7 @@ impl CalcNode {
|
||||||
CalcNode::parse(context, input, function, expected_unit)
|
CalcNode::parse(context, input, function, expected_unit)
|
||||||
},
|
},
|
||||||
(&Token::Ident(ref ident), _) => {
|
(&Token::Ident(ref ident), _) => {
|
||||||
if !static_prefs::pref!("layout.css.trig.enabled") {
|
if !trig_enabled() {
|
||||||
return Err(location.new_unexpected_token_error(Token::Ident(ident.clone())));
|
return Err(location.new_unexpected_token_error(Token::Ident(ident.clone())));
|
||||||
}
|
}
|
||||||
let number = match_ignore_ascii_case! { &**ident,
|
let number = match_ignore_ascii_case! { &**ident,
|
||||||
|
@ -593,7 +600,7 @@ impl CalcNode {
|
||||||
Err(()) => return Err(location.new_unexpected_token_error(Token::Function(name.clone()))),
|
Err(()) => return Err(location.new_unexpected_token_error(Token::Function(name.clone()))),
|
||||||
};
|
};
|
||||||
|
|
||||||
if matches!(function, Sin | Cos | Tan | Asin | Acos | Atan) && !static_prefs::pref!("layout.css.trig.enabled") {
|
if matches!(function, Sin | Cos | Tan | Asin | Acos | Atan) && !trig_enabled() {
|
||||||
return Err(location.new_unexpected_token_error(Token::Function(name.clone())));
|
return Err(location.new_unexpected_token_error(Token::Function(name.clone())));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue