aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/style/properties/properties.mako.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs
index 9bb65979f4e..a15bd3225f2 100644
--- a/components/style/properties/properties.mako.rs
+++ b/components/style/properties/properties.mako.rs
@@ -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