mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Implement flexbox reordering
Add style property for order and implement reordering by this property in flex flow. Based on previous work by @zentner-kyle.
This commit is contained in:
parent
b214205ba9
commit
3580f91291
10 changed files with 96 additions and 69 deletions
|
@ -4906,6 +4906,28 @@ pub mod longhands {
|
|||
|
||||
// Flex container properties
|
||||
${single_keyword("flex-direction", "row row-reverse column column-reverse", experimental=True)}
|
||||
|
||||
// https://drafts.csswg.org/css-flexbox/#propdef-order
|
||||
<%self:longhand name="order">
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
impl ComputedValueAsSpecified for SpecifiedValue {}
|
||||
|
||||
pub type SpecifiedValue = computed_value::T;
|
||||
|
||||
pub mod computed_value {
|
||||
pub type T = i32;
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get_initial_value() -> computed_value::T {
|
||||
0
|
||||
}
|
||||
|
||||
fn parse(_context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
|
||||
specified::parse_integer(input)
|
||||
}
|
||||
</%self:longhand>
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue