Uncomment more stuff related to box construction

This commit is contained in:
Anthony Ramine 2019-09-19 11:58:07 +02:00
parent c08cfbb5f3
commit 9cef3eee65
4 changed files with 226 additions and 202 deletions

View file

@ -42,15 +42,24 @@ ${helpers.single_keyword(
spec="Internal (not web-exposed)",
)}
${helpers.single_keyword(
"position",
"static absolute relative fixed" + (" sticky" if engine in ["gecko", "servo-2013"] else ""),
engines="gecko servo-2013 servo-2020",
animation_value_type="discrete",
flags="CREATES_STACKING_CONTEXT ABSPOS_CB",
spec="https://drafts.csswg.org/css-position/#position-property",
servo_restyle_damage="rebuild_and_reflow",
)}
<%helpers:single_keyword
name="position"
values="static absolute relative fixed ${'sticky' if engine in ['gecko', 'servo-2013'] else ''}"
engines="gecko servo-2013 servo-2020"
animation_value_type="discrete"
flags="CREATES_STACKING_CONTEXT ABSPOS_CB"
spec="https://drafts.csswg.org/css-position/#position-property"
servo_restyle_damage="rebuild_and_reflow"
>
impl computed_value::T {
pub fn is_absolutely_positioned(self) -> bool {
match self {
Self::Absolute | Self::Fixed => true,
_ => false,
}
}
}
</%helpers:single_keyword>
${helpers.predefined_type(
"float",

View file

@ -61,6 +61,13 @@ pub enum Float {
None,
}
impl Float {
/// Returns true if `self` is not `None`.
pub fn is_floating(self) -> bool {
self != Self::None
}
}
impl ToComputedValue for SpecifiedFloat {
type ComputedValue = Float;