Skip to content

Commit

Permalink
Bug 1587368 - servo: Uncomment more stuff related to box construction…
Browse files Browse the repository at this point in the history
…. r=emilio
  • Loading branch information
nox authored and emilio committed Oct 9, 2019
1 parent f24e944 commit 42cb31d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
27 changes: 18 additions & 9 deletions servo/components/style/properties/longhands/box.mako.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions servo/components/style/values/computed/box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 42cb31d

Please sign in to comment.