mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
style: Use saturating addition for math-depth
Differential Revision: https://phabricator.services.mozilla.com/D114070
This commit is contained in:
parent
43cec05c04
commit
516c7a304a
1 changed files with 2 additions and 2 deletions
|
@ -828,14 +828,14 @@ impl ToComputedValue for specified::MathDepth {
|
||||||
let parent = cx.builder.get_parent_font().clone_math_depth() as i32;
|
let parent = cx.builder.get_parent_font().clone_math_depth() as i32;
|
||||||
let style = cx.builder.get_parent_font().clone_math_style();
|
let style = cx.builder.get_parent_font().clone_math_style();
|
||||||
if style == MathStyleValue::Compact {
|
if style == MathStyleValue::Compact {
|
||||||
parent + 1
|
parent.saturating_add(1)
|
||||||
} else {
|
} else {
|
||||||
parent
|
parent
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
specified::MathDepth::Add(rel) => {
|
specified::MathDepth::Add(rel) => {
|
||||||
let parent = cx.builder.get_parent_font().clone_math_depth();
|
let parent = cx.builder.get_parent_font().clone_math_depth();
|
||||||
parent as i32 + rel.to_computed_value(cx)
|
(parent as i32).saturating_add(rel.to_computed_value(cx))
|
||||||
},
|
},
|
||||||
specified::MathDepth::Absolute(abs) => abs.to_computed_value(cx),
|
specified::MathDepth::Absolute(abs) => abs.to_computed_value(cx),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue