mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Adjust float if the element is positioned per CSS 2.1 section 9.7
We've found crashes related to this in Gecko.
This commit is contained in:
parent
050d9d9097
commit
e67f5c7585
1 changed files with 17 additions and 4 deletions
|
@ -1953,10 +1953,14 @@ pub fn apply_declarations<'a, F, I>(viewport_size: Size2D<Au>,
|
||||||
% endif
|
% endif
|
||||||
computed_values::display::T::flex |
|
computed_values::display::T::flex |
|
||||||
computed_values::display::T::inline_flex);
|
computed_values::display::T::inline_flex);
|
||||||
let (blockify_root, blockify_item) = match flags.contains(SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP) {
|
|
||||||
false => (is_root_element, is_item),
|
let (blockify_root, blockify_item) =
|
||||||
true => (false, false),
|
if flags.contains(SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP) {
|
||||||
};
|
(false, false)
|
||||||
|
} else {
|
||||||
|
(is_root_element, is_item)
|
||||||
|
};
|
||||||
|
|
||||||
if positioned || floated || blockify_root || blockify_item {
|
if positioned || floated || blockify_root || blockify_item {
|
||||||
use computed_values::display::T;
|
use computed_values::display::T;
|
||||||
|
|
||||||
|
@ -2013,6 +2017,15 @@ pub fn apply_declarations<'a, F, I>(viewport_size: Size2D<Au>,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CSS 2.1 section 9.7:
|
||||||
|
//
|
||||||
|
// If 'position' has the value 'absolute' or 'fixed', [...] the computed
|
||||||
|
// value of 'float' is 'none'.
|
||||||
|
//
|
||||||
|
if positioned && floated {
|
||||||
|
style.mutate_box().set_float(longhands::float::computed_value::T::none);
|
||||||
|
}
|
||||||
|
|
||||||
// This implements an out-of-date spec. The new spec moves the handling of
|
// This implements an out-of-date spec. The new spec moves the handling of
|
||||||
// this to layout, which Gecko implements but Servo doesn't.
|
// this to layout, which Gecko implements but Servo doesn't.
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue