mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Blockify elements in a flex container
A inline-level child of a flex container should be converted to its block equivalent. according to CSS2.1 § 9.7.
This commit is contained in:
parent
c2a22bd05e
commit
6d0756512d
1 changed files with 4 additions and 2 deletions
|
@ -1876,7 +1876,9 @@ pub fn cascade<C: ComputedValues>(
|
|||
longhands::position::SpecifiedValue::absolute |
|
||||
longhands::position::SpecifiedValue::fixed);
|
||||
let floated = style.get_box().clone_float() != longhands::float::SpecifiedValue::none;
|
||||
if positioned || floated || is_root_element {
|
||||
let is_flex_item =
|
||||
context.inherited_style.get_box().clone_display() == computed_values::display::T::flex;
|
||||
if positioned || floated || is_root_element || is_flex_item {
|
||||
use computed_values::display::T;
|
||||
|
||||
let specified_display = style.get_box().clone_display();
|
||||
|
@ -1897,7 +1899,7 @@ pub fn cascade<C: ComputedValues>(
|
|||
let box_ = style.mutate_box();
|
||||
box_.set_display(computed_display);
|
||||
% if product == "servo":
|
||||
box_.set__servo_display_for_hypothetical_box(if is_root_element {
|
||||
box_.set__servo_display_for_hypothetical_box(if is_root_element || is_flex_item {
|
||||
computed_display
|
||||
} else {
|
||||
specified_display
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue