mirror of
https://github.com/servo/servo.git
synced 2025-08-17 03:15:34 +01:00
Fixup for align-self
and tests
This is a fixup for `align-self`, the computed value of which should now properly inherit `align-items` value of its parent. Additional passed tests is also removed from ini folder. Fixup for geckolib errors.
This commit is contained in:
parent
a7733b38d4
commit
f4b8f9766c
10 changed files with 54 additions and 27 deletions
|
@ -1165,6 +1165,13 @@ pub mod style_structs {
|
|||
fn outline_has_nonzero_width(&self) -> bool {
|
||||
self.outline_width != ::app_units::Au(0)
|
||||
}
|
||||
% elif style_struct.trait_name == "Position":
|
||||
fn clone_align_items(&self) -> longhands::align_items::computed_value::T {
|
||||
self.align_items.clone()
|
||||
}
|
||||
fn clone_align_self(&self) -> longhands::align_self::computed_value::T {
|
||||
self.align_self.clone()
|
||||
}
|
||||
% elif style_struct.trait_name == "Text":
|
||||
fn has_underline(&self) -> bool {
|
||||
self.text_decoration.underline
|
||||
|
@ -1890,6 +1897,23 @@ pub fn cascade<C: ComputedValues>(
|
|||
}
|
||||
}
|
||||
|
||||
{
|
||||
use self::style_struct_traits::Position;
|
||||
use computed_values::align_self::T as align_self;
|
||||
use computed_values::align_items::T as align_items;
|
||||
if style.get_position().clone_align_self() == computed_values::align_self::T::auto && !positioned {
|
||||
let self_align =
|
||||
match context.inherited_style.get_position().clone_align_items() {
|
||||
align_items::stretch => align_self::stretch,
|
||||
align_items::baseline => align_self::baseline,
|
||||
align_items::flex_start => align_self::flex_start,
|
||||
align_items::flex_end => align_self::flex_end,
|
||||
align_items::center => align_self::center,
|
||||
};
|
||||
style.mutate_position().set_align_self(self_align);
|
||||
}
|
||||
}
|
||||
|
||||
// The initial value of border-*-width may be changed at computed value time.
|
||||
% for side in ["top", "right", "bottom", "left"]:
|
||||
// Like calling to_computed_value, which wouldn't type check.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue